wmww / destylize

Browser extension to remove unicode text stylization, Now available for Firefox and Chrome (see below)
MIT License
10 stars 3 forks source link

Popup icon is gray when disabled #19

Closed Atli-A closed 3 years ago

Atli-A commented 3 years ago

Fixing issue #2

wmww commented 3 years ago

Sorry for the delay, been busy.

There seems to be a bit of an issue with startup. To reproduce:

  1. Load the extension and turn it off
  2. in about:debugging#/runtime/this-firefox (where you load the extension), click reload Expected: It will be off and icon will be gray Actual: It's off but icon doesn't turn gray until you open up the popup

The issue seems to be that the popup script isn't loaded until the popup is opened, but moving the icon setting to the main script doesn't work. Other extensions change icon dynamically so there must be a way.

wmww commented 3 years ago

Same behavior with Chrome, except it's more obvious how to test it since Chrome doesn't unload local extensions on exit. Simply turn it off, close chrome and re-open chrome. It stays off, but doesn't gray out the icon until you open the popup.

wmww commented 3 years ago

Ah! Dug through the source code of a couple other extensions that do it and it looks like we need a background script

wmww commented 3 years ago

I seem to have screwed up this branch. Git is being weird. I pushed my additions to a new PR #21. Would appropriate someone else to test it before I merge.

Atli-A commented 3 years ago

That's interesting I was unable to reproduce on chrome but I did run into the same issue on firefox. I guess I just didn't test for that. Thanks for the fix!