1 // Copyright 2014 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": "webViewInternal",
10 "implemented_in": "chrome/browser/extensions/api/web_view/web_view_internal_api.h"
12 "dependencies": ["contextMenusInternal"],
17 "description": "A set of data types. Missing data types are interpreted as <code>false</code>.",
22 "description": "Websites' appcaches."
27 "description": "The browser's cookies."
32 "description": "Websites' file systems."
37 "description": "Websites' IndexedDB data."
42 "description": "Websites' local storage data."
47 "description": "Websites' WebSQL data."
52 "id": "ContextMenuItem",
54 "description": "An item in the context menu.",
58 "description": "label of the item",
63 "description": "id of the input item"
68 "id": "RemovalOptions",
70 "description": "Options that determine exactly what data will be removed.",
75 "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)."
82 "name": "contextMenusCreate",
86 { "type": "integer" },
89 "description": "The ID of the newly created item."
99 "name": "createProperties",
103 "enum": ["normal", "checkbox", "radio", "separator"],
105 "description": "The type of menu item. Defaults to 'normal' if not specified."
110 "description": "The unique ID to assign to this item. Cannot be the same as another ID for this webview."
115 "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\"."
120 "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."
126 // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API.
127 "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"]
131 "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>."
136 "description": "A function that will be called back when the menu item is clicked.",
140 "$ref": "contextMenusInternal.OnClickData",
141 "description": "Information about the item clicked and the context where the click happened."
147 { "type": "integer" },
151 "description": "The ID of a parent menu item; this makes the item a child of a previously added item."
153 "documentUrlPatterns": {
155 "items": {"type": "string"},
157 "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'>Match Patterns</a>."
159 "targetUrlPatterns": {
161 "items": {"type": "string"},
163 "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."
168 "description": "Whether this context menu item is enabled or disabled. Defaults to true."
176 "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.",
182 "name": "contextMenusUpdate",
184 "description": "Updates a previously created context menu item.",
188 "name": "instanceId",
193 { "type": "integer" },
197 "description": "The ID of the item to update."
200 "name": "updateProperties",
201 "description": "The properties to update. Accepts the same values as the create function.",
205 "enum": ["normal", "checkbox", "radio", "separator"],
220 // |launcher| isn't actually supported, this is listed here so that we can build |contexts| using the same code from chrome.contextMenus API.
221 "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"]
225 "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>."
233 { "type": "integer" },
237 "description": "Note: You cannot change an item to be a child of one of its own descendants."
239 "documentUrlPatterns": {
241 "items": {"type": "string"},
244 "targetUrlPatterns": {
246 "items": {"type": "string"},
260 "description": "Called when the context menu has been updated."
265 "name": "contextMenusRemove",
267 "description": "Removes a context menu item.",
271 "name": "instanceId",
276 { "type": "integer" },
279 "name": "menuItemId",
280 "description": "The ID of the context menu item to remove."
287 "description": "Called when the context menu has been removed."
292 "name": "contextMenusRemoveAll",
294 "description": "Removes all context menu items added by this webview.",
298 "name": "instanceId",
306 "description": "Called when removal is complete."
313 "description": "Clears various types of browsing data stored in a storage partition of a <webview>.",
317 "name": "instanceId",
318 "description": "The instance ID of the guest <webview> process."
321 "$ref": "RemovalOptions",
325 "name": "dataToRemove",
326 "$ref": "DataTypeSet",
327 "description": "The set of data types to remove."
332 "description": "Called when deletion has completed.",
339 "name": "executeScript",
341 "description": "Injects JavaScript code into a <webview> page.",
345 "name": "instanceId",
346 "description": "The instance ID of the guest <webview> process."
351 "description": "The src of the guest <webview> tag."
354 "$ref": "tabs.InjectDetails",
356 "description": "Details of the script to run."
362 "description": "Called after all the JavaScript has been executed.",
368 "items": {"type": "any", "minimum": 0},
369 "description": "The result of the script in every injected frame."
378 "description": "Injects CSS into a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
382 "name": "instanceId",
383 "description": "The instance ID of the guest <webview> process."
388 "description": "The src of the guest <webview> tag."
391 "$ref": "tabs.InjectDetails",
393 "description": "Details of the CSS text to insert."
399 "description": "Called when all the CSS has been inserted.",
405 "name": "captureVisibleRegion",
407 "description": "Captures the visible area of the currently loaded page inside <webview>.",
411 "name": "instanceId",
412 "description": "The instance ID of the guest <webview> process."
415 "$ref": "types.ImageDetails",
420 "type": "function", "name": "callback", "parameters": [
421 {"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."}
432 "name": "instanceId",
433 "description": "The instance ID of the guest <webview> process."
437 "name": "zoomFactor",
438 "description" : "The new zoom factor."
443 "description": "Called after the zoom message has been sent to the guest process.",
455 "name": "instanceId",
456 "description": "The instance ID of the guest <webview> process."
461 "description": "Called after the current zoom factor is retreived.",
465 "name": "zoomFactor",
466 "description": "The current zoom factor."
475 "description": "Initiates a find-in-page request.",
479 "name": "instanceId",
480 "description": "The instance ID of the guest <webview> process."
484 "name": "searchText",
485 "description": "The string to find in the page."
494 "description": "Flag to find matches in reverse order.",
499 "description": "Flag to match |searchText| with case-sensitivity.",
507 "description": "Called after all find results have been returned for this find request.",
517 "description": "The number of times |searchText| was matched on the page."
519 "activeMatchOrdinal": {
521 "description": "The ordinal number of the current match."
525 "description": "Describes a rectangle around the active match.",
543 "description": "Indicates whether this find request was canceled."
552 "name": "stopFinding",
554 "description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
558 "name": "instanceId",
559 "description": "The instance ID of the guest <webview> process."
564 "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.",
566 "enum": ["clear", "keep", "activate"]
580 "name": "relativeIndex"
585 "name": "overrideUserAgent",
594 "name": "userAgentOverride"
623 "name": "setPermission",
637 "enum": ["allow", "deny", "default"]
672 "name": "showContextMenu",
677 "name": "instanceId",
678 "description": "The instance ID of the guest <webview> process. This not exposed to developers through the API."
683 "description": "The strictly increasing request counter that serves as ID for the context menu. This not exposed to developers through the API."
687 "name": "itemsToShow",
688 "items": {"$ref": "ContextMenuItem"},
689 "description": "Items to be shown in the context menu. These are top level items as opposed to children items.",
720 "$ref": "contextMenusInternal.onClicked"