anka-213 / webcomic_reader

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

Keyboard shortcuts keep disappearing #55

Open PrincessRTFM opened 7 years ago

PrincessRTFM commented 7 years ago

I'm using Tampermonkey on Chrome. I have tried running a factory reset on the script, as well as deleting it and completely reinstalling it. Neither helps.

The problem is that the settings editor fails to get/set the keyboard shortcuts on some pages. On the problem pages, I can open the settings editor, go to the keyboard shortcuts (where all the fields will be empty), fill it in, and hit save, but when the page auto-reloads, the shortcuts don't work and the fields in the settings are all blank (again).

The problem occurs when I'm on Misfile but not the Whiteboard. Furthermore, by setting the shortcuts on a page that works (such as the Whiteboard), I can reload a page that doesn't (Misfile) and have the shortcuts work again, as long as I don't need to edit ANY settings from a page that has this problem.

anka-213 commented 7 years ago

I have stumbled upon this problem too. It seems like there is some kind of conflict with prototype.js, which makes internal things in WCR behave strangely.

anka-213 commented 7 years ago

More specifically, it breaks (incorrectly used) for..in loops, as is mentioned in the documentation for prototype.js. The fix should be fairly simple, I just need to make sure that I don't introduce any new bugs when I replace the loops.