You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but after the extension replaced the text, the paragraph text node does not exist anymore, so when it runs into range.selectNode(node); will throw out an error, and the page renders nothing.
I think we can make some changes here to avoid such compatibility issues with extension.
do not keep the references, and query the paragraphs every time.
use the parent P tag instead of using the text node inside.
what do you think?
The text was updated successfully, but these errors were encountered:
i don't think that requerying in this method would help as it is just executed in case of initial load/resizing or switchting between chapters in pagination. Any frequent requerying is maybe also overkill / unecessary for people not using your extension
main audience of the reader are people reading japanese books. these often contain furigana which will create additional text nodes and therefore more frequent update to the character progress - therefore i guess the preference is to keep it on this level
In context of #21 there will probably some changes introduced - we will try to keep this one in mind for it (though i don't know when it may will be taken up) and therefore i will leave it open
I'm currently developing a chrome extension, which highlights some English words in the text, there is a compatibility issue.
the highlight function replaces the word with an HTML tag, for example, a sentence like:
may be replaced by
The problem is that the ebook-reader's code keeps the text nodes reference in the js memory:
ebook-reader/apps/web/src/lib/components/book-reader/book-reader-continuous/character-stats-calculator.ts
Line 32 in 4c76cda
and use the references later:
ebook-reader/apps/web/src/lib/components/book-reader/book-reader-continuous/character-stats-calculator.ts
Line 60 in 4c76cda
but after the extension replaced the text, the
paragraph
text node does not exist anymore, so when it runs intorange.selectNode(node);
will throw out an error, and the page renders nothing.I think we can make some changes here to avoid such compatibility issues with extension.
P
tag instead of using the text node inside.what do you think?
The text was updated successfully, but these errors were encountered: