Reviews for Textmarker
Textmarker by underflyingbirches
Review by hmijail
Rated 3 out of 5
by hmijail, 4 years agoWorks OK if used carefully and in strictly static pages. Unreliable if not. Beware of strange failures if the page does ever change, or if you happen to open the same tab twice.
Developer response
posted 4 years agoHi hmijail, as I tried to explain to you on GitHub: There is nothing strange about restoration failures of saved highlights for pages that change their content. In fact it's expected and I notify users in bold letters about it both on this addon page as well as on the Textmarker pages.
A restoration cannot be successful if:
1) The highlighted text is not on the page anymore (obviously) or
2) The "surrounding content" of the highlight has changed: As explained on GitHub, since DOM elements ceise to exist on page unload there is no way of saving a direct reference, which is why Textmarker has to rely on an indirect description of the highlight's location. This description holds information about the `nodeName` of the ancestor DOM elements as well as the position of those elements (i.e. 3rd child node of its parent element) and the corresp. text node's starting point of the selection. So a verbalized example description could be (a bit simplified):
"Starts at character 4 of the 3rd child node of a p-element, which is the first child of a div-element"
This is necessary, because a highlighted text could occur multiple times on a give page, so it wouldn't be sufficient on page revisit to just search for that text and highlight the first occurrence.
A restoration cannot be successful if:
1) The highlighted text is not on the page anymore (obviously) or
2) The "surrounding content" of the highlight has changed: As explained on GitHub, since DOM elements ceise to exist on page unload there is no way of saving a direct reference, which is why Textmarker has to rely on an indirect description of the highlight's location. This description holds information about the `nodeName` of the ancestor DOM elements as well as the position of those elements (i.e. 3rd child node of its parent element) and the corresp. text node's starting point of the selection. So a verbalized example description could be (a bit simplified):
"Starts at character 4 of the 3rd child node of a p-element, which is the first child of a div-element"
This is necessary, because a highlighted text could occur multiple times on a give page, so it wouldn't be sufficient on page revisit to just search for that text and highlight the first occurrence.