Created
December 4, 2016 12:51
-
-
Save haakonn/100964a4593d4f65ca22164741818934 to your computer and use it in GitHub Desktop.
btno-nopaywall.user.js - bt.no uten betalingsmurinnhold
This file contains 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 btno-nopaywall | |
// @namespace haakonnilsen.com | |
// @include http://www.bt.no/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function remAll(xpath) { | |
var els = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); | |
for (var i = 0; i < els.snapshotLength; i++) { | |
var node = els.snapshotItem(i); | |
node.parentNode.removeChild(node); | |
} | |
} | |
function remSection(name) { | |
remAll("//section[contains(@class, '" + name + "')]"); | |
} | |
function remDiv(className) { | |
remAll("//div[contains(@class, '" + className + "')]"); | |
} | |
remDiv("df-skin-paywall-closed"); | |
remDiv("stripe-promo"); | |
remDiv("ch-subscribe-btn-container"); | |
remSection('ad'); | |
remSection('kundesider'); | |
remAll("//div[@id='widget-perks-frontpage']"); | |
window.addEventListener('load', function() { | |
remAll("//iframe"); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment