Sorry Aggro Gator
Last active
August 13, 2016 20:51
-
-
Save Chunjee/4df598ae748afecd40ca7d22732b8756 to your computer and use it in GitHub Desktop.
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 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(); | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment