Lej77 / tab-count-in-window-title

6 stars 1 forks source link

No clean-up when disabling the extension #9

Open pointlessone opened 2 years ago

pointlessone commented 2 years ago

When the extension is disabled/removed the title is kept with the last value of tab count. Obviously, it's not updated on new tabs or when tabs are closed. Tab count is cleaned up on browser restart.

Lej77 commented 2 years ago

This is an unfortunate limitation of the WebExtension APIs. The prefix isn't cleared by Firefox automatically and nothing happens if I try to use WebExtension APis in response to browser events such as beforeunload or visibilityState. So currently I know of no good solution for this issue. My current workaround is to have a manual "disable" button (says something like "prevent further updates") in the addons option page that when clicked disables all functionality and clears all window title prefixes.

tl;dr; the current workaround is to press the disable button on the addon's option page.