Created
February 18, 2016 19:38
-
-
Save wisq/dfee3b013e2c240ab588 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 RPS mixed-content defuckifier | |
// @namespace rps-img-https | |
// @include https://www.rockpapershotgun.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var images = document.getElementsByTagName('img'); | |
var length = images.length; | |
var match = new RegExp('^http://(www\.)?rockpapershotgun\.com/'); | |
var proto = new RegExp('^http://'); | |
for (var i = 0; i < length; i++) { | |
var img = images[i]; | |
if (match.test(img.src)) { | |
img.src = img.src.replace(proto, "https://"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment