Qeole / Enlight

Firefox add-on providing syntax highlighting for raw code, based on the highlight.js project.
Mozilla Public License 2.0
42 stars 2 forks source link

Button may misbehave on “first click” when several tabs are highlighted. #6

Open Qeole opened 6 years ago

Qeole commented 6 years ago

Known issue: the add-on keeps one global state to remember if the tab has already been colored or not. Of course, in the case when several tabs are to be highlighted, this is a problem. This is not so big an issue, since in this case:

Steps to reproduce, first case:

  1. Open two tabs with raw text (without automatic highlighting).
  2. Trigger highlighting on first tab.
  3. Switch to second tab.
  4. Try to trigger highlighting: first click on button should be without effect.

Second case is the same, but first highlight two tabs, then reset the first one, and try to reset the second one: clicking the button should open the language selection popup instead of immediately removing colors.

Users relying only on the automatic highlighting feature (and never clicking the button) should not be affected.

Possible workaround: maybe the background script could probe the tab to see if content script has been injected already. But I haven't been successful with this so far, background script seems to hang if it fails to connect to a content script. The issue will probably stay there for a while, until I find something better.