Last active
May 19, 2025 20:33
-
-
Save scripting/ffea3997c193552deb8fc8c864e8ebee to your computer and use it in GitHub Desktop.
I was going to use this in my search engine, when it wanted to display an image over http, reroute it to use an https proxy server. But Chrome wouldn't stay out of the way, so had to give up. Hey I was trying to route around their outage.
This file contains hidden or 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
function reRouteImgs () { //5/19/25 by DW | |
$(window).on ("load", function () { | |
console.log ("reRouteImgs"); | |
$("body img").each (function () { | |
const url = $(this).attr ("src"); | |
if (beginsWith (url, "http://")) { | |
console.log ("reRouteImgs: url == " + url); | |
const proxiedUrl = "https://someproxy.com/?url=" + encodeURIComponent (url) + "&nocache=" + Date.now (); | |
$(this).attr ("src", ""); | |
$(this).attr ("src", proxiedUrl); | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment