Greasy Fork

去除W3Schools “notranslate”

去除W3Schools table “notranslate” css class

目前为 2020-09-03 提交的版本。查看 最新版本

// ==UserScript==
// @name         去除W3Schools “notranslate”
// @namespace    https://greasyfork.org/users/37096/
// @homepage     https://greasyfork.org/scripts/33021/
// @supportURL   https://greasyfork.org/scripts/33021/feedback
// @version      1.1.3
// @description  去除W3Schools table “notranslate” css class
// @author       zhouhaiboa
// @match        https://www.w3schools.com/*/*.asp
// @match        https://www.w3schools.com/*/*.asp*
// @icon         https://www.w3schools.com/favicon.ico
// @require      https://cdn.staticfile.org/jquery/3.5.1/jquery.min.js
// @compatible   chrome
// @compatible   firefox
// @compatible   opera
// @license      GNU GPLv3
// @grant        GM_addStyle
// ==/UserScript==

(function() {
  $("table").removeClass("notranslate");
  $("table tr td a").addClass("notranslate");
  $("table tr td:nth-child(1)").addClass("notranslate");
  var ths = $("table tr th");
  for(var i = 0;i<ths.length;i++) {
    ths[i].onclick = function() {
      var j = i+1;
      var s = "table tr td:nth-child(" + j + ")";
      $(j).toggleClass("notranslate");
    };
    alert(i);
  }
})();