Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==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
You can’t perform that action at this time.