Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stormchasing/f6105c88aab88e1cd2716c84b75ed3fc to your computer and use it in GitHub Desktop.
Save stormchasing/f6105c88aab88e1cd2716c84b75ed3fc to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Wired adblock disabler disabler
// @namespace http://www.okstorms.com/
// @version 1.0
// @description Attempts to repair wired's page disabling due to their adblock detection. It's not pretty, but it makes it readable.
// @author JR Hehnly (http://www.okstorms.com @stormchasing)
// @match http://www.wired.com/*
// @grant none
// ==/UserScript==
if (document.getElementsByTagName('article').length > 0)
{
articleAtStart = document.getElementsByTagName('article')[0];
articleCheckTimer = window.setInterval(articleCheck, 200);
}
function articleCheck() {
if (document.getElementsByTagName('article').length === 0) {
console.debug('stop timer');
// stop the timer
window.clearInterval(articleCheckTimer);
console.debug('re-add the removed story content');
// re-add the removed story content
main = document.getElementById('main');
main.appendChild(articleAtStart);
console.debug('get rid of scroll blocking');
// get rid of scroll blocking
bodyElement = document.getElementsByTagName('body')[0];
bodyElement.className = '';
}
}
console.debug('remove veil');
// remove veil
var veil = document.getElementById('veil');
if (veil) {
veil.parentNode.removeChild(veil);
}
console.debug('clean up sidebar');
// clean up sidebar
var sidebar = document.getElementById('sidebar');
if (sidebar) {
sidebar.parentNode.removeChild(sidebar);
}
console.debug('clean up sharing');
// clean up sharing
var sharing = document.getElementById('sharing');
if (sharing) {
sharing.parentNode.removeChild(sharing);
}
console.debug('clean up nav button');
// clean up nav button
var recirc_arrow_article_left = document.getElementById('recirc-arrow-article-left');
if (recirc_arrow_article_left) {
recirc_arrow_article_left.parentNode.removeChild(recirc_arrow_article_left);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment