OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [ | 5 [ |
6 { | 6 { |
7 "namespace": "webview", | 7 "namespace": "webview", |
8 "nodoc": true, | 8 "nodoc": true, |
9 "dependencies": [ "extension", "tabs" ], | 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": [ | 10 "functions": [ |
32 { | 11 { |
33 "name": "executeScript", | 12 "name": "executeScript", |
34 "type": "function", | 13 "type": "function", |
35 "description": "Injects JavaScript code into a <webview> page.", | 14 "description": "Injects JavaScript code into a <webview> page.", |
36 "parameters": [ | 15 "parameters": [ |
37 { | 16 { |
38 "type": "integer", | 17 "type": "integer", |
39 "name": "processId", | 18 "name": "processId", |
40 "description": "The process ID of the guest <webview> process." | 19 "description": "The process ID of the guest <webview> process." |
41 }, | 20 }, |
42 { | 21 { |
43 "type": "integer", | 22 "type": "integer", |
44 "name": "routeId", | 23 "name": "routeId", |
45 "description": "The route ID of the guest <webview> renderer." | 24 "description": "The route ID of the guest <webview> renderer." |
46 }, | 25 }, |
47 { | 26 { |
48 "$ref": "webview.InjectDetails", | 27 "$ref": "tabs.InjectDetails", |
49 "name": "details", | 28 "name": "details", |
50 "description": "Details of the script to run." | 29 "description": "Details of the script to run." |
51 }, | 30 }, |
52 { | 31 { |
53 "type": "function", | 32 "type": "function", |
54 "name": "callback", | 33 "name": "callback", |
55 "optional": true, | 34 "optional": true, |
56 "description": "Called after all the JavaScript has been executed.", | 35 "description": "Called after all the JavaScript has been executed.", |
57 "parameters": [ | 36 "parameters": [ |
58 { | 37 { |
59 "name": "result", | 38 "name": "result", |
60 "optional": true, | 39 "optional": true, |
61 "type": "array", | 40 "type": "array", |
62 "items": {"type": "any", "minimum": 0}, | 41 "items": {"type": "any", "minimum": 0}, |
63 "description": "The result of the script in every injected frame
." | 42 "description": "The result of the script in every injected frame
." |
64 } | 43 } |
65 ] | 44 ] |
66 } | 45 } |
67 ] | 46 ] |
68 } | 47 } |
69 ] | 48 ] |
70 } | 49 } |
71 ] | 50 ] |
72 | 51 |
OLD | NEW |