OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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": "experimental.offscreenTabs", | |
8 "types": [ | |
9 { | |
10 "id": "OffscreenTab", | |
11 "type": "object", | |
12 "properties": { | |
13 "id": { | |
14 "type": "integer", | |
15 "minimum": 0, | |
16 "description": "The ID of the offscreen tab. Tab IDs are unique with
in a browser session." | |
17 }, | |
18 "url": { | |
19 "type": | |
20 "string", | |
21 "description": "URL of the offscreen tab." | |
22 }, | |
23 "width": { | |
24 "type": "integer", | |
25 "minimum": 0, | |
26 "description": "Width of the window." | |
27 }, | |
28 "height": { | |
29 "type": "integer", | |
30 "minimum": 0, | |
31 "description": "Height of the window." | |
32 } | |
33 } | |
34 }, | |
35 { | |
36 "id": "MouseEvent", | |
37 "type": "object", | |
38 "properties": { | |
39 "type": { | |
40 "type": "string", | |
41 "enum": [ "mousedown", "mouseup", "click", "mousemove", "mousewheel"
] | |
42 }, | |
43 "button": { "type": "integer", "minimum": 0, "optional": true }, | |
44 "wheelDeltaX": { "type": "integer", "optional": true }, | |
45 "wheelDeltaY": { "type": "integer", "optional": true }, | |
46 "altKey": { "type": "boolean" }, | |
47 "ctrlKey": { "type": "boolean" }, | |
48 "shiftKey": { "type": "boolean" }, | |
49 "metaKey": { "type": "boolean", "optional": true } | |
50 } | |
51 }, | |
52 { | |
53 "id": "KeyboardEvent", | |
54 "type": "object", | |
55 "properties": { | |
56 "type": { | |
57 "type": "string", | |
58 "enum": [ "keypress", "keydown", "keyup" ] | |
59 }, | |
60 "charCode": { "type": "integer" }, | |
61 "keyCode": { "type": "integer" }, | |
62 "altKey": { "type": "boolean" }, | |
63 "ctrlKey": { "type": "boolean" }, | |
64 "shiftKey": { "type": "boolean" }, | |
65 "metaKey": { "type": "boolean", "optional": true } | |
66 } | |
67 } | |
68 ], | |
69 "functions": [ | |
70 { | |
71 "name": "create", | |
72 "type": "function", | |
73 "description": "Creates a new offscreen tab.", | |
74 "parameters": [ | |
75 { | |
76 "name": "createProperties", | |
77 "type": "object", | |
78 "properties": { | |
79 "url": { | |
80 "type": "string", | |
81 "description": "The URL to navigate the offscreen tab to initial
ly. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', no
t 'www.google.com'). Relative URLs will be relative to the current page within t
he extension. Note that you can't create offscreen tabs from background pages. T
he lifetime of the offscreen tab is tied to the context of its creator (tab, bro
wser action, etc.)." | |
82 }, | |
83 "width": { | |
84 "type": "integer", | |
85 "optional": true, | |
86 "minimum": 0, | |
87 "description": "Width of the offscreen tab. Defaults to width of
the current tab." | |
88 }, | |
89 "height": { | |
90 "type": "integer", | |
91 "optional": true, | |
92 "minimum": 0, | |
93 "description": "Height of the offscreen tab. Defaults to height
of the current tab." | |
94 } | |
95 } | |
96 }, | |
97 { | |
98 "name": "callback", | |
99 "type": "function", | |
100 "optional": true, | |
101 "parameters": [ | |
102 { | |
103 "name": "offscreenTab", | |
104 "$ref": "OffscreenTab", | |
105 "optional": true, | |
106 "description": "Details of the offscreen tab." | |
107 } | |
108 ] | |
109 } | |
110 ] | |
111 }, | |
112 { | |
113 "name": "get", | |
114 "type": "function", | |
115 "description": "Gets details about the specified offscreen tab.", | |
116 "parameters": [ | |
117 { | |
118 "name": "offscreenTabId", | |
119 "type": "integer", | |
120 "minimum": 0, | |
121 "description": "ID of the offscreen tab." | |
122 }, | |
123 { | |
124 "name": "callback", | |
125 "type": "function", | |
126 "parameters": [ | |
127 { | |
128 "name": "offscreenTab", | |
129 "$ref": "OffscreenTab", | |
130 "description": "Details of the offscreen tab." | |
131 } | |
132 ] | |
133 } | |
134 ] | |
135 }, | |
136 { | |
137 "name": "getAll", | |
138 "type": "function", | |
139 "description": "Gets an array of all offscreen tabs.", | |
140 "parameters": [ | |
141 { | |
142 "name": "callback", | |
143 "type": "function", | |
144 "parameters": [ | |
145 { | |
146 "name": "offscreenTabs", | |
147 "type": "array", | |
148 "items": { | |
149 "$ref": "OffscreenTab" | |
150 } | |
151 } | |
152 ] | |
153 } | |
154 ] | |
155 }, | |
156 { | |
157 "name": "remove", | |
158 "type": "function", | |
159 "description": "Removes an offscreen tab.", | |
160 "parameters": [ | |
161 { | |
162 "name": "offscreenTabId", | |
163 "type": "integer", | |
164 "minimum": 0, | |
165 "description": "ID of the offscreen tab." | |
166 }, | |
167 { | |
168 "name": "callback", | |
169 "type": "function", | |
170 "optional": true, | |
171 "parameters": [] | |
172 } | |
173 ] | |
174 }, | |
175 { | |
176 "name": "sendMouseEvent", | |
177 "type": "function", | |
178 "description": "Dispatches a mouse event in the offscreen tab.", | |
179 "parameters": [ | |
180 { | |
181 "name": "offscreenTabId", | |
182 "type": "integer", | |
183 "minimum": 0, | |
184 "description": "ID of the offscreen tab." | |
185 }, | |
186 { | |
187 "name": "mouseEvent", | |
188 "$ref": "MouseEvent", | |
189 "description": "A JavaScript MouseEvent object. Supported event type
s: <i>mousedown</i>, <i>mouseup</i>, <i>click</i>, <i>mousemove</i>, <i>mousewhe
el</i>." | |
190 }, | |
191 { | |
192 "name": "position", | |
193 "type": "object", | |
194 "optional": true, | |
195 "description": "The position where the mouse event should be dispatc
hed within the offscreen page. Not required for mousewheel events.", | |
196 "properties": { | |
197 "x": { "type": "integer", "minimum": 0 }, | |
198 "y": { "type": "integer", "minimum": 0 } | |
199 } | |
200 }, | |
201 { | |
202 "name": "callback", | |
203 "type": "function", | |
204 "optional": true, | |
205 "parameters": [] | |
206 } | |
207 ] | |
208 }, | |
209 { | |
210 "name": "sendKeyboardEvent", | |
211 "type": "function", | |
212 "description": "Dispatches a keyboard event in the offscreen tab.", | |
213 "parameters": [ | |
214 { | |
215 "name": "offscreenTabId", | |
216 "type": "integer", | |
217 "minimum": 0, | |
218 "description": "ID of the offscreen tab." | |
219 }, | |
220 { | |
221 "name": "keyboardEvent", | |
222 "$ref": "KeyboardEvent", | |
223 "description": "A JavaScript KeyboardEvent object. Supported event t
ypes: <i>keydown</i>, <i>keyup</i>, <i>keypress</i>. Note, only <i>keypress</i>
produces a visible result on screen." | |
224 }, | |
225 { | |
226 "name": "callback", | |
227 "type": "function", | |
228 "optional": true, | |
229 "parameters": [] | |
230 } | |
231 ] | |
232 }, | |
233 { | |
234 "name": "toDataUrl", | |
235 "type": "function", | |
236 "description": "Captures the visible area of an offscreen tab. ", | |
237 "parameters": [ | |
238 { | |
239 "name": "offscreenTabId", | |
240 "type": "integer", | |
241 "minimum": 0, | |
242 "description": "The ID of the offscreen tab." | |
243 }, | |
244 { | |
245 "name": "options", | |
246 "type": "object", | |
247 "optional": true, | |
248 "description": "Set parameters of image capture, such as the format
of the resulting image.", | |
249 "properties": { | |
250 "format": { | |
251 "type": "string", | |
252 "optional": true, | |
253 "enum": ["jpeg", "png"], | |
254 "description": "The format of the resulting image. Default is jp
eg." | |
255 }, | |
256 "quality": { | |
257 "type": "integer", | |
258 "optional": true, | |
259 "minimum": 0, | |
260 "maximum": 100, | |
261 "description": "When format is 'jpeg', controls the quality of t
he resulting image. This value is ignored for PNG images. As quality is decrease
d, the resulting image will have more visual artifacts, and the number of bytes
needed to store it will decrease." | |
262 } | |
263 } | |
264 }, | |
265 { | |
266 "name": "callback", | |
267 "type": "function", | |
268 "parameters": [ | |
269 { | |
270 "name": "dataUrl", | |
271 "type": "string", | |
272 "description": "A data URL which encodes an image of the visible
area of the captured offscreen tab. May be assigned to the 'src' property of an
HTML Image element or WebGL texture source for display." | |
273 } | |
274 ] | |
275 } | |
276 ] | |
277 }, | |
278 { | |
279 "name": "update", | |
280 "type": "function", | |
281 "description": "Modifies the properties of an offscreen tab. Properties
that are not specified in updateProperties are not modified.", | |
282 "parameters": [ | |
283 { | |
284 "name": "offscreenTabId", | |
285 "type": "integer", | |
286 "minimum": 0, | |
287 "description": "The ID of the offscreen tab." | |
288 }, | |
289 { | |
290 "name": "updateProperties", | |
291 "type": "object", | |
292 "properties": { | |
293 "url": { | |
294 "type": "string", | |
295 "optional": true, | |
296 "description": "The URL the offscreen tab is displaying." | |
297 }, | |
298 "width": { | |
299 "type": "integer", | |
300 "optional": true, | |
301 "minimum": 0, | |
302 "description": "Width of the window." | |
303 }, | |
304 "height": { | |
305 "type": "integer", | |
306 "optional": true, | |
307 "minimum": 0, | |
308 "description": "Height of the window." | |
309 } | |
310 } | |
311 }, | |
312 { | |
313 "name": "callback", | |
314 "type": "function", | |
315 "optional": true, | |
316 "parameters": [] | |
317 } | |
318 ] | |
319 } | |
320 ], | |
321 "events": [ | |
322 { | |
323 "name": "onUpdated", | |
324 "type": "function", | |
325 "description": "Fires when an offscreen tab is updated. ", | |
326 "parameters": [ | |
327 { | |
328 "name": "offscreenTabId", | |
329 "type": "integer", | |
330 "minimum": 0, | |
331 "description": "ID of the updated offscreen tab" | |
332 }, | |
333 { | |
334 "name": "changeInfo", | |
335 "type": "object", | |
336 "description": "Lists the changes to the state of the offscreen tab
that was updated.", | |
337 "properties": { | |
338 "url": { | |
339 "type": "string", | |
340 "optional": true, | |
341 "description": "The offscreen tab's URL if it has changed." | |
342 } | |
343 } | |
344 }, | |
345 { | |
346 "name": "offscreenTab", | |
347 "$ref": "OffscreenTab", | |
348 "description": "Details of the offscreen tab." | |
349 } | |
350 ] | |
351 } | |
352 ] | |
353 } | |
354 ] | |
OLD | NEW |