Last active
May 10, 2020 02:04
-
-
Save ifyour/06d1a2c75cee3e159937078bf943d935 to your computer and use it in GitHub Desktop.
JavaScript 书签,生成工具:https://mrcoles.com/bookmarklet/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!window.isDebugging && (window.isDebugging = false); | |
isDebugging ? disableDebugger() : enableDebugger(); | |
function enableDebugger() { | |
document.querySelectorAll("*").forEach((elm) => { | |
elm.style.outline = | |
"1px solid #" + (~~(Math.random() * (1 << 24))).toString(16); | |
}); | |
isDebugging = true; | |
} | |
function disableDebugger() { | |
document.querySelectorAll("*").forEach((elm) => { | |
elm.style.outline = "none"; | |
}); | |
isDebugging = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
// Commmon | |
"pre", | |
"code", | |
// GtiHub Gits | |
".js-comment-update", | |
// GtiHub Markdown | |
'.markdown-body h1', | |
'.markdown-body h2', | |
'.markdown-body h3', | |
].reduce((acc, curSelector) => { | |
const nodeList = document.querySelectorAll(curSelector); | |
return [...acc, ...nodeList]; | |
}, []) | |
.forEach((elm) => elm.classList.add("notranslate")); | |
console.log("✅ No Translate Class Inject Success!"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment