Closed Bug 1567467 Opened 6 years ago Closed 2 years ago

Persist contextMenus.create across restarts

Categories

(WebExtensions :: Frontend, enhancement, P3)

66 Branch
enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1748558

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). )

See Also: → 1558336
Priority: -- → P3
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1748558
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.