OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 [ |
| 6 { |
| 7 "namespace": "webview", |
| 8 "nodoc": true, |
| 9 "dependencies": [ "extension", "tabs" ], |
| 10 "types": [ |
| 11 // TODO(fsamuel): We should be usng tabs.InjectDetails. However, due to a |
| 12 // bug in the JSON compiler, we are currently copying-and-pasting this |
| 13 // type: https://crbug.com/171726. |
| 14 { |
| 15 "id": "InjectDetails", |
| 16 "type": "object", |
| 17 "description": "Details of the script or CSS to inject. Either the code
or the file property must be set, but both may not be set at the same time.", |
| 18 "properties": { |
| 19 "code": {"type": "string", "optional": true, "description": "JavaScrip
t or CSS code to inject."}, |
| 20 "file": {"type": "string", "optional": true, "description": "JavaScrip
t or CSS file to inject."}, |
| 21 "allFrames": {"type": "boolean", "optional": true, "description": "If
allFrames is <code>true</code>, implies that the JavaScript or CSS should be inj
ected into all frames of current page. By default, it's <code>false</code> and w
ill only be injected into the top frame."}, |
| 22 "runAt": { |
| 23 "type": "string", |
| 24 "optional": true, |
| 25 "enum": ["document_start", "document_end", "document_idle"], |
| 26 "description": "The soonest that the JavaScript or CSS will be injec
ted into the tab. Defaults to \"document_idle\"." |
| 27 } |
| 28 } |
| 29 } |
| 30 ], |
| 31 "functions": [ |
| 32 { |
| 33 "name": "executeScript", |
| 34 "type": "function", |
| 35 "description": "Injects JavaScript code into a <webview> page.", |
| 36 "parameters": [ |
| 37 { |
| 38 "type": "integer", |
| 39 "name": "processId", |
| 40 "description": "The process ID of the guest <webview> process." |
| 41 }, |
| 42 { |
| 43 "type": "integer", |
| 44 "name": "routeId", |
| 45 "description": "The route ID of the guest <webview> renderer." |
| 46 }, |
| 47 { |
| 48 "$ref": "webview.InjectDetails", |
| 49 "name": "details", |
| 50 "description": "Details of the script to run." |
| 51 }, |
| 52 { |
| 53 "type": "function", |
| 54 "name": "callback", |
| 55 "optional": true, |
| 56 "description": "Called after all the JavaScript has been executed.", |
| 57 "parameters": [ |
| 58 { |
| 59 "name": "result", |
| 60 "optional": true, |
| 61 "type": "array", |
| 62 "items": {"type": "any", "minimum": 0}, |
| 63 "description": "The result of the script in every injected frame
." |
| 64 } |
| 65 ] |
| 66 } |
| 67 ] |
| 68 } |
| 69 ] |
| 70 } |
| 71 ] |
| 72 |
OLD | NEW |