Skip to content

Instantly share code, notes, and snippets.

@maesa
Created November 9, 2014 16:50
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 maesa/33e136083d71d8025a09 to your computer and use it in GitHub Desktop.
Save maesa/33e136083d71d8025a09 to your computer and use it in GitHub Desktop.
Open imgur on reddit through webproxy.net
// ==UserScript==
// @name Reddit Internetsehat Bypasser
// @namespace None
// @version 0.1
// @description Open imgur through webproxy.net
// @include http://*.reddit.com/*
// @include http://*.reddit.com/r/*
// ==/UserScript==
var links = document.getElementsByTagName("a"); //array
var regex = /^(https?:\/\/)(i\.)?(imgur\.com\/)(.+)$/i;
for (var i = 0, imax = links.length; i < imax; i++) {
links[i].href = links[i].href.replace(regex, "http://www.webproxy.net/view?q=" + encodeURI("$1$2$3$4"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment