Last active
May 30, 2017 22:55
-
-
Save Mobius1/65ec394d603d1d479ccb5afd38004dc3 to your computer and use it in GitHub Desktop.
Greasemonkey Eurogamer Modal Blocker
This file contains hidden or 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 Eurogamer Anti-adblock | |
// @namespace eg | |
// @include http://www.eurogamer.net/articles/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var db = document.body, interval, modal = false; | |
var removeModal = function() { | |
modal = document.querySelector(".fc-root"); | |
if ( modal ) { | |
// Remove the modal | |
db.removeChild(modal); | |
// Remove the classes | |
db.className = ""; | |
// Enable scrolling | |
db.style.overflow = "visible"; | |
clearInterval(interval); | |
} | |
} | |
// EG's script is called 333ms after DOMContentLoaded | |
// so we need to keep checking until we find the modal. | |
interval = setInterval(removeModal, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment