Skip to content

Instantly share code, notes, and snippets.

@Chunjee
Last active August 13, 2016 20:51
Show Gist options
  • Save Chunjee/4df598ae748afecd40ca7d22732b8756 to your computer and use it in GitHub Desktop.
Save Chunjee/4df598ae748afecd40ca7d22732b8756 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Something Awful No External Ads
// @version 0.1.0
// @description Hide ads when they lead off site
// @updateURL https://gist.githubusercontent.com/Chunjee/4df598ae748afecd40ca7d22732b8756/raw/%2520Something-Awful-No-External-Ads.user.js
// @match *://forums.somethingawful.com/*
// @namespace http://github.com/Chunjee
// @author Chunjee
// ==/UserScript==
$(document).ready((function() {
//grab the bottom banner
var banner_obj = $("#ad_banner_user");
//check if ad link leads to SA
var ad_link = /:\/\/(forums\.somethingawful\.com)\/showthread/gi.exec(banner_obj[0].innerHTML);
//if ad link was anything else than SA, hide it.
if (!ad_link) {
$("#ad_banner_user").hide();
}
}));

Sorry Aggro Gator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment