anka-213 / webcomic_reader

Webcomic Reader userscript at
https://openuserjs.org/scripts/anka-213/Webcomic_Reader
MIT License
120 stars 27 forks source link

Page navigation not working on egscomics.com #20

Closed m2pt5 closed 8 years ago

m2pt5 commented 8 years ago

Both the keyboard shortcuts and clicking on either side of the image seems to have stopped working properly.

anka-213 commented 8 years ago

@m2pt5 If you are using an ad-blocker, you can add http://cdn.thehiveworks.com/jumpbar.js to the filters as a workaround, since it is causing the problem. I'll see what I can do to fix it from within the userscript.

m2pt5 commented 8 years ago

That worked perfectly well, thanks. I don't particularly like that jumpbar anyway.

crazygolem commented 8 years ago

I am asking to re-open this issue because the fix introduced in 8163eea does not work for http://www.dumbingofage.com which also uses thehiveworks' jumpbar script.

I am not sure how exactly the fix does its deeds, and I think that it has to do with the fact that breakbadtoys is declared (in opposition to being a function expression), so it is loaded before the script's execution. Then wcr assumes that it will itself be executed before the jumpbar's script, such that breakbadtoys = null effectively overrides the declared function before the jumpbar adds it as an event listener. @anka-213 is this correct?

Anyway, while it seemed to work for egscomics.com, it did not for dumbingofage.com or only on some page loads. It probably has to do with caching and timings, as if the explanation above is correct, in case the jumpbar's code is executed before wcr then overriding breakbadtoys won't affect the event listener already registered.

I am currently trying an alternative for dumbingofage, and will shortly open a pull request if I get good results.