Last active
September 10, 2016 11:02
-
-
Save Danetag/dafd1868b5a8f4f3857d63ebca0fafb6 to your computer and use it in GitHub Desktop.
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 Ad free lequipe.fr | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Remove adblock popin on lequipe.fr | |
| // @author Danetag | |
| // @match http://www.lequipe.fr/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| var getParents = function(el) { | |
| var parents = []; | |
| var p = el.parentNode; | |
| while (p !== document.body) { | |
| var o = p; | |
| if (o instanceof HTMLElement) parents.push(o); | |
| p = o.parentNode; | |
| } | |
| return parents[parents.length - 1]; | |
| }; | |
| var getEl = function() { | |
| var el = document.querySelector('.ab-tutorial'); | |
| if (el === null || el === undefined) setTimeout(getEl, 300); | |
| else { | |
| // get the adblock popin | |
| var removeEl = getParents(el); | |
| // remove it hihihi | |
| removeEl.parentNode.removeChild(removeEl); | |
| } | |
| }; | |
| document.addEventListener('DOMContentLoaded', function(){ | |
| getEl(); | |
| }, false); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment