Skip to content

Instantly share code, notes, and snippets.

@donohoe
Created June 7, 2016 00:21
Show Gist options
  • Save donohoe/3e3b922c3fe4b44f67bc18e188375e96 to your computer and use it in GitHub Desktop.
Save donohoe/3e3b922c3fe4b44f67bc18e188375e96 to your computer and use it in GitHub Desktop.
Disable the Genius browser extension from working on a web page
(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