Last active
August 26, 2022 10:32
-
-
Save NguyenKhong/4100b58514e09388dd684cbeb6f27168 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Bypass anti copy | |
// @namespace anticopy | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author NguyenKhong | |
// @match https://blog.tomorrowmarketers.org/* | |
// @run-at document-start | |
// ==/UserScript== | |
let mutationObserver = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
switch (mutation.type) { | |
case "childList": | |
let addedNodes = mutation.addedNodes; | |
//console.log("added", addedNodes); | |
//console.log("mutation", mutation); | |
if(mutation.target.nodeName === "HEAD"){ | |
for(let node of addedNodes){ | |
if (node.nodeName === "SCRIPT" && (node.id === "wpcp_disable_selection" || node.id === "wpcp_disable_Right_Click" || node.id === "wpcp_css_disable_selection")){ | |
node.type = 'javascript/blocked'; | |
node.remove(); | |
continue; | |
} | |
if(node.nodeName === "STYLE" && node.innerText.substr(0, 100).includes(".unselectable")){ | |
node.remove(); | |
} | |
} | |
return; | |
} | |
if(mutation.target.nodeName === "BODY"){ | |
mutationObserver.disconnect(); | |
} | |
} | |
}); | |
}); | |
mutationObserver.observe(document, { | |
attributes: false, | |
characterData: false, | |
childList: true, | |
subtree: true, | |
attributeOldValue: false, | |
characterDataOldValue: false | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment