chocolateboy / userscripts

Userscripts for Greasemonkey, Tampermonkey etc.
https://greasyfork.org/users/23939-chocolateboy
GNU General Public License v3.0
206 stars 11 forks source link

DWImages link on image not working anymore #8

Closed bohwaz closed 4 years ago

bohwaz commented 4 years ago

It seems that Google is rewriting the href attribute after you set it.

I changed the script to replace the href change with:

        $links.eq(0).clone(true).attr('jsname', null).attr('href', meta.ou).insertAfter($links.eq(0));
        $links.eq(0).attr('style', 'display: none');
        $links.eq(1).attr('href', meta.ru) // page

        $links.eq(0).find('img').onModify('src', function (element) {
            element.parent().next().find('img').eq(0).attr('src', element.attr('src'));
        });

And it works :)

Edit: forgot the part for the dynamic loading of images when scrolling.

chocolateboy commented 4 years ago

Thanks for letting me know!

Edit: forgot the part for the dynamic loading of images when scrolling.

Yeah, I tried something similar, and ran into the same issue. I've gone with another approach for now. We'll see how long it lasts :-)

bohwaz commented 4 years ago

Thanks! I thought it was the jsname attribute that triggered the href overwrite, apparently it's the class name, good to know.