Last active
December 14, 2020 17:07
-
-
Save happiness801/e7b2e313ef1b3cb39bc9e4d1012b2b00 to your computer and use it in GitHub Desktop.
Remove Ads, Modals, Ad-blocker warnings on NBA.com
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
// ==UserScript== | |
// @name Allow Ad Blocker on NBA.com | |
// @namespace http://onai.net/ | |
// @version 0.3 | |
// @description Removes ads, modals from nba.com | |
// @author Kevin Gwynn | |
// @match https://*.nba.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); | |
var $ = jQuery; | |
$('div[class^=sp_veil]').remove(); | |
$('div[class^=sp_message]').remove(); | |
$('body').css('overflow-y', 'auto'); | |
$('html').removeClass('sp-message-open'); | |
}; | |
setTimeout(removeModals, 1000); | |
setTimeout(removeModals, 2500); | |
setTimeout(removeModals, 4000); | |
setTimeout(removeModals, 5500); | |
setTimeout(removeModals, 7000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment