OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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": "tabs", | 7 "namespace": "tabs", |
8 "description": "Use the <code>chrome.tabs</code> API to interact with the br
owser's tab system. You can use this API to create, modify, and rearrange tabs i
n the browser.", | 8 "description": "Use the <code>chrome.tabs</code> API to interact with the br
owser's tab system. You can use this API to create, modify, and rearrange tabs i
n the browser.", |
9 "types": [ | 9 "types": [ |
10 { | 10 { |
(...skipping 13 matching lines...) Expand all Loading... |
24 "title": {"type": "string", "optional": true, "optional": true, "descr
iption": "The title of the tab. This property is only present if the extension's
manifest includes the <code>\"tabs\"</code> permission."}, | 24 "title": {"type": "string", "optional": true, "optional": true, "descr
iption": "The title of the tab. This property is only present if the extension's
manifest includes the <code>\"tabs\"</code> permission."}, |
25 "favIconUrl": {"type": "string", "optional": true, "optional": true, "
description": "The URL of the tab's favicon. This property is only present if th
e extension's manifest includes the <code>\"tabs\"</code> permission. It may als
o be an empty string if the tab is loading."}, | 25 "favIconUrl": {"type": "string", "optional": true, "optional": true, "
description": "The URL of the tab's favicon. This property is only present if th
e extension's manifest includes the <code>\"tabs\"</code> permission. It may als
o be an empty string if the tab is loading."}, |
26 "status": {"type": "string", "optional": true, "description": "Either
<em>loading</em> or <em>complete</em>."}, | 26 "status": {"type": "string", "optional": true, "description": "Either
<em>loading</em> or <em>complete</em>."}, |
27 "incognito": {"type": "boolean", "description": "Whether the tab is in
an incognito window."}, | 27 "incognito": {"type": "boolean", "description": "Whether the tab is in
an incognito window."}, |
28 "width": {"type": "integer", "optional": true, "description": "The wid
th of the tab in pixels."}, | 28 "width": {"type": "integer", "optional": true, "description": "The wid
th of the tab in pixels."}, |
29 "height": {"type": "integer", "optional": true, "description": "The he
ight of the tab in pixels."}, | 29 "height": {"type": "integer", "optional": true, "description": "The he
ight of the tab in pixels."}, |
30 "sessionId": {"type": "string", "optional": true, "description": "The
session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API
."} | 30 "sessionId": {"type": "string", "optional": true, "description": "The
session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API
."} |
31 } | 31 } |
32 }, | 32 }, |
33 { | 33 { |
| 34 "id": "ZoomSettingsMode", |
| 35 "type": "string", |
| 36 "description": "Defines how zoom changes are handled, i.e. which entity
is responsible for the actual scaling of the page; defaults to <code>automatic</
code>.", |
| 37 "enum": [ |
| 38 { |
| 39 "name": "automatic", |
| 40 "description": "Zoom changes are handled automatically by the browse
r." |
| 41 }, |
| 42 { |
| 43 "name": "manual", |
| 44 "description": "Overrides the automatic handling of zoom changes. Th
e <code>onZoomChange</code> event will still be dispatched, and it is the respon
sibility of the extension to listen for this event and manually scale the page.
This mode does not support <code>per-origin</code> zooming, and will thus ignore
the <code>scope</code> zoom setting and assume <code>per-tab</code>." |
| 45 }, |
| 46 { |
| 47 "name": "disabled", |
| 48 "description": "Disables all zooming in the tab. The tab will revert
to the default zoom level, and all attempted zoom changes will be ignored." |
| 49 } |
| 50 ] |
| 51 }, |
| 52 { |
| 53 "id": "ZoomSettingsScope", |
| 54 "type": "string", |
| 55 "description": "Defines whether zoom changes will persist for the page's
origin, or only take effect in this tab; defaults to <code>per-origin</code> wh
en in <code>automatic</code> mode, and <code>per-tab</code> otherwise.", |
| 56 "enum": [ |
| 57 { |
| 58 "name": "per-origin", |
| 59 "description": "Zoom changes will persist in the zoomed page's origi
n, i.e. all other tabs navigated to that same origin will be zoomed as well. Mor
eover, <code>per-origin</code> zoom changes are saved with the origin, meaning t
hat when navigating to other pages in the same origin, they will all be zoomed t
o the same zoom factor. The <code>per-origin</code> scope is only available in t
he <code>automatic</code> mode." |
| 60 }, |
| 61 { |
| 62 "name": "per-tab", |
| 63 "description": "Zoom changes only take effect in this tab, and zoom
changes in other tabs will not affect the zooming of this tab. Also, <code>per-t
ab</code> zoom changes are reset on navigation; navigating a tab will always loa
d pages with their <code>per-origin</code> zoom factors." |
| 64 } |
| 65 ] |
| 66 }, |
| 67 { |
34 "id": "ZoomSettings", | 68 "id": "ZoomSettings", |
35 "type": "object", | 69 "type": "object", |
36 "description": "Defines how zoom changes in a tab are handled and at wha
t scope.", | 70 "description": "Defines how zoom changes in a tab are handled and at wha
t scope.", |
37 "properties": { | 71 "properties": { |
38 "mode": { | 72 "mode": { |
39 "type": "string", | 73 "$ref": "ZoomSettingsMode", |
40 "description": "Defines how zoom changes are handled, i.e. which ent
ity is responsible for the actual scaling of the page; defaults to <code>automat
ic</code>.", | 74 "description": "Defines how zoom changes are handled, i.e. which ent
ity is responsible for the actual scaling of the page; defaults to <code>automat
ic</code>.", |
41 "optional": true, | 75 "optional": true |
42 "enum": [ | |
43 { | |
44 "name": "automatic", | |
45 "description": "Zoom changes are handled automatically by the br
owser." | |
46 }, | |
47 { | |
48 "name": "manual", | |
49 "description": "Overrides the automatic handling of zoom changes
. The <code>onZoomChange</code> event will still be dispatched, and it is the re
sponsibility of the extension to listen for this event and manually scale the pa
ge. This mode does not support <code>per-origin</code> zooming, and will thus ig
nore the <code>scope</code> zoom setting and assume <code>per-tab</code>." | |
50 }, | |
51 { | |
52 "name": "disabled", | |
53 "description": "Disables all zooming in the tab. The tab will re
vert to the default zoom level, and all attempted zoom changes will be ignored." | |
54 } | |
55 ] | |
56 }, | 76 }, |
57 "scope": { | 77 "scope": { |
58 "type": "string", | 78 "$ref": "ZoomSettingsScope", |
59 "description": "Defines whether zoom changes will persist for the pa
ge's origin, or only take effect in this tab; defaults to <code>per-origin</code
> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.", | 79 "description": "Defines whether zoom changes will persist for the pa
ge's origin, or only take effect in this tab; defaults to <code>per-origin</code
> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.", |
60 "optional": true, | 80 "optional": true |
61 "enum": [ | |
62 { | |
63 "name": "per-origin", | |
64 "description": "Zoom changes will persist in the zoomed page's o
rigin, i.e. all other tabs navigated to that same origin will be zoomed as well.
Moreover, <code>per-origin</code> zoom changes are saved with the origin, meani
ng that when navigating to other pages in the same origin, they will all be zoom
ed to the same zoom factor. The <code>per-origin</code> scope is only available
in the <code>automatic</code> mode." | |
65 }, | |
66 { | |
67 "name": "per-tab", | |
68 "description": "Zoom changes only take effect in this tab, and z
oom changes in other tabs will not affect the zooming of this tab. Also, <code>p
er-tab</code> zoom changes are reset on navigation; navigating a tab will always
load pages with their <code>per-origin</code> zoom factors." | |
69 } | |
70 ] | |
71 }, | 81 }, |
72 "default_zoom_factor": { | 82 "default_zoom_factor": { |
73 "type": "number", | 83 "type": "number", |
74 "name": "defaultZoomFactor", | 84 "name": "defaultZoomFactor", |
75 "optional": true, | 85 "optional": true, |
76 "description": "Used to return the default zoom level for the curren
t tab in calls to tabs.getZoomSettings." | 86 "description": "Used to return the default zoom level for the curren
t tab in calls to tabs.getZoomSettings." |
77 } | 87 } |
78 } | 88 } |
| 89 }, |
| 90 { |
| 91 "id": "TabStatus", |
| 92 "type": "string", |
| 93 "enum": ["loading", "complete"], |
| 94 "description": "Whether the tabs have completed loading." |
| 95 }, |
| 96 { |
| 97 "id": "WindowType", |
| 98 "type": "string", |
| 99 "enum": ["normal", "popup", "panel", "app"], |
| 100 "description": "The type of window." |
79 } | 101 } |
80 ], | 102 ], |
81 "functions": [ | 103 "functions": [ |
82 { | 104 { |
83 "name": "get", | 105 "name": "get", |
84 "type": "function", | 106 "type": "function", |
85 "description": "Retrieves details about the specified tab.", | 107 "description": "Retrieves details about the specified tab.", |
86 "parameters": [ | 108 "parameters": [ |
87 { | 109 { |
88 "type": "integer", | 110 "type": "integer", |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 "type": "boolean", | 403 "type": "boolean", |
382 "optional": true, | 404 "optional": true, |
383 "description": "Whether the tabs are in the <a href='windows#cur
rent-window'>current window</a>." | 405 "description": "Whether the tabs are in the <a href='windows#cur
rent-window'>current window</a>." |
384 }, | 406 }, |
385 "lastFocusedWindow": { | 407 "lastFocusedWindow": { |
386 "type": "boolean", | 408 "type": "boolean", |
387 "optional": true, | 409 "optional": true, |
388 "description": "Whether the tabs are in the last focused window.
" | 410 "description": "Whether the tabs are in the last focused window.
" |
389 }, | 411 }, |
390 "status": { | 412 "status": { |
391 "type": "string", | 413 "$ref": "TabStatus", |
392 "optional": true, | 414 "optional": true, |
393 "enum": ["loading", "complete"], | |
394 "description": "Whether the tabs have completed loading." | 415 "description": "Whether the tabs have completed loading." |
395 }, | 416 }, |
396 "title": { | 417 "title": { |
397 "type": "string", | 418 "type": "string", |
398 "optional": true, | 419 "optional": true, |
399 "description": "Match page titles against a pattern." | 420 "description": "Match page titles against a pattern." |
400 }, | 421 }, |
401 "url": { | 422 "url": { |
402 "choices": [ | 423 "choices": [ |
403 {"type": "string"}, | 424 {"type": "string"}, |
404 {"type": "array", "items": {"type": "string"}} | 425 {"type": "array", "items": {"type": "string"}} |
405 ], | 426 ], |
406 "optional": true, | 427 "optional": true, |
407 "description": "Match tabs against one or more <a href='match_pa
tterns'>URL patterns</a>. Note that fragment identifiers are not matched." | 428 "description": "Match tabs against one or more <a href='match_pa
tterns'>URL patterns</a>. Note that fragment identifiers are not matched." |
408 }, | 429 }, |
409 "windowId": { | 430 "windowId": { |
410 "type": "integer", | 431 "type": "integer", |
411 "optional": true, | 432 "optional": true, |
412 "minimum": -2, | 433 "minimum": -2, |
413 "description": "The ID of the parent window, or $(ref:windows.WI
NDOW_ID_CURRENT) for the <a href='windows#current-window'>current window</a>." | 434 "description": "The ID of the parent window, or $(ref:windows.WI
NDOW_ID_CURRENT) for the <a href='windows#current-window'>current window</a>." |
414 }, | 435 }, |
415 "windowType": { | 436 "windowType": { |
416 "type": "string", | 437 "$ref": "WindowType", |
417 "optional": true, | 438 "optional": true, |
418 "enum": ["normal", "popup", "panel", "app"], | |
419 "description": "The type of window the tabs are in." | 439 "description": "The type of window the tabs are in." |
420 }, | 440 }, |
421 "index": { | 441 "index": { |
422 "type": "integer", | 442 "type": "integer", |
423 "optional": true, | 443 "optional": true, |
424 "minimum": 0, | 444 "minimum": 0, |
425 "description": "The position of the tabs within their windows." | 445 "description": "The position of the tabs within their windows." |
426 } | 446 } |
427 } | 447 } |
428 }, | 448 }, |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 "tabId": {"type": "integer", "minimum": 0}, | 1108 "tabId": {"type": "integer", "minimum": 0}, |
1089 "oldZoomFactor": {"type": "number"}, | 1109 "oldZoomFactor": {"type": "number"}, |
1090 "newZoomFactor": {"type": "number"}, | 1110 "newZoomFactor": {"type": "number"}, |
1091 "zoomSettings": {"$ref": "ZoomSettings"} | 1111 "zoomSettings": {"$ref": "ZoomSettings"} |
1092 } | 1112 } |
1093 }] | 1113 }] |
1094 } | 1114 } |
1095 ] | 1115 ] |
1096 } | 1116 } |
1097 ] | 1117 ] |
OLD | NEW |