Fix hover effect loading glitch; only flip words inside p elements #40

Merged
merged 3 commits into from Dec 14, 2017

Conversation

Projects
None yet
3 participants
Collaborator

biancadanforth commented Dec 14, 2017

Same as PR #35 which couldn't be re-opened since the forked repo was deleted.

This PR will:

  • Fix the display issues discussed in PR35.
  • Only wrap match words with <span> if they are inside a <p>

biancadanforth added some commits Dec 13, 2017

Fix hover effect loading glitch
There were cases where the content script would inject HTML into a page for the hover effect before the CSS would be loaded for that page by the background script. This resulted in seeing the contents of the hover effect in the page briefly before the CSS was applied. Now, we properly ensure the CSS is loaded before injecting the HTML in the content script.

Since the timers for the effect were added mostly mitigate the effect of this UI bug, I have removed them to make the effect less subtle (Issue #22). Now the inverted words stay inverted and the hover effect also persists on the page.
Naively neutralize most overflow: hidden style
The hover effect tooltip is now visible in more situations, like on Dictionary.com.
This still doesn't totally fix the problem, but it makes the effect display correctly in more situations. For example, the hover effect gets partially obscured still if the word takes place in a card, which is common in the search results of Google (ex: search for 'army').
Contributor

pdehaan commented Dec 14, 2017

I like this. It plays really nice w/ https://www.mozilla.org/en-US/privacy/ which has a lot of headings and links w/ Privacy text and it persists the text effect making it easier to discover as you read/scroll.

Looks good to me! Approving.

@gregglind gregglind merged commit b2f042f into mozilla:master Dec 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment