Fix hover effect loading glitch #35

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Collaborator

biancadanforth commented Dec 13, 2017

Claim: This solves issue #34 .

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 to 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.

@gregglind Can you test this branch to check if you still get the loading glitch you saw below?
loadingglitch

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.
Member

gregglind commented Dec 13, 2017

Collaborator

biancadanforth commented Dec 13, 2017

Well my claim is that the hover text will never show inline again with this patch. :)

Member

gregglind commented Dec 13, 2017

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').
Collaborator

biancadanforth commented Dec 13, 2017

The dictionary.com display issue is not a symptom of the HTML loading before the CSS, which the initial commit was for; it is due to ancestor elements to the inverted word having a style of overflow: hidden. My second commit has a naive and non-comprehensive solution for this type of display issue that does now make the effect display properly on Dictionary.com and Google search result headers.
Still not a perfect solution, sadly, as I note in the commit! All incremental improvements though.

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