Created
October 8, 2014 16:38
-
-
Save simoneau/808570b57dd519b7a4e1 to your computer and use it in GitHub Desktop.
A user script to rewrite links to imgur.com on https://www.reddit.com to use HTTPS. Note that you may need to reload the page if you are flipping through images.
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 HTTPS for reddit.com on imgur.com | |
// @description Rewrite links to use HTTPS for reddit.com on imgur.com. | |
// @author Matthew Simoneau | |
// @namespace http://www.matthewsim.com/ | |
// @version 0.1 | |
// @include https://imgur.com/* | |
// ==/UserScript== | |
var a = document.getElementsByTagName('a'); | |
for (var i = 0; i < a.length; i++) { | |
var p = /^http:\/\/(www\.reddit\.com\/.*)$/; | |
var res = p.exec(a[i].href); | |
if (res != null) { | |
a[i].href = 'https://' + res[1]; | |
} | |
} |
Author
simoneau
commented
Oct 29, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment