Skip to content

Instantly share code, notes, and snippets.

@ianhampton
Created April 12, 2017 19:57
Show Gist options
  • Save ianhampton/75bd0add411b805724527323d74bb8d4 to your computer and use it in GitHub Desktop.
Save ianhampton/75bd0add411b805724527323d74bb8d4 to your computer and use it in GitHub Desktop.
Fix Pistonheads Images
// ==UserScript==
// @name Fix Pistonheads Images
// @version 1.0
// @description Fixes insecure images on Pistonheads
// @match *://*.pistonheads.com/*
// @author Ian Hampton
// @copyright 2017
// ==/UserScript==
(function() {
'use strict';
jQuery('img[src*=http\\:\\/\\/]').each(function() {
var $img = jQuery(this);
var imgsrc = $img.attr('src');
imgsrc = imgsrc.replace("http://", "https://images.weserv.nl/?url=");
$img.attr('src',imgsrc);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment