blob: 262f219a1572c04fb5da560101a39a0b8278c127 [file] [log] [blame]
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "webViewInternal",
"description": "none",
"compiler_options": {
"implemented_in": "extensions/browser/api/guest_view/web_view/web_view_internal_api.h"
},
"properties": {
"MAX_CAPTURE_VISIBLE_REGION_CALLS_PER_SECOND": {
"value": 2,
"description": "The maximum number of times that $(ref:captureVisibleRegion) can be called per second. $(ref:captureVisibleRegion) is expensive and should not be called too often."
}
},
"types": [
{
"id": "DataTypeSet",
"type": "object",
"description": "A set of data types. Missing data types are interpreted as <code>false</code>.",
"properties": {
"appcache": {
"type": "boolean",
"optional": true,
"description": "Websites' appcaches."
},
"cookies": {
"type": "boolean",
"optional": true,
"description": "The Websites' cookies. This will remove both session and persistent cookies"
},
"sessionCookies": {
"type": "boolean",
"optional": true,
"description": "The Websites' session cookies."
},
"persistentCookies": {
"type": "boolean",
"optional": true,
"description": "The Websites' persistent cookies."
},
"fileSystems": {
"type": "boolean",
"optional": true,
"description": "Websites' file systems."
},
"indexedDB": {
"type": "boolean",
"optional": true,
"description": "Websites' IndexedDB data."
},
"localStorage": {
"type": "boolean",
"optional": true,
"description": "Websites' local storage data."
},
"webSQL": {
"type": "boolean",
"optional": true,
"description": "Websites' WebSQL data."
},
"cache": {
"type": "boolean",
"optional": true,
"description": "The Websites' cache data. Note: when removing data, this clears the <em>entire</em> cache: it is not limited to the range you specify."
}
}
},
{
"id": "RemovalOptions",
"type": "object",
"description": "Options that determine exactly what data will be removed.",
"properties": {
"since": {
"type": "number",
"optional": true,
"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)."
}
}
},
{
"id": "ZoomMode",
"type": "string",
"description": "Defines the how zooming is handled in the webview.",
"enum": [
{
"name": "per-origin",
"description": "Zoom changes will persist in the zoomed page's origin, i.e. all other webviews in the same partition that are navigated to that same origin will be zoomed as well. Moreover, <code>per-origin</code> zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor."
},
{
"name": "per-view",
"description": "Zoom changes only take effect in this webview, and zoom changes in other webviews will not affect the zooming of this webview. Also, <code>per-view</code> zoom changes are reset on navigation; navigating a webview will always load pages with their per-origin zoom factors (within the scope of the partition)."
},
{
"name": "disabled",
"description": "Disables all zooming in the webview. The content will revert to the default zoom level, and all attempted zoom changes will be ignored."
}
]
},
{
"id": "StopFindingAction",
"type": "string",
"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.",
"enum": ["clear", "keep", "activate"]
},
{
"id": "SetPermissionAction",
"type": "string",
"enum": ["allow", "deny", "default"]
},
{
"id": "InjectionItems",
"type": "object",
"description": "The type of injection item: code or a set of files.",
"properties": {
"code": {
"type": "string",
"optional": true,
"description": "JavaScript code or CSS to be injected into matching pages."
},
"files": {
"type": "array",
"items": { "type": "string"},
"optional": true,
"description": "The list of JavaScript or CSS files to be injected into matching pages. These are injected in the order they appear in this array."
}
}
},
{
"id": "ContentScriptDetails",
"type": "object",
"description": "Details of the content script to inject.",
"properties": {
"name": {
"type": "string",
"description": "The name of the content script to inject."
},
"matches": {
"type": "array",
"items": { "type": "string"},
"description": "Specifies which pages this content script will be injected into."
},
"exclude_matches": {
"type": "array",
"items": { "type": "string"},
"optional": true,
"description": "Excludes pages that this content script would otherwise be injected into."
},
"match_about_blank": {
"type": "boolean",
"optional": true,
"description": "Whether to insert the content script on about:blank and about:srcdoc. Content scripts will only be injected on pages when their inherit URL is matched by one of the declared patterns in the matches field. The inherit URL is the URL of the document that created the frame or window. Content scripts cannot be inserted in sandboxed frames."
},
"css": {
"$ref": "InjectionItems",
"optional": true,
"description": "The CSS code or a list of CSS files to be injected into matching pages. These are injected in the order they appear, before any DOM is constructed or displayed for the page."
},
"js": {
"$ref": "InjectionItems",
"optional": true,
"description": "The JavaScript code or a list of JavaScript files to be injected into matching pages. These are injected in the order they appear."
},
"run_at": {
"$ref": "extensionTypes.RunAt",
"optional": true,
"description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
},
"all_frames": {
"type": "boolean",
"optional": true,
"description": "If allFrames is <code>true</code>, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame."
},
"include_globs": {
"type": "array",
"items": { "type": "string"},
"optional": true,
"description": "Applied after matches to include only those URLs that also match this glob. Intended to emulate the @include Greasemonkey keyword."
},
"exclude_globs": {
"type": "array",
"items": { "type": "string"},
"optional": true,
"description": "Applied after matches to exclude URLs that match this glob. Intended to emulate the @exclude Greasemonkey keyword."
}
},
"required": ["name", "matches"]
}
],
"functions": [
{
"name": "getAudioState",
"type": "function",
"description": "Callback that returns audio state.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
}
],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "audible",
"type": "boolean"
}
]
}
},
{
"name": "setAudioMuted",
"type": "function",
"description": "Sets audio mute state.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "boolean",
"name": "mute",
"description": "Mute audio value."
}
]
},
{
"name": "isAudioMuted",
"type": "function",
"description": "Callback that returns whether audio is muted.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
}
],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "muted",
"type": "boolean"
}
]
}
},
{
"name": "executeScript",
"type": "function",
"description": "Injects JavaScript code into a <webview> page.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "string",
"name": "src",
"description": "The src of the guest <webview> tag."
},
{
"$ref": "extensionTypes.InjectDetails",
"name": "details",
"description": "Details of the script to run."
}
],
"returns_async": {
"name": "callback",
"optional": true,
"description": "Called after all the JavaScript has been executed.",
"parameters": [
{
"name": "result",
"optional": true,
"type": "array",
"items": {"type": "any", "minimum": 0},
"description": "The result of the script in every injected frame."
}
]
}
},
{
"name": "insertCSS",
"type": "function",
"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.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "string",
"name": "src",
"description": "The src of the guest <webview> tag."
},
{
"$ref": "extensionTypes.InjectDetails",
"name": "details",
"description": "Details of the CSS text to insert."
}
],
"returns_async": {
"name": "callback",
"optional": true,
"description": "Called when all the CSS has been inserted.",
"parameters": []
}
},
{
"name": "addContentScripts",
"type": "function",
"description": "Adds content scripts into a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "array",
"name": "contentScriptList",
"items": {
"$ref": "ContentScriptDetails",
"name": "contentScriptDetails"
},
"description": "Details of the content scripts to add.",
"minItems": 1
}
]
},
{
"name": "removeContentScripts",
"type": "function",
"description": "Removes specified content scripts from a <webview> page. For details, see the <a href='/extensions/content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "array",
"name": "scriptNameList",
"items": {
"type": "string",
"description": "The name of a content script that will be removed."
},
"optional": true,
"description": "A list of names of content scripts that will be removed. If the list is empty, all the content scripts added to the <webview> page will be removed."
}
]
},
{
"name": "setZoom",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "number",
"name": "zoomFactor",
"description" : "The new zoom factor."
}
],
"returns_async": {
"name": "callback",
"description": "Called after the zoom message has been sent to the guest process.",
"optional": true,
"parameters": []
}
},
{
"name": "getZoom",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
}
],
"returns_async": {
"name": "callback",
"description": "Called after the current zoom factor is retrieved.",
"parameters": [
{
"type": "number",
"name": "zoomFactor",
"description": "The current zoom factor."
}
]
}
},
{
"name": "setZoomMode",
"type": "function",
"description": "Sets the zoom mode of the webview.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"$ref": "ZoomMode",
"name": "ZoomMode",
"description": "Defines how zooming is handled in the webview."
}
],
"returns_async": {
"name": "callback",
"description": "Called after the zoom mode has been changed.",
"optional": true,
"parameters": []
}
},
{
"name": "getZoomMode",
"type": "function",
"description": "Gets the current zoom mode.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
}
],
"returns_async": {
"name": "callback",
"description": "Called with the webview's current zoom mode.",
"parameters": [
{
"$ref": "ZoomMode",
"name": "ZoomMode",
"description": "The webview's current zoom mode."
}
]
}
},
{
"name": "find",
"type": "function",
"description": "Initiates a find-in-page request.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "string",
"name": "searchText",
"description": "The string to find in the page."
},
{
"type": "object",
"name": "options",
"optional": true,
"properties": {
"backward": {
"type": "boolean",
"description": "Flag to find matches in reverse order.",
"optional": true
},
"matchCase": {
"type": "boolean",
"description": "Flag to match |searchText| with case-sensitivity.",
"optional": true
}
}
}
],
"returns_async": {
"name": "callback",
"description": "Called after all find results have been returned for this find request.",
"optional": true,
"parameters": [
{
"type": "object",
"name": "results",
"optional": true,
"properties": {
"numberOfMatches": {
"type": "integer",
"description": "The number of times |searchText| was matched on the page."
},
"activeMatchOrdinal": {
"type": "integer",
"description": "The ordinal number of the current match."
},
"selectionRect": {
"type": "object",
"description": "Describes a rectangle around the active match.",
"properties": {
"left": {
"type": "integer"
},
"top": {
"type": "integer"
},
"width": {
"type": "integer"
},
"height": {
"type": "integer"
}
}
},
"canceled": {
"type": "boolean",
"description": "Indicates whether this find request was canceled."
}
}
}
]
}
},
{
"name": "stopFinding",
"type": "function",
"description": "Ends the current find session (clearing all highlighting) and cancels all find requests in progress.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"$ref": "StopFindingAction",
"name": "action",
"description": "Determines what to do with the active match after the find session has ended.",
"optional": true
}
]
},
{
"name": "loadDataWithBaseUrl",
"type": "function",
"description": "Loads a data URL with a specified base URL used for relative links. Optionally, a virtual URL can be provided to be shown to the user instead of the data URL.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "string",
"name": "dataUrl",
"description" : "The data URL to load."
},
{
"type": "string",
"name": "baseUrl",
"description": "The base URL that will be used for relative links."
},
{
"type": "string",
"name": "virtualUrl",
"description": "The URL that will be displayed to the user.",
"optional": true
}
],
"returns_async": {
"name": "callback",
"description": "Called internally for the purpose of reporting errors to console.error().",
"parameters": []
}
},
{
"name": "go",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "integer",
"name": "relativeIndex"
}
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "success",
"type": "boolean",
"description": "Indicates whether the navigation was successful."
}
]
}
},
{
"name": "overrideUserAgent",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "string",
"name": "userAgentOverride"
}
]
},
{
"name": "reload",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
}
]
},
{
"name": "setAllowTransparency",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "boolean",
"name": "allow"
}
]
},
{
"name": "setAllowScaling",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "boolean",
"name": "allow"
}
]
},
{
"name": "setName",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "string",
"name": "frameName"
}
]
},
{
"name": "setPermission",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "integer",
"name": "requestId"
},
{
"$ref": "SetPermissionAction",
"name": "action"
},
{
"type": "string",
"name": "userInput",
"optional": true
}
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "allowed",
"type": "boolean"
}
]
}
},
{
"name": "navigate",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
},
{
"type": "string",
"name": "src"
}
]
},
{
"name": "stop",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
}
]
},
{
"name": "terminate",
"type": "function",
"parameters": [
{
"type": "integer",
"name": "instanceId"
}
]
},
{
"name": "captureVisibleRegion",
"type": "function",
"description": "foo",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"$ref": "extensionTypes.ImageDetails",
"name": "options",
"optional": true
}
],
"returns_async": {
"name": "callback",
"parameters": [
{"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."
}
]
}
},
{
"name": "setSpatialNavigationEnabled",
"type": "function",
"description": "Sets spatial navigation state of the webview.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"type": "boolean",
"name": "spatialNavEnabled",
"description": "Spatial navigation state value."
}
]
},
{
"name": "isSpatialNavigationEnabled",
"type": "function",
"description": "Callback that returns whether whether spatial navigation is enabled for the webview.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
}
],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "spatialNavEnabled",
"type": "boolean"
}
]
}
},
{
"name": "clearData",
"type": "function",
"description": "Clears various types of browsing data stored in a storage partition of a <webview>.",
"parameters": [
{
"type": "integer",
"name": "instanceId",
"description": "The instance ID of the guest <webview> process."
},
{
"$ref": "RemovalOptions",
"name": "options"
},
{
"name": "dataToRemove",
"$ref": "DataTypeSet",
"description": "The set of data types to remove."
}
],
"returns_async": {
"name": "callback",
"description": "Called when deletion has completed.",
"optional": true,
"parameters": []
}
}
]
}
]