Open
Bug 1488947
Opened 7 years ago
Updated 3 years ago
Allow changing pageAction show_matches and hide_matches dynamically
Categories
(WebExtensions :: General, enhancement, P5)
Tracking
(Not tracked)
NEW
People
(Reporter: jhirsch, Unassigned)
Details
It would be nice to be able to register and remove page actions from JS, similarly to how context menu items can be managed from JS.
Firefox Screenshots can be enabled/disabled at runtime by toggling the 'extensions.screenshots.disabled' pref. Disabling UI in response to pref changes was originally managed by the bootstrap part of the addon, which used a bit of JS to globally attach and detach a Photon page action[1].
In migrating to a pure webextension, it turns out that it's easy to imperatively manage the context menu item (via browser.menus.create() and browser.menus.remove()), but not a WebExtension page action.
It appears that, in order to 'disable' the page action globally from JS, it would be necessary to manually hide the page action in each tab. In particular, this requires listening for every new tab that's opened, then hiding the page action. This creates a small, but global, performance penalty for users who have disabled Screenshots.
Something like the browser.menus.create and browser.menus.remove/removeAll APIs would be great, especially if a single removeAll() call could remove the page action and context menu item.
[1] https://dxr.mozilla.org/mozilla-central/rev/c2e3be6a1dd352b969a45f0b85e87674e24ad284/browser/extensions/screenshots/bootstrap.js#237
Updated•7 years ago
|
Summary: Allow page actions to be enabled / disabled from JS → Allow changing pageAction show_matches and hide_matches dynamically
| Reporter | ||
Comment 1•7 years ago
|
||
Screenshots might wind up not needing this, instead relying on browser code to manage the startup/shutdown in response to pref changes. See https://bugzilla.mozilla.org/show_bug.cgi?id=1488971
Comment 2•7 years ago
|
||
The reason for this is meh. However, it's probably nice to have a way to programmatically update these values.
Component: Untriaged → General
Priority: -- → P5
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•