Last active
January 6, 2022 04:27
-
-
Save happiness801/a5769249c73c4c4708a95a1d70f2dc4e to your computer and use it in GitHub Desktop.
Remove Ads/Modals from forbes.com
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 Remove Ads/Modals from forbes.com | |
// @namespace http://onai.net/ | |
// @version 0.2 | |
// @description Removes ads, modals, paywalls from forbes.com | |
// @author Kevin Gwynn | |
// @match https://www.forbes.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let removeModals = function() { | |
console.log('KAG: attempt to remove modals...'); | |
// Inject jQuery | |
var gen = 0;var act=function(){gen=1;var script=document.createElement('script');script.src='//code.jquery.com/jquery-1.11.0.min.js';script.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(script);};(!window.jQuery)?act():1;setTimeout(function(){console.log('jQuery '+(gen?'loaded: ':'existing: ')+(window.jQuery?jQuery().jquery:'no jQuery/load failed'));}, 500); | |
$('adblock-modal,.tp-modal').remove(); | |
$('.top-ad-container,.tp-backdrop').remove(); | |
$('page-standard').removeClass('article-fixed'); | |
$('BODY').removeClass('adblock-on').removeClass('tp-modal-open'); | |
$('.ad-rail-container,.right-rail').remove(); | |
$('sidenav.video-player,.subscribe').remove(); | |
}; | |
setTimeout(removeModals, 1000); | |
setTimeout(removeModals, 2500); | |
setTimeout(removeModals, 4000); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment