| // Copyright 2014 The Chromium Authors. All rights reserved. |
| // 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/web_view/web_view_internal_api.h" |
| }, |
| "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 browser's 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." |
| } |
| } |
| }, |
| { |
| "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)." |
| } |
| } |
| } |
| ], |
| "functions": [ |
| { |
| "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." |
| }, |
| { |
| "type": "function", |
| "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." |
| }, |
| { |
| "type": "function", |
| "name": "callback", |
| "optional": true, |
| "description": "Called when all the CSS has been inserted.", |
| "parameters": [] |
| } |
| ] |
| }, |
| { |
| "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." |
| }, |
| { |
| "type": "function", |
| "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." |
| }, |
| { |
| "type": "function", |
| "name": "callback", |
| "description": "Called after the current zoom factor is retrieved.", |
| "parameters": [ |
| { |
| "type": "number", |
| "name": "zoomFactor", |
| "description": "The current zoom factor." |
| } |
| ] |
| } |
| ] |
| }, |
| { |
| "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 |
| } |
| } |
| }, |
| { |
| "type": "function", |
| "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." |
| }, |
| { |
| "type": "string", |
| "name": "action", |
| "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.", |
| "optional": true, |
| "enum": ["clear", "keep", "activate"] |
| } |
| ] |
| }, |
| { |
| "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 |
| }, |
| { |
| "type": "function", |
| "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" |
| }, |
| { |
| "type": "function", |
| "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": "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" |
| }, |
| { |
| "type": "string", |
| "name": "action", |
| "enum": ["allow", "deny", "default"] |
| }, |
| { |
| "type": "string", |
| "name": "userInput", |
| "optional": true |
| }, |
| { |
| "type": "function", |
| "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": "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." |
| }, |
| { |
| "name": "callback", |
| "type": "function", |
| "description": "Called when deletion has completed.", |
| "optional": true, |
| "parameters": [] |
| } |
| ] |
| } |
| ] |
| } |
| ] |