optimize code
This commit is contained in:
parent
5745a51a21
commit
de16f18b11
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name tieba page
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 1.025
|
||||
// @version 1.026
|
||||
// @author fthvgb1
|
||||
// @match https://tieba.baidu.com/*
|
||||
// @match https://tiebac.baidu.com/*
|
||||
@ -1247,7 +1247,15 @@
|
||||
document.querySelector('body').appendChild(d);
|
||||
}
|
||||
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
startFn();
|
||||
});
|
||||
} else {
|
||||
startFn();
|
||||
}
|
||||
|
||||
const startFn = () => {
|
||||
try {
|
||||
|
||||
if (!check()) {
|
||||
@ -1294,4 +1302,6 @@
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user