Closed Bug 2022281 Opened 29 days ago Closed 28 days ago

action.openPopup() should reject if another panel or context menu is open

Categories

(WebExtensions :: General, defect)

defect

Tracking

(firefox149 fixed, firefox150 fixed)

RESOLVED FIXED
150 Branch
Tracking Status
firefox149 --- fixed
firefox150 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(2 files)

To avoid disrupting or confusing the user, the action.openPopup() method should reject the request if other UI is floating around in the window.

We already check that for extension-generated panels, but it makes sense to extend this to other UI, notably context menus, doorhangers and notifications.

The existing error message was intentionally chosen to allow for this possibility, "openPopup() cannot be called while another panel is open".

Marking as blocker of bug 1799344 to signal that the behavior here is intended to be the behavior of action.openPopup() when the ability to call it without user interaction ships to release for the first time.

Blocks: 1799344
Status: ASSIGNED → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch

On top of the original revision, this also includes a hidden pref
(extensions.openPopup.undoBug2022281) to allow users to undo the
change if they encounter an issue for any reason.

Original Revision: https://phabricator.services.mozilla.com/D286943

Attachment #9551940 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Bug 1799344, riding the 149 train, dropped the user interaction requirement for the action.openPopup() method, which allows extensions to open the extension popup at any time. To prevent it from being disruptive or abused, this patch rejects the API call if a menu or panel is open.
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: In theory, extensions could see their attempt to call action.openPopup() fail more often (with user gesture, which existed before 149), if there is other UI in the way (e.g. a doorhanger). As a work-around, users can manually click on the extension button to open its popup. Or if that does not work for any reason, they can temporarily opt out of the tighter restrictions (for 149) by setting the extensions.openPopup.undoBug2022281 pref to true.
  • String changes made/needed: No
  • Is Android affected?: no
Attachment #9551940 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: