Skip to content

Commit e3fcf1f

Browse files
committed
fix
1 parent 2d768e9 commit e3fcf1f

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

Easy offline/Easy offline.user.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// @namespace http://tampermonkey.net/
99
// @require https://cdn.jsdelivr.net/jquery/1.7.2/jquery.min.js
1010
// @require https://cdn.jsdelivr.net/hi-base64/0.2.0/base64.min.js
11-
// @version 1.3.6
11+
// @version 1.3.7
1212
// @author Hoothin
1313
// @mail rixixi@gmail.com
1414
// @include http*://*/*
@@ -430,7 +430,7 @@
430430
for (i = 0; i < listLen; i++) {
431431
curNode = nodes[i];
432432
if(curNode.classList.contains("whx-a"))continue;
433-
let href=curNode.getAttribute("href"),rUrl=getRightUrl(href);
433+
let href=curNode.href,rUrl=getRightUrl(href);
434434
let clone=$("<a></a>").attr("style",curNode.getAttribute("style")).attr("href",href).addClass('whx-a').css("background-color","#e1e1e1").css("background-image",'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAARVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADc6ur3AAAAFnRSTlMAYM5vMOA/ENGegK2olI6G1b97Z0sXENA+jAAAAKFJREFUKM+FklkSxCAIRHFfss3K/Y86iQSDVqzpH7FfgQpCVfAmGx+gl9JI0qrxrcNLzooEbKUG4EKWdkCiDRV0N0RTrZ5wvdgTTgp4SzCAHxAPZkAM5GOJWuuT7FE5OVPOBFLTYb3Oc2YB5uJ8+G6pgkTGt74ntcCJHiwFLHw10Tdc93jlGXGvSRtsHNpuPs+/o1ODfxAtSL0f7HPC+L/9AF60G3QxO1UaAAAAAElFTkSuQmCC")');
435435
if(allUrl.toString().indexOf(rUrl)==-1)allUrl.push(rUrl);
436436
clone.mouseover(function(e){

Switch Traditional Chinese and Simplified Chinese/Switch Traditional Chinese and Simplified Chinese.user.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// @name:ja 简繁
55
// @name:en Switch Traditional Chinese and Simplified Chinese
66
// @namespace hoothin
7-
// @version 0.7
7+
// @version 1.0
88
// @description 任意轉換網頁中的簡體中文與繁體中文(默認簡體→繁體)
99
// @description:zh-CN 任意转换网页中的简体中文与繁体中文(默认繁体→简体)
1010
// @description:ja 简繁中国語に変換
@@ -128,7 +128,24 @@
128128
var saveAction=GM_getValue("action" + location.hostname.toString().replace(/\./g,""));
129129
action=saveAction?saveAction:(isSimple?2:3);
130130
if(auto && action > 1){
131-
setTimeout(stranBody,50);
131+
setTimeout(function(){
132+
stranBody();
133+
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
134+
var observer = new MutationObserver(function(records){
135+
records.map(function(record) {
136+
if(record.addedNodes){
137+
[].forEach.call(record.addedNodes,function(item){
138+
stranBody(item);
139+
});
140+
}
141+
});
142+
});
143+
var option = {
144+
'childList': true,
145+
'subtree': true
146+
};
147+
observer.observe(document.body, option);
148+
},50);
132149
}
133150

134151
var curLang=isSimple;

0 commit comments

Comments
 (0)