fix ubO pt.4

This commit is contained in:
wuggy 2026-09-14 15:39:45 -07:00
commit e134fea1ba
3 changed files with 16 additions and 1 deletions

View file

@ -76,6 +76,12 @@ function BrowserAction(options, extension) {
BrowserAction.prototype = { BrowserAction.prototype = {
build() { build() {
let areas = {
navbar: CustomizableUI.AREA_NAVBAR,
menupanel: CustomizableUI.AREA_PANEL,
tabstrip: CustomizableUI.AREA_TABSTRIP,
personaltoolbar: CustomizableUI.AREA_BOOKMARKS,
};
let widget = CustomizableUI.createWidget({ let widget = CustomizableUI.createWidget({
id: this.id, id: this.id,
viewId: this.viewId, viewId: this.viewId,
@ -83,7 +89,8 @@ BrowserAction.prototype = {
removable: true, removable: true,
label: this.defaults.title || this.extension.name, label: this.defaults.title || this.extension.name,
tooltiptext: this.defaults.title || "", tooltiptext: this.defaults.title || "",
defaultArea: CustomizableUI.AREA_NAVBAR, defaultArea: areas[this.extension.manifest.browser_action.default_area] ||
CustomizableUI.AREA_NAVBAR,
onBeforeCreated: document => { onBeforeCreated: document => {
let view = document.createElementNS(XUL_NS, "panelview"); let view = document.createElementNS(XUL_NS, "panelview");

View file

@ -31,6 +31,11 @@
"browser_style": { "browser_style": {
"type": "boolean", "type": "boolean",
"optional": true "optional": true
},
"default_area": {
"type": "string",
"enum": ["navbar", "menupanel", "tabstrip", "personaltoolbar"],
"optional": true
} }
}, },
"optional": true "optional": true

View file

@ -218,9 +218,12 @@
"enum": [ "enum": [
"alarms", "alarms",
"clipboardWrite", "clipboardWrite",
"dns",
"idle", "idle",
"notifications", "notifications",
"privacy",
"storage" "storage"
,"unlimitedStorage"
] ]
}, },
{ "$ref": "MatchPattern" } { "$ref": "MatchPattern" }