Skip to content

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

  1. Navigate to adblockplus.org.
  2. Open icon popup and click on "Block element" button.
  3. Select an element on the page.
  4. 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information