Last active
June 2, 2021 23:18
-
-
Save happiness801/24baadbb757b327731b954651b331415 to your computer and use it in GitHub Desktop.
Remove Various Ads (Yahoo, etc)
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 Various Ad Content | |
// @namespace http://onai.net/ | |
// @version 0.2 | |
// @description Removes Various Ad content | |
// @author Kevin Gwynn | |
// @match https://*.yahoo.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
// Make sure jQuery is available | |
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 removeAds = function() { | |
console.log('KAG: Remove Various Ads...'); | |
// Gemini Ads | |
jQuery('.gemini-ad,.native-ad-item').remove(); | |
// Side-bar ads on Yahoo (etc) | |
jQuery('[id$=-Ad-Proxy]').remove(); | |
// Remove iFrames with an allow attribute that contains 'ads' | |
$('iframe[allow*=ads]').parent().remove(); | |
// Continously remove ads every 5 sec | |
setTimeout(removeAds, 5000); | |
} | |
setTimeout(removeAds, 1500); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment