Tumblr Image URL Redirect

Redirects Tumblr Image URLs to the raw version

< 腳本Tumblr Image URL Redirect的回應

提問/評論

§
發表於:2017-09-10

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");
}

發表回覆

登入以回覆