Tumblr Image URL Redirect

Redirects Tumblr Image URLs to the raw version

< Valutazione su Tumblr Image URL Redirect

Domanda/commento

§
Pubblicato: 10/09/2017

Two redirects fix

When viewing pictures, I noticed it first tried 68.media.tumblr.com/[...]_raw.png before redirecting to media.tumblr.com/[...]_raw.png, so there'd be a 404 not found for a split second.
I changed the entire script to this, and it seems to work so far without the 404 page showing up:

if(window.location.host.indexOf("media.tumblr.com") > 0) {
window.location = window.location.href.replace(/..\.media\.tumblr\.com/,"media.tumblr.com").replace("_1280","_raw").replace("_540","_raw").replace("_500","_raw").replace("_400","_raw").replace("_250","_raw").replace("_100","_raw");
}

Pubblica risposta

Accedi per pubblicare una risposta.