Closed Bug 1522918 Opened 6 years ago Closed 5 years ago

Optional extension permissions not removed on uninstall

Categories

(WebExtensions :: General, defect, P3)

64 Branch
defect

Tracking

(firefox67 verified)

VERIFIED FIXED
mozilla67
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:

  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:

The original code was introduced in bug 1197420; linking bug for visibility.

See Also: → 1197420

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).

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: nobody → rob
Depends on: 1511636

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.

Priority: -- → P3
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/5542b48b6dfe
Fully remove optional permission data upon uninstall r=rpl
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Attached image Bug1522918.png

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.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: