Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created June 25, 2018 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wuputah/4f96d7938fc26924545588db3485abdd to your computer and use it in GitHub Desktop.
Save wuputah/4f96d7938fc26924545588db3485abdd to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name iRacing adblock
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Disable advertising in the background on the iRacing member site.
// @match http://members.iracing.com/membersite/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
// @grant none
// ==/UserScript==
(function($) {
'use strict';
function removeAds($) {
// dont run on pop-ups i.e. results window
if ($('#main_popup').length == 0) {
// remove the ads from the background
$('body').attr("style", "background: black");
// removes the things that you can click on
$('a.siteBGElement').remove();
}
}
// run now
removeAds($);
// run again when page is ready
$(removeAds);
})(window.jQuery.noConflict(true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment