Skip to content

Commit f216b96

Browse files
committed
fix
1 parent ca83968 commit f216b96

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

HacgGodTurn.user.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
// @include http*://www.acgzone.org/*
4343
// @include http*://uraban.me/*
4444
// @include http*://www.uraban.me/*
45-
// @version 3.19.96
45+
// @version 3.19.97
4646
// @grant GM_notification
4747
// @grant GM_xmlhttpRequest
4848
// @run-at document-end
49-
// @require https://greasyfork.org/scripts/23522-od-js/code/odjs.js?version=154476
49+
// @require https://greasyfork.org/scripts/23522-od-js/code/odjs.js?version=154488
5050
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/components/core-min.js
5151
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/rollups/aes.js
5252
// @license MIT License
@@ -548,12 +548,7 @@
548548
}
549549
var content=document.querySelector(contentArea);
550550
if(content){
551-
var oldDrivers = content.childNodes;
552-
for(var childOd of oldDrivers){
553-
if(childOd.innerHTML){
554-
processTxt(childOd);
555-
}
556-
}
551+
processObj(content);
557552
}
558553
var link, imgs, i, k;
559554
if (document.querySelectorAll) {
@@ -636,6 +631,23 @@
636631
}
637632
}
638633

634+
function processObj(obj){
635+
if(obj){
636+
if(obj.nodeType==1){
637+
for(var childOd of obj.childNodes){
638+
processObj(childOd);
639+
}
640+
}else if(obj.nodeType==3){
641+
var data=processTxt(obj.data);
642+
if(obj.data != data){
643+
var newData = document.createElement("p");
644+
obj.parentNode.replaceChild(newData, obj);
645+
newData.outerHTML=data;
646+
}
647+
}
648+
}
649+
}
650+
639651
function clickBlockListener(){
640652
if(document.querySelector("#blockBtn")){
641653
document.querySelector("#blockBtn").addEventListener("click", function(){

0 commit comments

Comments
 (0)