Bug 1797838 - Add a webExtension property to CustomizableUI widgets for browserAction buttons. r=dao,willdurand

This property, along with the CustomizableUI.isWebExtensionWidget, will make it possible
to distinguish WebExtension-provided widgets without sniffing CSS classes, which is what
we currently do.

In the event that the widget has been destroyed or hasn't yet been created, this will
fallback to looking for the `-browser-action` suffix on the ID. This is mainly for use during
migrations which happen early during CustomizableUI startup, when it's unlikely that the
extensions have finished initializing themselves and creating their widgets yet.

Differential Revision: https://phabricator.services.mozilla.com/D160802
This commit is contained in:
Mike Conley
2022-11-02 16:52:59 +00:00
parent 42bf882616
commit ce84c284ed
5 changed files with 56 additions and 23 deletions

View File

@@ -196,6 +196,7 @@ this.browserAction = class extends ExtensionAPIPersistent {
id: this.id,
viewId: this.viewId,
type: "view",
webExtension: true,
removable: true,
label: this.action.getProperty(null, "title"),
tooltiptext: this.action.getProperty(null, "title"),