Extension UI surface (browserAction, pageAction, sidebar) cannot be opened from non-extension pages
Categories
(WebExtensions :: Frontend, enhancement, P5)
Tracking
(Not tracked)
People
(Reporter: robwu, Unassigned)
References
(Depends on 3 open bugs)
Details
Attachments
(1 file)
1.38 KB,
application/zip
|
Details |
Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Updated•7 years ago
|
Comment 8•7 years ago
|
||
Updated•7 years ago
|
Comment 10•6 years ago
|
||
1Password would love to use browserAction.openPopup
in our content script. We would also find it helpful to open the popup in response to notifications.onClicked
or onButtonClicked
which I believe is also a clear instance of user input. Any word on this issue moving forward?
Reporter | ||
Comment 11•6 years ago
|
||
(In reply to beyer from comment #10)
We would also find it helpful to open the popup in response to
notifications.onClicked
oronButtonClicked
which I believe is also a clear instance of user input. Any word on this issue moving forward?
Treating notification clicks as user input is tracked in bug 1402612.
(Firefox only supports notifications.onClicked
, not onButtonClicked
, by the way.)
Comment 12•4 years ago
|
||
I'm hitting this issue on Firefox when trying to call browser.permissions.request from the background page.
- The content script adds a button to the UI on the page I am augmenting.
- Since the content script can't call browser.anything, clicking the button sends a message to the background script via browser.runtime.sendMessage which calls browser.permissions.request.
- On all other browsers, this works fine. But on Firefox, I get "Error: permissions.request may only be called from a user input handler"
I'm guessing the background page has no way of knowing if browser.runtime.sendMessage was called due to the user clicking on something or not. So, if I want to provide context and not block updating an addon for new permissions (seems like the right thing to do), the best I can do is a 5 step process:
- Content Script shows an alert that new functionality is available but required new permissions with button to add permissions.
- User clicks on alert → that opens a popup or the Addon's settings (which have access to browser.permissions)
- Once the popup or settings are open, show the alert again
- User clicks on alert → This time, it will trigger Firefox's accept permissions dialog
- User clicks on Add new permissions
This is not a good experience. :(
Updated•2 years ago
|
Reporter | ||
Comment 14•2 years ago
|
||
This is far from FIXED.
Description
•