mirror of
https://mirror.ghproxy.com/https://github.com/CxJuice/ScWeb_Chinese_Translate.git
synced 2024-12-23 09:43:45 +08:00
Update userscript.js
This commit is contained in:
parent
bc6339b7c8
commit
50494a7124
@ -3,11 +3,29 @@
|
|||||||
// @namespace Violentmonkey Scripts
|
// @namespace Violentmonkey Scripts
|
||||||
// @match https://uexcorp.space/*
|
// @match https://uexcorp.space/*
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 0.2
|
// @version 0.8.0
|
||||||
|
// @license GNU GPLv3
|
||||||
// @author CxJuice
|
// @author CxJuice
|
||||||
// @description 2022/7/28 12:48:01
|
// @description 2022/7/28 12:48:01
|
||||||
|
// @match https://uexcorp.space/*
|
||||||
|
// @match https://www.erkul.games/*
|
||||||
|
// @grant GM_xmlhttpRequest
|
||||||
|
// @grant GM_getResourceText
|
||||||
|
// @resource zh-CN https://cdn.jsdelivr.net/gh/CxJuice/Uex_Chinese_Translate@main/zh-CN-uex1.7.json
|
||||||
|
// @require https://cdn.bootcdn.net/ajax/libs/timeago.js/4.0.2/timeago.full.min.js
|
||||||
|
// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
window.addEventListener('load', function(event) {
|
||||||
|
// 当页面加载完成时,执行我们的脚本
|
||||||
|
myScript();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 监听页面中的鼠标点击事件
|
||||||
|
document.addEventListener('click', function(event) {
|
||||||
|
// 当发生鼠标点击事件时,执行我们的脚本
|
||||||
|
myScript();
|
||||||
|
});
|
||||||
|
function myScript() {
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -64,10 +82,11 @@
|
|||||||
function shoudTranslateEl(el) {
|
function shoudTranslateEl(el) {
|
||||||
const blockIds = ["readme", "wiki-content"];
|
const blockIds = ["readme", "wiki-content"];
|
||||||
const blockClass = [
|
const blockClass = [
|
||||||
|
"mat-icon",
|
||||||
"CodeMirror",
|
"CodeMirror",
|
||||||
"css-truncate" // 过滤文件目录
|
"css-truncate" // 过滤文件目录
|
||||||
];
|
];
|
||||||
const blockTags = ["CODE", "SCRIPT", "LINK", "IMG", "svg", "TABLE", "ARTICLE", "PRE"];
|
const blockTags = [];
|
||||||
|
|
||||||
if(blockTags.includes(el.tagName)) {
|
if(blockTags.includes(el.tagName)) {
|
||||||
return false;
|
return false;
|
||||||
@ -179,4 +198,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user