mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-24 09:27:31 +09:00
Add 'menus' to WE manifest
This commit is contained in:
parent
0ff6a01974
commit
a69e982b98
4 changed files with 16 additions and 3 deletions
|
|
@ -68,6 +68,13 @@ function BrowserAction(options, extension) {
|
||||||
"or not in your browser_action options.");
|
"or not in your browser_action options.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.defaultArea = {
|
||||||
|
navbar: CustomizableUI.AREA_NAVBAR,
|
||||||
|
menupanel: CustomizableUI.AREA_PANEL,
|
||||||
|
tabstrip: CustomizableUI.AREA_TABSTRIP,
|
||||||
|
personaltoolbar: CustomizableUI.AREA_BOOKMARKS,
|
||||||
|
}[options.default_area] || CustomizableUI.AREA_NAVBAR;
|
||||||
|
|
||||||
this.tabContext = new TabContext(tab => Object.create(this.defaults),
|
this.tabContext = new TabContext(tab => Object.create(this.defaults),
|
||||||
extension);
|
extension);
|
||||||
|
|
||||||
|
|
@ -83,7 +90,7 @@ 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: this.defaultArea,
|
||||||
|
|
||||||
onBeforeCreated: document => {
|
onBeforeCreated: document => {
|
||||||
let view = document.createElementNS(XUL_NS, "panelview");
|
let view = document.createElementNS(XUL_NS, "panelview");
|
||||||
|
|
@ -146,7 +153,7 @@ BrowserAction.prototype = {
|
||||||
// Ensure browser actions remain discoverable in the main toolbar while
|
// Ensure browser actions remain discoverable in the main toolbar while
|
||||||
// respecting an existing user-selected placement.
|
// respecting an existing user-selected placement.
|
||||||
if (!CustomizableUI.getPlacementOfWidget(this.id)) {
|
if (!CustomizableUI.getPlacementOfWidget(this.id)) {
|
||||||
CustomizableUI.addWidgetToArea(this.id, CustomizableUI.AREA_NAVBAR);
|
CustomizableUI.addWidgetToArea(this.id, this.defaultArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tabContext.on("tab-select", // eslint-disable-line mozilla/balanced-listeners
|
this.tabContext.on("tab-select", // eslint-disable-line mozilla/balanced-listeners
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
{
|
{
|
||||||
"namespace": "contextMenus",
|
"namespace": "contextMenus",
|
||||||
"description": "Use the <code>browser.contextMenus</code> API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
|
"description": "Use the <code>browser.contextMenus</code> API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
|
||||||
"permissions": ["contextMenus"],
|
"permissions": ["contextMenus", "menus"],
|
||||||
"properties": {
|
"properties": {
|
||||||
"ACTION_MENU_TOP_LEVEL_LIMIT": {
|
"ACTION_MENU_TOP_LEVEL_LIMIT": {
|
||||||
"value": 6,
|
"value": 6,
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,7 @@
|
||||||
"clipboardWrite",
|
"clipboardWrite",
|
||||||
"dns",
|
"dns",
|
||||||
"idle",
|
"idle",
|
||||||
|
"menus",
|
||||||
"notifications",
|
"notifications",
|
||||||
"privacy",
|
"privacy",
|
||||||
"storage"
|
"storage"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue