Content scripts not notified when Firefox extension unloads
Environment
- OS version: Ubuntu 22.04
- Browser version: 113.0b9
- Extension version: 3.16.2
- Last working version: TBD
Steps to reproduce
- Navigate to adblockplus.org.
- Open icon popup and click on "Block element" button.
- Select an element on the page.
- Disable the extension.
Observed behavior
- After 3) Selected element gets highlighted.
- After 4) Selected element stays highlighted.
Expected behavior
- After 3) Selected element gets highlighted.
- After 4) Selected element stops being highlighted.
Further information
This problem occurs because the content script doesn't get notified when the extension unloads, and therefore doesn't do any clean-up.
Therefore this problem also applies to any other content scripts that we inject into the page, such as:
- Experimental allowlisting API
- Experimental Flattr API
- On-page dialog
- Premium activation