Owyn / HandyImage

browser userscript (extension) which Shows just fullsize Image with hotkeys & without pop-ups on many image-hosting sites
https://greasyfork.org/scripts/109-handy-image
276 stars 58 forks source link

[Suggestion] - pixiv.net rule is slow, and requires logging in #476

Closed JenieX closed 2 years ago

JenieX commented 2 years ago

I suggest this rule instead.

case 'pixiv.net':
    i = document.querySelector('meta[name="preload-data"]');
    if (i) {
        let a = JSON.parse(i.getAttribute('content')).illust;
        let b = a[Object.keys(a)[0]];
        if (b.pageCount !== 1) return;
        i.src = b.urls.original;
    }
    break;
Owyn commented 2 years ago

It won't work in the Chrome tho, cuz chrome doesn't support disabling javascript the way this userscript does

and when there are multiple pages detected - site will be left broken cuz no javascript loaded

but when javascript is enabled - that meta gets deleted on pagestart, not sure if script will always be in time before that

Owyn commented 2 years ago

Seem to work so far, let's see how it goes.