Closed Bug 1394111 Opened 7 years ago Closed 7 years ago

Embedded WebExtensions need to pass shutdown reason on shutdown.

Categories

(WebExtensions :: General, defect)

55 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1392872

People

(Reporter: u287251, Unassigned)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170826100418

Steps to reproduce:

- Launch Firefox 55 with a new profile

- Go to about:config

- Toggle xpinstall.signatures.required to false

- Go to about:addons

- Install webext.zip (will attach soon)
    - This is a pure webext extension
    - Its purpose is to set chrome.privacy.network.networkPredictionEnabled
      to false
    - Once installed, go to about:config and confirm that network.prefetch-next
      is false
    - Optionally, disable/enable the extension to further confirm it really
      affect the network.prefetch-next setting

- Install webext-embedded.zip (will attach soon)
    - This is an *embedded* webext extension
    - Its purpose is to set chrome.privacy.network.networkPredictionEnabled
      to true (opposite of the other extension)
    - Once installed, go to about:config and confirm that network.prefetch-next
      is true (default value actually)
    - Observation: disabling/enabling the extension do not cause the setting
      network.prefetch-next to toggle to its previous state (as set by the
      other pure webext extension, assuming it still is enabled).

- Uninstall webext-embedded.zip -- the embedded webext extension.

- Enable the remaining extension -- the pure webext one



Actual results:

The setting network.prefetch-next is true. The webext.zip from now one is
unable to control that setting.



Expected results:

The setting network.prefetch-next in about:config should be false, as set by
(the only remaining) extension through the call to chrome.privacy.network.networkPredictionEnabled.
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
The issue seems to be that embedded webext extension specifically do no cause the persisted precedence list to be cleaned up when uninstalled (or even when simply disabled), thus causing a stale entry to be left behind. That stale entry will get in the way of an extension trying to modify the same setting.

The first screenshot shows the stale entry in the debugger.
The second screenshot is to just show that there really is only one extension installed.

Concretely, this potentially affect all users who installed a separate version of uBlock Origin which I published with its own distinct id as an embedded extension a while ago. This is currently affecting me personally on both my Firefox 55 and Nightly.

I stumbled upon this issue when investigating an issue filed on my tracker[1], though I am not sure this is exactly the issue the user is really suffering, it appears to be simply a misunderstanding that another extension was also toggling the setting.

[1] https://github.com/gorhill/uBlock/issues/2900
Component: WebExtensions: General → Untriaged
Product: Toolkit → Firefox
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Summary: Extension unable to modify privacy.network settings due to stale entry in precedence list → Embedded WebExtensions need to pass shutdown reason on shutdown.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: