[Bug] Js and Css are injected twice on the text.
Steps to reproduce
- Take a freshly installed version of lnreader 1.1.19
- AllNovelFull, Hidden marriage, add to the library
- Download chapter 1 and 2
- Inject this JS:
alert(chapterName)
- Open chapter 1, scroll until the bottom and click "Next chapter" (see video below).
Expected behavior
- Js and css applied only once so the alert should popup only once.
Actual behavior
Js applied twice when the chapters in question are downloaded.
https://github.com/LNReader/lnreader/assets/75091899/023cfea4-c12b-4542-b595-de249ea78afa
LNReader version
1.1.18 and 1.1.19(the bug exists since the first time i started using lnreader so.. 1.1.15.1, idk previous versions)
Android version
Android 8 Miui 8
Device
huawei p8 lite 2017
Other details
This issue has been almost completely rewritten on 4th November 2023
It is a re-opened issue because devs couldn't reproduce it even with the video so i think one needs to guess the cause of it correctly to fix it or test it on android 8.
EDIT: another re-edit in 9th of June 2024
Acknowledgements
- [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
- [X] I have written a short but informative title.
- [X] If this is an issue with a source, I should be opening an issue in the sources repository.
- [X] I have updated the app to version 1.1.15.
- [X] I will fill out all of the requested information in this form.
Not able to reproduce this with simpler scripts.
Your custom JS might be replacing / setting the HTML content more than once which could probably cause this.
https://github.com/LNReader/lnreader/assets/75091899/c6cf7fb1-5c7d-491b-90f6-abf5792f9afa
Here you can see that the JS has been applied already when the chapter loaded, then It lagged a bit, the chapter resetted and the JS applied again before the chapter_progress_resume feature activated. You can see it by the string 0.5 becoming 0.1999999284.