Persist contextMenus.create across restarts
Categories
(WebExtensions :: Frontend, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: robwu, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome)
Context menus registered via the menus.create
or contextMenus.create
API are currently discarded when an extension is unloaded. Global context menus are expected to be registered when a background page is loaded.
In contrast, in Chrome, context menu registrations persist across restarts, and the documented way to register menu items is to call chrome.contextMenus.create
from the chrome.runtime.onInstalled
event.
Because of this difference, extensions ported from Chrome will initially have a context menu, but if reloaded, or disabled + re-enabled, the context menus will be absent because runtime.onInstalled
is not triggered in these cases, e.g. in bug 1558336.
(The behavior of persistent menus is necessary to support event pages, where background pages are suspended and (re)loaded multiple times during a single browser session. Firefox does not support event pages (and the bug to support context menus in event pages was closed - bug 1215377), but there is interest in its successor (bug 1524595), so at some point we should also consider persisting context menus across restarts (at least those that have are registered and identifiably by their mandatory "id"
parameter). )
Updated•5 years ago
|
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Description
•