--- a/mobile/android/components/extensions/ext-android.js
+++ b/mobile/android/components/extensions/ext-android.js
@@ -63,16 +63,25 @@ extensions.registerModules({
url: "chrome://browser/content/ext-browsingData.js",
schema: "chrome://browser/content/schemas/browsing_data.json",
scopes: ["addon_parent"],
manifest: ["browsing_data"],
paths: [
["browsingData"],
],
},
+ contextMenus: {
+ url: "chrome://browser/content/ext-contextMenus.js",
+ schema: "chrome://browser/content/schemas/context_menus.json",
+ scopes: ["addon_parent"],
+ manifest: ["context_menus"],
+ paths: [
+ ["contextMenus"],
+ ],
+ },
pageAction: {
url: "chrome://browser/content/ext-pageAction.js",
schema: "chrome://browser/content/schemas/page_action.json",
scopes: ["addon_parent"],
manifest: ["page_action"],
paths: [
["pageAction"],
],
copy from browser/components/extensions/schemas/menus.json
copy to mobile/android/components/extensions/schemas/context_menus.json
--- a/browser/components/extensions/schemas/menus.json
+++ b/mobile/android/components/extensions/schemas/context_menus.json
@@ -6,41 +6,26 @@
{
"namespace": "manifest",
"types": [
{
"$extend": "Permission",
"choices": [{
"type": "string",
"enum": [
- "menus",
"contextMenus"
]
}]
}
]
},
{
"namespace": "contextMenus",
+ "description": "Use the browser.contextMenus 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"],
- "description": "Use the browser.contextMenus 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.",
- "$import": "menus",
- "types": [
- {
- "id": "ContextType",
- "type": "string",
- "enum": ["all", "page", "frame", "selection", "link", "editable", "password", "image", "video", "audio", "launcher", "browser_action", "page_action", "tab"],
- "description": "The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'tab' and 'tools_menu'."
- }
- ]
- },
- {
- "namespace": "menus",
- "permissions": ["menus"],
- "description": "Use the browser.menus API to add items to the browser's menus. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
"properties": {
"ACTION_MENU_TOP_LEVEL_LIMIT": {
"value": 6,
"description": "The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored."
}
},
"types": [
{
@@ -118,40 +103,25 @@
"type": "boolean",
"optional": true,
"description": "A flag indicating the state of a checkbox or radio item before it was clicked."
},
"checked": {
"type": "boolean",
"optional": true,
"description": "A flag indicating the state of a checkbox or radio item after it is clicked."
- },
- "modifiers": {
- "type": "array",
- "items": {
- "type": "string",
- "enum": ["Shift", "Alt", "Command", "Ctrl", "MacCtrl"]
- },
- "description": "An array of keyboard modifiers that were held while the menu item was clicked."
}
}
}
],
"functions": [
{
"name": "create",
"type": "function",
"description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in $(ref:runtime.lastError)).",
- "returns": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "description": "The ID of the newly created item."
- },
"parameters": [
{
"type": "object",
"name": "createProperties",
"properties": {
"type": {
"$ref": "ItemType",
"optional": true,
@@ -190,17 +160,17 @@
},
"onclick": {
"type": "function",
"optional": true,
"description": "A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked).",
"parameters": [
{
"name": "info",
- "$ref": "contextMenusInternal.OnClickData",
+ "$ref": "OnClickData",
"description": "Information about the item clicked and the context where the click happened."
},
{
"name": "tab",
"$ref": "tabs.Tab",
"description": "The details of the tab where the click took place. Note: this parameter only present for extensions."
}
]
@@ -245,16 +215,17 @@
"parameters": []
}
]
},
{
"name": "update",
"type": "function",
"description": "Updates a previously created context menu item.",
+ "unsupported": true,
"async": "callback",
"parameters": [
{
"choices": [
{ "type": "integer" },
{ "type": "string" }
],
"name": "id",
@@ -332,16 +303,17 @@
"description": "Called when the context menu has been updated."
}
]
},
{
"name": "remove",
"type": "function",
"description": "Removes a context menu item.",
+ "unsupported": true,
"async": "callback",
"parameters": [
{
"choices": [
{ "type": "integer" },
{ "type": "string" }
],
"name": "menuItemId",
@@ -355,16 +327,17 @@
"description": "Called when the context menu has been removed."
}
]
},
{
"name": "removeAll",
"type": "function",
"description": "Removes all context menu items added by this extension.",
+ "unsupported": true,
"async": "callback",
"parameters": [
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [],
"description": "Called when removal is complete."
@@ -372,16 +345,17 @@
]
}
],
"events": [
{
"name": "onClicked",
"type": "function",
"description": "Fired when a context menu item is clicked.",
+ "unsupported": true,
"parameters": [
{
"name": "info",
"$ref": "OnClickData",
"description": "Information about the item clicked and the context where the click happened."
},
{
"name": "tab",