Bug 1522918 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

When an extension is uninstalled, optional permissions should be removed. This is not the case.

STR:

1. Load the extension from bug 1493396. It will open a sidebar with several buttons.
2. Visit `about:config` and set `extensions.webextOptionalPermissionPrompts` to `false` (this is to work around bug 1493396).
3. Click on the "permissions.contains" button, and confirm that the output is `false`.
4. Click on the "permissions.request" button, and confirm that the output is `true`.
5. Click on the "permissions.contains" button, and confirm that the output is `true`.

6. Visit `about:addons` and click on "Remove" to uninstall the extension.
7. Click on Undo to re-install the addon (thus opening the sidebar again).

8. Click on the "permissions.contains" button.
9. Look at the Firefox profile directory, in a file called `extension-preferences.json`.

Expected:
- After step 8, the result should be `false`, because optional permissions should have been forgotten upon uninstallation.
- At step 9, the file should not contain the ID of the test extension.

Actual:
- After step 8, the result is `true`.
- At step 9, the file still contains the ID of the test extension.


More information:
- It seems that this code is supposedly responsible for clearing optional permisisons upon uninstallation: https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/toolkit/components/extensions/parent/ext-permissions.js#102-105
- However, `extensions.on("uninstall", extension => {` could never have worked, because the signature for the method is `(type, ...args)`, not `(...args)` - see e.g. https://searchfox.org/mozilla-central/search?q=extensions.on(%22 for examples, and for documentation, see https://searchfox.org/mozilla-central/rev/c035ee7d3a5cd6913e7143e1bce549ffb4a566ff/toolkit/components/extensions/ExtensionCommon.jsm#237-238 (`extensions` is a `SchemaAPIManager` and defined here: https://searchfox.org/mozilla-central/rev/c035ee7d3a5cd6913e7143e1bce549ffb4a566ff/toolkit/components/extensions/ExtensionCommon.jsm#1630 )
When an extension is uninstalled, optional permissions should be removed. This is not the case.

STR:

1. Load the extension from bug 1493396. It will open a sidebar with several buttons.
2. Visit `about:config` and set `extensions.webextOptionalPermissionPrompts` to `false` (this is to work around bug 1493396).
3. Click on the "permissions.contains" button, and confirm that the output is `false`.
4. Click on the "permissions.request" button, and confirm that the output is `true`.
5. Click on the "permissions.contains" button, and confirm that the output is `true`.

6. Visit `about:addons`, click on "Remove" to disable the extension (this marks the add-on for removal but doesn't remove the data yet because of the undo option).
7. Click on Undo to re-install the addon (thus opening the sidebar again).
8. Click on the "permissions.contains" button, and confirm that the output is `true`.

9. Visit `about:addons`, click on "Remove" and refresh the `about:addons` page to force the uninstall and data removal to happen.
10. Look at the Firefox profile directory, in a file called `extension-preferences.json`.

Expected:
- At step 9, the file should not contain the ID of the test extension.

Actual:
- At step 9, the file still contains the ID of the test extension.


More information:
- It seems that this code is supposedly responsible for clearing optional permisisons upon uninstallation: https://searchfox.org/mozilla-central/rev/465dbfe030dfec7756b9b523029e90d48dd5ecce/toolkit/components/extensions/parent/ext-permissions.js#102-105
- However, `extensions.on("uninstall", extension => {` could never have worked, because the signature for the method is `(type, ...args)`, not `(...args)` - see e.g. https://searchfox.org/mozilla-central/search?q=extensions.on(%22 for examples, and for documentation, see https://searchfox.org/mozilla-central/rev/c035ee7d3a5cd6913e7143e1bce549ffb4a566ff/toolkit/components/extensions/ExtensionCommon.jsm#237-238 (`extensions` is a `SchemaAPIManager` and defined here: https://searchfox.org/mozilla-central/rev/c035ee7d3a5cd6913e7143e1bce549ffb4a566ff/toolkit/components/extensions/ExtensionCommon.jsm#1630 )

Back to Bug 1522918 Comment 0