Skip to content

Instantly share code, notes, and snippets.

@Lense
Last active August 29, 2015 14:05
Show Gist options
  • Save Lense/63cd54e66c82887718d3 to your computer and use it in GitHub Desktop.
Save Lense/63cd54e66c82887718d3 to your computer and use it in GitHub Desktop.
Userscript to automate Steam linkfilter
// ==UserScript==
// @name Automate Steam linkfilter
// @namespace https://github.com/lense
// @description Skip the Steam link filter on trusted domains
// @include https://steamcommunity.com/linkfilter/?url=*
// @version 1
// @grant none
// @run-at document-start
// ==/UserScript==
// Add the Domains you want to be auto-allowed here:
var allowedURLs = new Set(["puu.sh", "tf2r.com", "gist.github.com"])
var filteredURL = window.location.search.substr(5)
var filteredDomain = filteredURL.match("^https?://([^/]*)")[1]
console.log("Testing:", filteredDomain, "in")
console.log(allowedURLs)
if(allowedURLs.has(filteredDomain)) {
console.log("Domain is allowed. Redirecting to", filteredURL)
window.location.replace(filteredURL)
} else {
console.log("Domain is not expressly allowed. You're going to have to click that button yourself.")
}
@Lense
Copy link
Author

Lense commented Aug 15, 2014

WHOOPS. Fixed vuln where it would redirect httpS://badwebsite.obscuretld/http://puu.sh

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