mozilla / addon-wr

Looking Glass is a collaboration between Mozilla and the makers of Mr. Robot to provide a shared world experience.
https://support.mozilla.org/kb/lookingglass
51 stars 15 forks source link

WIP - Add hover effect. Closes #9. #12

Closed biancadanforth closed 6 years ago

biancadanforth commented 6 years ago

mrrobotpageeffect

I discovered why we were seeing multiple "span" elements wrapped around the same matching word -- we were looking for "div" and "p" elements to check, and frequently, a "div" would have nested "div"s and "p"s, so if a word was in one of the nested elements, it'd get wrapped multiple times. I have changed the querySelectorAll to look for "p", "h1", "h2" and "h3" now, which are not commonly nested within each other. A quick check on the Mozilla privacy page showed they are never nested within each other for that page.

Loose ends:

gregglind commented 6 years ago

I think the multiple wrap problem will go away with the tree walker implementation.

gregglind commented 6 years ago

I will make the treeWalker a different commit.