1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 "namespace": "webview",
9 "dependencies": ["contextMenusInternal"],
14 "description": "A set of data types. Missing data types are interpreted as <code>false</code>.",
19 "description": "Websites' appcaches."
24 "description": "The browser's cookies."
29 "description": "Websites' file systems."
34 "description": "Websites' IndexedDB data."
39 "description": "Websites' local storage data."
44 "description": "Websites' WebSQL data."
49 "id": "RemovalOptions",
51 "description": "Options that determine exactly what data will be removed.",
56 "description": "Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the <code>getTime</code> method of the JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remove all browsing data)."
63 "name": "contextMenusCreate",
67 { "type": "integer" },
70 "description": "The ID of the newly created item."
80 "name": "createProperties",
84 "enum": ["normal", "checkbox", "radio", "separator"],
86 "description": "The type of menu item. Defaults to 'normal' if not specified."
91 "description": "The unique ID to assign to this item. Cannot be the same as another ID for this webview."
96 "description": "The text to be displayed in the item; this is <em>required</em> unless <em>type</em> is 'separator'. When the context is 'selection', you can use <code>%s</code> within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"."
101 "description": "The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items."
107 // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API.
108 "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher"]
112 "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is not supported for <webview>."
117 "description": "A function that will be called back when the menu item is clicked.",
121 "$ref": "contextMenusInternal.OnClickData",
122 "description": "Information about the item clicked and the context where the click happened."
128 { "type": "integer" },
132 "description": "The ID of a parent menu item; this makes the item a child of a previously added item."
134 "documentUrlPatterns": {
136 "items": {"type": "string"},
138 "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see <a href='match_patterns.html'>Match Patterns</a>."
140 "targetUrlPatterns": {
142 "items": {"type": "string"},
144 "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."
149 "description": "Whether this context menu item is enabled or disabled. Defaults to true."
157 "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.",
163 "name": "contextMenusUpdate",
165 "description": "Updates a previously created context menu item.",
169 "name": "instanceId",
174 { "type": "integer" },
178 "description": "The ID of the item to update."
181 "name": "updateProperties",
182 "description": "The properties to update. Accepts the same values as the create function.",
186 "enum": ["normal", "checkbox", "radio", "separator"],
201 // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API.
202 "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher"]
206 "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified. Specifying ['all'] is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is not supported for <webview>."
214 { "type": "integer" },
218 "description": "Note: You cannot change an item to be a child of one of its own descendants."
220 "documentUrlPatterns": {
222 "items": {"type": "string"},
225 "targetUrlPatterns": {
227 "items": {"type": "string"},
241 "description": "Called when the context menu has been updated."
246 "name": "contextMenusRemove",
248 "description": "Removes a context menu item.",
252 "name": "instanceId",
257 { "type": "integer" },
260 "name": "menuItemId",
261 "description": "The ID of the context menu item to remove."
268 "description": "Called when the context menu has been removed."
273 "name": "contextMenusRemoveAll",
275 "description": "Removes all context menu items added by this webview.",
279 "name": "instanceId",
287 "description": "Called when removal is complete."
294 "description": "Clears various types of browsing data stored in a storage partition of a <webview>.",
298 "name": "instanceId",
299 "description": "The instance ID of the guest <webview> process."
302 "$ref": "RemovalOptions",
306 "name": "dataToRemove",
307 "$ref": "DataTypeSet",
308 "description": "The set of data types to remove."
313 "description": "Called when deletion has completed.",
320 "name": "executeScript",
322 "description": "Injects JavaScript code into a <webview> page.",
326 "name": "instanceId",
327 "description": "The instance ID of the guest <webview> process."
332 "description": "The src of the guest <webview> process."
335 "$ref": "tabs.InjectDetails",
337 "description": "Details of the script to run."
343 "description": "Called after all the JavaScript has been executed.",
349 "items": {"type": "any", "minimum": 0},
350 "description": "The result of the script in every injected frame."
359 "description": "Injects JavaScript code into a <webview> page.",
363 "name": "instanceId",
364 "description": "The instance ID of the guest <webview> process."
369 "description": "The src of the guest <webview> process."
372 "$ref": "tabs.InjectDetails",
374 "description": "Details of the script to run."
380 "description": "Called after all the JavaScript has been executed.",
386 "items": {"type": "any", "minimum": 0},
387 "description": "The result of the script in every injected frame."
394 "name": "captureVisibleRegion",
396 "description": "Captures the visible area of the currently loaded page inside <webview>.",
400 "name": "instanceId",
401 "description": "The instance ID of the guest <webview> process."
404 "$ref": "types.ImageDetails",
409 "type": "function", "name": "callback", "parameters": [
410 {"type": "string", "name": "dataUrl", "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."}
421 "name": "instanceId",
422 "description": "The instance ID of the guest <webview> process."
426 "name": "zoomFactor",
427 "description" : "The new zoom factor."
432 "description": "Called after the zoom message has been sent to the guest process.",
444 "name": "instanceId",
445 "description": "The instance ID of the guest <webview> process."
450 "description": "Called after the current zoom factor is retreived.",
454 "name": "zoomFactor",
455 "description": "The current zoom factor."
464 "description": "Initiates a find-in-page request.",
468 "name": "instanceId",
469 "description": "The instance ID of the guest <webview> process."
473 "name": "searchText",
474 "description": "The string to find in the page."
483 "description": "Flag to find matches in reverse order.",
488 "description": "Flag to match |searchText| with case-sensitivity.",
496 "description": "Called after all find results have been returned for this find request.",
506 "description": "The number of times |searchText| was matched on the page."
508 "activeMatchOrdinal": {
510 "description": "The ordinal number of the current match."
514 "description": "Describes a rectangle around the active match.",
532 "description": "Indicates whether this find request was canceled."
541 "name": "stopFinding",
543 "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
547 "name": "instanceId",
548 "description": "The instance ID of the guest <webview> process."
553 "description": "Determines what to do with the active match after the find session has ended. 'clear' will clear the highlighting over the active match; 'keep' will keep the active match highlighted; 'activate' will keep the active match highlighted and simulate a user click on that match.",
555 "enum": ["clear", "keep", "activate"]
569 "name": "relativeIndex"
574 "name": "overrideUserAgent",
583 "name": "userAgentOverride"
598 "name": "setPermission",
612 "enum": ["allow", "deny", "default"]
658 "$ref": "contextMenusInternal.onClicked"