Star
(11 )
You must be signed in to star a gist
Fork
(3 )
You must be signed in to fork a gist
Clone this repository at <script src="https://gist.github.com/joepie91/dfca98eb735e81959cfe.js"></script>
Save joepie91/dfca98eb735e81959cfe to your computer and use it in GitHub Desktop.
Clone this repository at <script src="https://gist.github.com/joepie91/dfca98eb735e81959cfe.js"></script>
Save joepie91/dfca98eb735e81959cfe to your computer and use it in GitHub Desktop.
Remove Wired / V3 "ad-blocker veil"
Supported sites:
Requests for other sites are welcome (admin@cryto.net ).
Changelog
July 25, 2016: Added support for V3.co.uk.
February 19, 2016: Initial release for Wired.
Broken?
GitHub Gist doesn't send notifications when people leave a comment, so shoot me an e-mail at admin@cryto.net . I'll gladly fix it. Fuck advertising.
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
// Mind that sometimes, the javascript: prefix gets lost when copying this somewhere. Ensure that it's still there.
javascript:(function(){window.fetch(window.location).then(function(e){return e.text()}).then(function(e){var t=(new DOMParser).parseFromString(e,"text/html");if((""+window.location).match(/^https?:\/\/(?:[^\.]+\.)?v3\.co\.uk[\/$]/)){var r=t.querySelector(".article-page-body-content"),o=document.querySelector("#rdm-below-summary");o.parentNode.insertBefore(r,o.nextSibling);var n=Array.from(document.querySelectorAll(".r3z-wait")).concat(Array.from(document.querySelectorAll(".r3z-hide")));n.forEach(function(e){e.parentNode.removeChild(e)})}else if((""+window.location).match(/^https?:\/\/(?:[^\.]+\.)?wired\.(?:co\.uk|com)[\/$]/)){var r=t.querySelector("[data-js='post']"),o=document.querySelector("[data-js='postHeader']");o.parentNode.insertBefore(r,o.nextSibling);var c=document.querySelector("#veil");c.parentNode.removeChild(c),document.body.classList.remove("no-scroll")}});})();
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
(function(){
window.fetch(window.location).then(function(response) {
return response.text();
}).then(function(responseText) {
var fakeDocument = (new DOMParser()).parseFromString(responseText, "text/html");
if (window.location.toString().match(/^https?:\/\/(?:[^\.]+\.)?v3\.co\.uk[\/$]/)) {
// v3.co.uk
var articleContents = fakeDocument.querySelector(".article-page-body-content");
var prevElement = document.querySelector("#rdm-below-summary");
prevElement.parentNode.insertBefore(articleContents, prevElement.nextSibling);
var veilElements = Array.from(document.querySelectorAll(".r3z-wait")).concat(Array.from(document.querySelectorAll(".r3z-hide")));
veilElements.forEach(function(element) {
element.parentNode.removeChild(element);
});
} else if (window.location.toString().match(/^https?:\/\/(?:[^\.]+\.)?wired\.(?:co\.uk|com)[\/$]/)) {
// Wired
var articleContents = fakeDocument.querySelector("[data-js='post']");
var prevElement = document.querySelector("[data-js='postHeader']");
prevElement.parentNode.insertBefore(articleContents, prevElement.nextSibling);
var veilElement = document.querySelector("#veil");
veilElement.parentNode.removeChild(veilElement);
document.body.classList.remove("no-scroll");
}
});
})();