Optional extension permissions not removed on uninstall
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox67 verified)
Tracking | Status | |
---|---|---|
firefox67 | --- | verified |
People
(Reporter: robwu, Assigned: robwu)
References
Details
Attachments
(2 files)
When an extension is uninstalled, optional permissions should be removed. This is not the case.
STR:
-
Load the extension from bug 1493396. It will open a sidebar with several buttons.
-
Visit
about:config
and setextensions.webextOptionalPermissionPrompts
tofalse
(this is to work around bug 1493396). -
Click on the "permissions.contains" button, and confirm that the output is
false
. -
Click on the "permissions.request" button, and confirm that the output is
true
. -
Click on the "permissions.contains" button, and confirm that the output is
true
. -
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). -
Click on Undo to re-install the addon (thus opening the sidebar again).
-
Click on the "permissions.contains" button, and confirm that the output is
true
. -
Visit
about:addons
, click on "Remove" and refresh theabout:addons
page to force the uninstall and data removal to happen. -
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 aSchemaAPIManager
and defined here: https://searchfox.org/mozilla-central/rev/c035ee7d3a5cd6913e7143e1bce549ffb4a566ff/toolkit/components/extensions/ExtensionCommon.jsm#1630 )
Assignee | ||
Comment 1•6 years ago
|
||
The original code was introduced in bug 1197420; linking bug for visibility.
Comment 2•6 years ago
|
||
There is a fix for this issue in Shane's patches from Bug 1511636.
In particular, as part of D14800, the call to ExtensionPermission.removeAll is going to be moved into Extension.jsm's UninstallObserver (and a new xpcshell test named test_ext_permissions_uninstall.js is being added).
Assignee | ||
Comment 3•6 years ago
|
||
Bug 1511636 seems to indeed fix this issue. I will mark that as a dependency, and once the other bug is fixed, verify that this bug is fixed too.
Assignee | ||
Comment 4•6 years ago
|
||
I updated the reproduction steps in comment #0. The about:addons
page had to be refeshed in order to commit the uninstallation.
Bug 1511636 has improved the result. Previously the permissions were kept even after uninstallation.
Now the permissions are cleared, but the extension ID is still there.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Updated•6 years ago
|
Comment 7•6 years ago
|
||
bugherder |
I was able to reproduce the issue on Firefox 66.0b7 (20190211185957) under Win 7 64-bit and Mac OS X 10.14.1.
This issue is verified as fixed on Firefox 67.0a1 (20190219094627) under Win 7 64-bit and Mac OS X 10.14.1.
Please see the attached screenshot.
Description
•