Skip to content

Instantly share code, notes, and snippets.

@Danetag
Last active September 10, 2016 11:02
Show Gist options
  • Select an option

  • Save Danetag/dafd1868b5a8f4f3857d63ebca0fafb6 to your computer and use it in GitHub Desktop.

Select an option

Save Danetag/dafd1868b5a8f4f3857d63ebca0fafb6 to your computer and use it in GitHub Desktop.
// ==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