browser.permissions.remove() permanently removes devtools panel
Categories
(WebExtensions :: Developer Tools, defect, P1)
Tracking
(firefox-esr78 wontfix, firefox90 wontfix, firefox91 verified, firefox92 verified)
People
(Reporter: me, Assigned: rpl)
References
(Regression)
Details
(Keywords: regression)
Attachments
(5 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15
Steps to reproduce:
In a web extension:
- Add optional origin permission
- Revoke permission
What doesn't affect this:
- context (it if .remove() is called in the background or in a page)
- user interaction (it happens even if I call .remove() from the console)
- permissions (regardless of whether I specify
devtools
in the manifest's permissions list) - quirks mode (the attached repro is minimal, but my extension is not in regular mode)
Actual results:
The dev tools panel is gone and will not reappear until a restart or removal of the extension.
Expected results:
The panel should not be affected
What doesn't affect this:
- i
The comment above was submitted too early.
What doesn't affect this:
- the type of permission revoked (the bug appears whether I remove an origin or a regular permission, like "notifications")
Comment 4•4 years ago
|
||
Hello,
I reproduced the issue on the latest Release (90.0.2/20210721174149), Beta (91.0b7/20210725190237) and Nightly (92.0a1/20210725212334) under Windows 10 x64 and Ubuntu 16.04 LTS.
Once the permission is removed, the dev tools panel disappears, as illustrated in the attached gif from Comment 1.
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
I didn't run mozregression to bisect the regressing bug, but this is very likely a regression introduced by Bug 1606862.
In Bug 1606862 two listeners for "add-permissions" and "remove-permissions" have been added in ext-devtools.js, but the about:config pref related to the extension devtools page is set to true/false in the listeners before checking if the devtools permission is granted or not (and so it is reacting to any "add-permissions"/"remove-permissions" event and it is disabling the devtools page and panel when an unrelated permission is removed, and also re-enabling it again if an unrelated optional permission is granted).
The attached patch currently includes only the fix for the issue reported, but I want to add explicit coverage for this scenario and so I marked it as work-in-progress. I'll open it up for review asap (as soon as I added test coverage).
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
As a side note:
the devtools page and panels are being destroyed because of the underlying issue described in comment 6, but the extension will still be listed in the DevTools Settings panel and the user will be able to re-enable the devtools part of the extension from there (without having to remove and reinstall the extension).
Updated•4 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #9)
Luca, do you want to ask for uplift?
Hi Marco,
it would be good if we can get it uplifted, and so I was planning to ask an uplift to beta once the patch has got to mozilla-central.
should I create it sooner even if the patch didn't got to central yet? (e.g. because we are pretty near to the end of the current beta cycle and asking the uplift now would increase the chances to not be too late to be acceptable?)
Comment 11•4 years ago
|
||
(In reply to Luca Greco [:rpl] [:luca] [:lgreco] from comment #10)
(In reply to Marco Castelluccio [:marco] from comment #9)
Luca, do you want to ask for uplift?
Hi Marco,
it would be good if we can get it uplifted, and so I was planning to ask an uplift to beta once the patch has got to mozilla-central.should I create it sooner even if the patch didn't got to central yet? (e.g. because we are pretty near to the end of the current beta cycle and asking the uplift now would increase the chances to not be too late to be acceptable?)
I think so, but redirecting to Pascal.
Comment 12•4 years ago
|
||
It's OK to request the uplift now even though it isn't on central yet but it won't make it into beta 8 which builds in a few hours and I won't uplift it before it lands on mozilla-central.
Assignee | ||
Comment 13•4 years ago
|
||
Comment on attachment 9233097 [details]
Bug 1722145 - extension devtools page and panels should not be enabled/disabled when unrelated optional permissions are granted/revoked. r?mixedpuppy!
Beta/Release Uplift Approval Request
- User impact if declined: The devtools part of an extension may be wrongly disabled or re-enabled when the extension request or revoke an unrelated optional permission (also when the extensions isn't explicitly using "devtools" as an optional permission).
The users would still be able to re-enable the devtools part of the extension from the Developer Tools Settings UI, but given that the users that got into this issue are not actively disabling the extension from the Developer Tools Settings UI, they may not realize that they can enable it back and assume that it is broken.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: not strictly necessary because the patch also include automated tests that should be covering the fix appropriately, but it may be good to also explicitly verify the fix.
The STR is the one described in comment 0 (along with the test extension attached to the same comment). - List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): The fix is just a few lines, only touching the part of ext-devtools.js that was triggering the issue, and the automated tests included along with the fix should also making sure that the issue is fixed and the other behaviors are still working as expected.
- String changes made/needed:
Assignee | ||
Updated•4 years ago
|
Comment 14•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Comment on attachment 9233097 [details]
Bug 1722145 - extension devtools page and panels should not be enabled/disabled when unrelated optional permissions are granted/revoked. r?mixedpuppy!
It's coming late in the cycle but it's a small patch, has automated tests and it fixes a P1/S2 regression, let's take it in our last beta, thanks.
Comment 16•4 years ago
|
||
Verified the fix on the latest Nightly (92.0a1/20210727214000) under Windows 10 x64 and Ubuntu 16.04 LTS.
Once the permission is revoked, the dev tools panel no longer disappears, confirming the fix.
For further details, see the attached video.
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder uplift |
Comment 19•4 years ago
|
||
Verified the fix on the latest Beta (91.0b9/20210729185755) under Windows 10 x64 and Ubuntu 16.04 LTS.
Once the permission is revoked, the dev tools panel no longer disappears, confirming the fix.
Description
•