OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "contextMenus", | 7 "namespace": "contextMenus", |
8 "description": "Use the <code>chrome.contextMenus</code> API to add items to
Google Chrome's context menu. You can choose what types of objects your context
menu additions apply to, such as images, hyperlinks, and pages.", | 8 "description": "Use the <code>chrome.contextMenus</code> API to add items to
Google Chrome's context menu. You can choose what types of objects your context
menu additions apply to, such as images, hyperlinks, and pages.", |
9 "properties": { | |
10 "ACTION_MENU_TOP_LEVEL_LIMIT": { | |
11 "value": 6, | |
12 "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." | |
13 } | |
14 }, | |
15 "functions": [ | 9 "functions": [ |
16 { | 10 { |
17 "name": "create", | 11 "name": "create", |
18 "type": "function", | 12 "type": "function", |
19 "description": "Creates a new context menu item. Note that if an error o
ccurs during creation, you may not find out until the creation callback fires (t
he details will be in chrome.runtime.lastError).", | 13 "description": "Creates a new context menu item. Note that if an error o
ccurs during creation, you may not find out until the creation callback fires (t
he details will be in chrome.runtime.lastError).", |
20 "returns": { | 14 "returns": { |
21 "choices": [ | 15 "choices": [ |
22 { "type": "integer" }, | 16 { "type": "integer" }, |
23 { "type": "string" } | 17 { "type": "string" } |
24 ], | 18 ], |
(...skipping 22 matching lines...) Expand all Loading... |
47 }, | 41 }, |
48 "checked": { | 42 "checked": { |
49 "type": "boolean", | 43 "type": "boolean", |
50 "optional": true, | 44 "optional": true, |
51 "description": "The initial state of a checkbox or radio item: t
rue for selected and false for unselected. Only one radio item can be selected a
t a time in a given group of radio items." | 45 "description": "The initial state of a checkbox or radio item: t
rue for selected and false for unselected. Only one radio item can be selected a
t a time in a given group of radio items." |
52 }, | 46 }, |
53 "contexts": { | 47 "contexts": { |
54 "type": "array", | 48 "type": "array", |
55 "items": { | 49 "items": { |
56 "type": "string", | 50 "type": "string", |
57 "enum": ["all", "page", "frame", "selection", "link", "editabl
e", "image", "video", "audio", "launcher", "browser_action", "page_action"] | 51 "enum": ["all", "page", "frame", "selection", "link", "editabl
e", "image", "video", "audio", "launcher"] |
58 }, | 52 }, |
59 "minItems": 1, | 53 "minItems": 1, |
60 "optional": true, | 54 "optional": true, |
61 "description": "List of contexts this menu item will appear in.
Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the c
ombination of all other contexts except for 'launcher'. The 'launcher' context i
s only supported by apps and is used to add menu items to the context menu that
appears when clicking on the app icon in the launcher/taskbar/dock/etc. Differen
t platforms might put limitations on what is actually supported in a launcher co
ntext menu." | 55 "description": "List of contexts this menu item will appear in.
Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the c
ombination of all other contexts except for 'launcher'. The 'launcher' context i
s only supported by apps and is used to add menu items to the context menu that
appears when clicking on the app icon in the launcher/taskbar/dock/etc. Differen
t platforms might put limitations on what is actually supported in a launcher co
ntext menu." |
62 }, | 56 }, |
63 "onclick": { | 57 "onclick": { |
64 "type": "function", | 58 "type": "function", |
65 "optional": true, | 59 "optional": true, |
66 "description": "A function that will be called back when the men
u item is clicked. Event pages cannot use this; instead, they should register a
listener for chrome.contextMenus.onClicked.", | 60 "description": "A function that will be called back when the men
u item is clicked. Event pages cannot use this; instead, they should register a
listener for chrome.contextMenus.onClicked.", |
67 "parameters": [ | 61 "parameters": [ |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 "optional": true | 136 "optional": true |
143 }, | 137 }, |
144 "checked": { | 138 "checked": { |
145 "type": "boolean", | 139 "type": "boolean", |
146 "optional": true | 140 "optional": true |
147 }, | 141 }, |
148 "contexts": { | 142 "contexts": { |
149 "type": "array", | 143 "type": "array", |
150 "items": { | 144 "items": { |
151 "type": "string", | 145 "type": "string", |
152 "enum": ["all", "page", "frame", "selection", "link", "editabl
e", "image", "video", "audio", "launcher", "browser_action", "page_action"] | 146 "enum": ["all", "page", "frame", "selection", "link", "editabl
e", "image", "video", "audio", "launcher"] |
153 }, | 147 }, |
154 "minItems": 1, | 148 "minItems": 1, |
155 "optional": true | 149 "optional": true |
156 }, | 150 }, |
157 "onclick": { | 151 "onclick": { |
158 "type": "function", | 152 "type": "function", |
159 "optional": true | 153 "optional": true |
160 }, | 154 }, |
161 "parentId": { | 155 "parentId": { |
162 "choices": [ | 156 "choices": [ |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 ], | 224 ], |
231 "events": [ | 225 "events": [ |
232 { | 226 { |
233 "name": "onClicked", | 227 "name": "onClicked", |
234 "type": "function", | 228 "type": "function", |
235 "$ref": "contextMenusInternal.onClicked" | 229 "$ref": "contextMenusInternal.onClicked" |
236 } | 230 } |
237 ] | 231 ] |
238 } | 232 } |
239 ] | 233 ] |
OLD | NEW |