Skip to content

Instantly share code, notes, and snippets.

@Mobius1
Last active May 30, 2017 22:55
Show Gist options
  • Save Mobius1/65ec394d603d1d479ccb5afd38004dc3 to your computer and use it in GitHub Desktop.
Save Mobius1/65ec394d603d1d479ccb5afd38004dc3 to your computer and use it in GitHub Desktop.
Greasemonkey Eurogamer Modal Blocker
// ==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