Created
June 7, 2016 00:21
-
-
Save donohoe/3e3b922c3fe4b44f67bc18e188375e96 to your computer and use it in GitHub Desktop.
Disable the Genius browser extension from working on a web page
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
(function(){ | |
console.log("GK ftw"); | |
function checkFlag() { | |
var checkPage = document.getElementsByTagName("genius-back-page"); | |
if (checkPage.length) { | |
var checkPageEl = checkPage[0] | |
checkPageEl.parentNode.removeChild(checkPageEl); | |
} | |
var checkPrompt = document.getElementsByTagName("genius-pre-annotation-prompt"); | |
if (checkPrompt.length) { | |
var checkPromptEl = checkPrompt[0] | |
checkPromptEl.parentNode.removeChild(checkPromptEl); | |
} | |
var checkGenius = document.getElementsByTagName("genius-referent"); | |
if (checkGenius.length) { | |
var article = document.getElementById("articleBody") || false; // Selector of core article element | |
if (article) { | |
var html = article.innerHTML; | |
html = html.replace(/genius-referent/gi, "span"); | |
article.innerHTML = html; | |
} | |
} | |
window.setTimeout(checkFlag, 998); /* Try again later */ | |
} | |
window.setTimeout(checkFlag, 999); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment