Revision control

Other Tools

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": "windows",
8
"description": "Use the <code>browser.windows</code> API to interact with Thunderbird. You can use this API to create, modify, and rearrange windows.",
9
"types": [
10
{
11
"id": "WindowType",
12
"type": "string",
13
"description": "The type of window this is. Under some circumstances a Window may not be assigned type property.",
14
"enum": ["normal", "popup", "panel", "app", "devtools"]
15
},
16
{
17
"id": "WindowState",
18
"type": "string",
19
"description": "The state of this window.",
20
"enum": ["normal", "minimized", "maximized", "fullscreen", "docked"]
21
},
22
{
23
"id": "Window",
24
"type": "object",
25
"properties": {
26
"id": {
27
"type": "integer",
28
"optional": true,
29
"minimum": 0,
30
"description": "The ID of the window. Window IDs are unique within a session."
31
},
32
"focused": {
33
"type": "boolean",
34
"description": "Whether the window is currently the focused window."
35
},
36
"top": {
37
"type": "integer",
38
"optional": true,
39
"description": "The offset of the window from the top edge of the screen in pixels."
40
},
41
"left": {
42
"type": "integer",
43
"optional": true,
44
"description": "The offset of the window from the left edge of the screen in pixels."
45
},
46
"width": {
47
"type": "integer",
48
"optional": true,
49
"description": "The width of the window, including the frame, in pixels."
50
},
51
"height": {
52
"type": "integer",
53
"optional": true,
54
"description": "The height of the window, including the frame, in pixels."
55
},
56
"tabs": {
57
"type": "array",
58
"items": { "$ref": "tabs.Tab" },
59
"optional": true,
60
"description": "Array of :ref:`tabs.Tab` objects representing the current tabs in the window."
61
},
62
"incognito": {
63
"type": "boolean",
64
"description": "Whether the window is incognito."
65
},
66
"type": {
67
"$ref": "WindowType",
68
"optional": true,
69
"description": "The type of browser window this is."
70
},
71
"state": {
72
"$ref": "WindowState",
73
"optional": true,
74
"description": "The state of this browser window."
75
},
76
"alwaysOnTop": {
77
"type": "boolean",
78
"description": "Whether the window is set to be always on top."
79
},
80
"title": {
81
"type": "string",
82
"optional": true,
83
"description": "The title of the window. Read-only."
84
}
85
}
86
},
87
{
88
"id": "CreateType",
89
"type": "string",
90
"description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.",
91
"enum": ["normal", "popup", "panel", "detached_panel"]
92
}
93
],
94
"properties": {
95
"WINDOW_ID_NONE": {
96
"value": -1,
97
"description": "The windowId value that represents the absence of a window."
98
},
99
"WINDOW_ID_CURRENT": {
100
"value": -2,
101
"description": "The windowId value that represents the current window."
102
}
103
},
104
"functions": [
105
{
106
"name": "get",
107
"type": "function",
108
"description": "Gets details about a window.",
109
"async": "callback",
110
"parameters": [
111
{
112
"type": "integer",
113
"name": "windowId",
114
"minimum": -2
115
},
116
{
117
"type": "object",
118
"name": "getInfo",
119
"optional": true,
120
"description": "",
121
"properties": {
122
"populate": {
123
"type": "boolean",
124
"optional": true,
125
"description": "If true, the :ref:`windows.Window` object will have a <var>tabs</var> property that contains a list of the :ref:`tabs.Tab` objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
126
},
127
"windowTypes": {
128
"type": "array",
129
"items": {
130
"$ref": "WindowType"
131
},
132
"optional": true,
133
"description": "If set, the :ref:`windows.Window` returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
134
}
135
}
136
},
137
{
138
"type": "function",
139
"name": "callback",
140
"parameters": [
141
{
142
"name": "window",
143
"$ref": "Window"
144
}
145
]
146
}
147
]
148
},
149
{
150
"name": "getCurrent",
151
"type": "function",
152
"description": "Gets the current window.",
153
"async": "callback",
154
"parameters": [
155
{
156
"type": "object",
157
"name": "getInfo",
158
"optional": true,
159
"description": "",
160
"properties": {
161
"populate": {
162
"type": "boolean",
163
"optional": true,
164
"description": "If true, the :ref:`windows.Window` object will have a <var>tabs</var> property that contains a list of the :ref:`tabs.Tab` objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
165
},
166
"windowTypes": {
167
"type": "array",
168
"items": { "$ref": "WindowType" },
169
"optional": true,
170
"description": "If set, the :ref:`windows.Window` returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
171
}
172
}
173
},
174
{
175
"type": "function",
176
"name": "callback",
177
"parameters": [
178
{
179
"name": "window",
180
"$ref": "Window"
181
}
182
]
183
}
184
]
185
},
186
{
187
"name": "getLastFocused",
188
"type": "function",
189
"description": "Gets the window that was most recently focused &mdash; typically the window 'on top'.",
190
"async": "callback",
191
"parameters": [
192
{
193
"type": "object",
194
"name": "getInfo",
195
"optional": true,
196
"description": "",
197
"properties": {
198
"populate": {
199
"type": "boolean",
200
"optional": true,
201
"description": "If true, the :ref:`windows.Window` object will have a <var>tabs</var> property that contains a list of the :ref:`tabs.Tab` objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
202
},
203
"windowTypes": {
204
"type": "array",
205
"items": { "$ref": "WindowType" },
206
"optional": true,
207
"description": "If set, the :ref:`windows.Window` returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
208
}
209
}
210
},
211
{
212
"type": "function",
213
"name": "callback",
214
"parameters": [
215
{
216
"name": "window",
217
"$ref": "Window"
218
}
219
]
220
}
221
]
222
},
223
{
224
"name": "getAll",
225
"type": "function",
226
"description": "Gets all windows.",
227
"async": "callback",
228
"parameters": [
229
{
230
"type": "object",
231
"name": "getInfo",
232
"optional": true,
233
"description": "",
234
"properties": {
235
"populate": {
236
"type": "boolean",
237
"optional": true,
238
"description": "If true, each :ref:`windows.Window` object will have a <var>tabs</var> property that contains a list of the :ref:`tabs.Tab` objects for that window. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
239
},
240
"windowTypes": {
241
"type": "array",
242
"items": { "$ref": "WindowType" },
243
"optional": true,
244
"description": "If set, the :ref:`windows.Window` returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
245
}
246
}
247
},
248
{
249
"type": "function",
250
"name": "callback",
251
"parameters": [
252
{
253
"name": "windows",
254
"type": "array",
255
"items": { "$ref": "Window" }
256
}
257
]
258
}
259
]
260
},
261
{
262
"name": "create",
263
"type": "function",
264
"description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.",
265
"async": "callback",
266
"parameters": [
267
{
268
"type": "object",
269
"name": "createData",
270
"optional": true,
271
"default": {},
272
"properties": {
273
"url": {
274
"description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
275
"optional": true,
276
"choices": [
277
{ "type": "string", "format": "relativeUrl" },
278
{
279
"type": "array",
280
"items": { "type": "string", "format": "relativeUrl" }
281
}
282
]
283
},
284
"tabId": {
285
"type": "integer",
286
"minimum": 0,
287
"optional": true,
288
"description": "The id of the tab for which you want to adopt to the new window."
289
},
290
"left": {
291
"type": "integer",
292
"optional": true,
293
"description": "The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."
294
},
295
"top": {
296
"type": "integer",
297
"optional": true,
298
"description": "The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."
299
},
300
"width": {
301
"type": "integer",
302
"minimum": 0,
303
"optional": true,
304
"description": "The width in pixels of the new window, including the frame. If not specified defaults to a natural width."
305
},
306
"height": {
307
"type": "integer",
308
"minimum": 0,
309
"optional": true,
310
"description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height."
311
},
312
"focused": {
313
"unsupported": true,
314
"type": "boolean",
315
"optional": true,
316
"description": "If true, opens an active window. If false, opens an inactive window."
317
},
318
"incognito": {
319
"type": "boolean",
320
"optional": true,
321
"description": "Whether the new window should be an incognito window."
322
},
323
"type": {
324
"$ref": "CreateType",
325
"optional": true,
326
"description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set."
327
},
328
"state": {
329
"$ref": "WindowState",
330
"optional": true,
331
"description": "The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
332
},
333
"allowScriptsToClose": {
334
"type": "boolean",
335
"optional": true,
336
"description": "Allow scripts to close the window."
337
},
338
"titlePreface": {
339
"type": "string",
340
"optional": true,
341
"description": "A string to add to the beginning of the window title."
342
}
343
},
344
"optional": true
345
},
346
{
347
"type": "function",
348
"name": "callback",
349
"optional": true,
350
"parameters": [
351
{
352
"name": "window",
353
"$ref": "Window",
354
"description": "Contains details about the created window.",
355
"optional": true
356
}
357
]
358
}
359
]
360
},
361
{
362
"name": "update",
363
"type": "function",
364
"description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.",
365
"async": "callback",
366
"parameters": [
367
{
368
"type": "integer",
369
"name": "windowId",
370
"minimum": -2
371
},
372
{
373
"type": "object",
374
"name": "updateInfo",
375
"properties": {
376
"left": {
377
"type": "integer",
378
"optional": true,
379
"description": "The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels."
380
},
381
"top": {
382
"type": "integer",
383
"optional": true,
384
"description": "The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels."
385
},
386
"width": {
387
"type": "integer",
388
"minimum": 0,
389
"optional": true,
390
"description": "The width to resize the window to in pixels. This value is ignored for panels."
391
},
392
"height": {
393
"type": "integer",
394
"minimum": 0,
395
"optional": true,
396
"description": "The height to resize the window to in pixels. This value is ignored for panels."
397
},
398
"focused": {
399
"type": "boolean",
400
"optional": true,
401
"description": "If true, brings the window to the front. If false, brings the next window in the z-order to the front."
402
},
403
"drawAttention": {
404
"type": "boolean",
405
"optional": true,
406
"description": "If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request."
407
},
408
"state": {
409
"$ref": "WindowState",
410
"optional": true,
411
"description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
412
},
413
"titlePreface": {
414
"type": "string",
415
"optional": true,
416
"description": "A string to add to the beginning of the window title."
417
}
418
}
419
},
420
{
421
"type": "function",
422
"name": "callback",
423
"optional": true,
424
"parameters": [
425
{
426
"name": "window",
427
"$ref": "Window"
428
}
429
]
430
}
431
]
432
},
433
{
434
"name": "remove",
435
"type": "function",
436
"description": "Removes (closes) a window, and all the tabs inside it.",
437
"async": "callback",
438
"parameters": [
439
{
440
"type": "integer",
441
"name": "windowId",
442
"minimum": 0
443
},
444
{
445
"type": "function",
446
"name": "callback",
447
"optional": true,
448
"parameters": []
449
}
450
]
451
}
452
],
453
"events": [
454
{
455
"name": "onCreated",
456
"type": "function",
457
"description": "Fired when a window is created.",
458
"filters": [
459
{
460
"name": "windowTypes",
461
"type": "array",
462
"items": { "$ref": "WindowType" },
463
"description": "Conditions that the window's type being created must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
464
}
465
],
466
"parameters": [
467
{
468
"$ref": "Window",
469
"name": "window",
470
"description": "Details of the window that was created."
471
}
472
]
473
},
474
{
475
"name": "onRemoved",
476
"type": "function",
477
"description": "Fired when a window is removed (closed).",
478
"filters": [
479
{
480
"name": "windowTypes",
481
"type": "array",
482
"items": { "$ref": "WindowType" },
483
"description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
484
}
485
],
486
"parameters": [
487
{
488
"type": "integer",
489
"name": "windowId",
490
"minimum": 0,
491
"description": "ID of the removed window."
492
}
493
]
494
},
495
{
496
"name": "onFocusChanged",
497
"type": "function",
498
"description": "Fired when the currently focused window changes. Will be :ref:`windows.WINDOW_ID_NONE`) if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one browser window to another.",
499
"filters": [
500
{
501
"name": "windowTypes",
502
"type": "array",
503
"items": { "$ref": "WindowType" },
504
"description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
505
}
506
],
507
"parameters": [
508
{
509
"type": "integer",
510
"name": "windowId",
511
"minimum": -1,
512
"description": "ID of the newly focused window."
513
}
514
]
515
}
516
]
517
}
518
]