Skip to content

Instantly share code, notes, and snippets.

@devmessias
Last active June 19, 2016 23:26
Show Gist options
  • Save devmessias/36574fdf10dd6690200ba93096000783 to your computer and use it in GitHub Desktop.
Save devmessias/36574fdf10dd6690200ba93096000783 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name kill folha ad-blocker kill
// @version 0.0.1
// @namespace https://github.com/devmessias
// @include http://www1.folha.uol.com.br/*
// @match http://*.folha.uol.com.br/*
// @match https://*.folha.uol.com.br/*
// @grant none
// @run-at document-start
// ==/UserScript==
window.addEventListener('beforescriptexecute', function(e) {
for (i = 0; i < document.getElementsByTagName('script').length; i++) {
var scriptTagHasAdBlock = document.getElementsByTagName("script")[i].innerHTML.indexOf('paywall')>=0;
if (scriptTagHasAdBlock) {
e.stopPropagation();
e.preventDefault();
// window.removeEventListener(e.type, arguments.callee, true);
}
}
}, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment