Redirect to high res image

Automatically redirects the browser to the full resolution image for any landing page on imagetwist.com imgspice.com acidimg.cc imx.to pixhost.to imagebam.com imgbox.com kropic.com vipr.im

< 腳本Redirect to high res image的回應

評論:正評 - 腳本一切正常

§
發表於:2023-10-25

Excellent! easily the best userscript I've ever installed. thank you so much.

I wanted to modify it (for myself) to remove the automatic redirects on one host I am unfortunately forced to use as the least cancerous "approved" image host somewhere, and eslint nagged me about @include so I rewrote them as @match statements. Also changed imagebam to only match /view/* and noticed its part could be made a bit simpler and still work. Their annoying "landing page" always has the same DOM/JS selectors. I think imagevenue changed the way their pages look, so I had to re-write that part to get it to work there at all, which is also now why I'm sharing this:

// imagebam rewrite
    } else if (location.href.includes("imagebam.com")) {
        let anchor = document.querySelector("#continue > a");
        img = document.querySelector("img.main-image");
        if (img) {
            // redirect to full res
            location.href = img.src;
        } else {anchor.click();}
     }
// imagevenue fix
    } else if (location.href.includes("imagevenue")) {
        let img = document.querySelector("#main-image");
        if (img) {location.href = img.src;}
    }

my "fork", without any disabled hosts, is unlisted but available here

Coding Joe作者
§
發表於:2023-11-02

I did not know this script would garner interest during breakage. Thanks for the upkeep. I wish I could invite others to push code. I've done a few unit tests so I'll merge with the main.

發表回覆

登入以回復