A login, view, download tool for exhentai & e-hentai
Ezek a szkript azon változatai, ahol a kód módosítva lett. Minden verzió mutatása
[Refactor] Refactor getting img url function
[Fix] Fix the viewer and download features for the HTML update
Issue with Page Refresh on Typing in Comment Text Box (#34)
When I add a new comment (by clicking [Post New Comment]), the page automatically refreshes after entering characters in the text box. After some investigation, it seems that this issue is caused by the script. This bug needs to be fixed.
The current script sets up shortcut keys for navigation, but these shortcuts should not be triggered while typing in the text box. The code is as follows:
document.addEventListener("keydown", async (e) => { // ignore key combinations if (e.altKey || e.shiftKey || e.ctrlKey || e.metaKey) { return; } var view_all = await GM.getValue("view_all", true); if (view_all === true) { return; } if (e.code === "ArrowLeft" || e.code === "KeyA") { e.preventDefault(); childNodes[0].click(); } if (e.code === "ArrowRight" || e.code === "KeyD") { e.preventDefault(); childNodes[childNodes.length - 1].click(); } });
To prevent this behavior, you should add a check to see if the current focus is on an input or textarea element. If so, the shortcut keys should not be triggered. Add the following code:
// Check if the current focus is on an input or textarea element if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") { return; }
Update version
Bump version to 0.2.18 for PR #31, #32, #33
feat: allow use A, D, and arrow keys turn pages on view one mode (#33)
feat: allow use W, S, and space keys to switch images (#32)
Co-authored-by: Mino madness48596@gmail.com
fix: arrow key combinations are wrong captured (#31)
Fix gdo4 issue for exhentai update
Bump version to 0.2.16 (#25)
feat: allow page turning with arrow keys (#24)