Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: chrome/common/extensions/api/tabs.json

Issue 10025007: Convert tabs, windows, and extension APIs to feature system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blah Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "dependencies": [ "extension", "windows" ], 8 "uses_feature_system": true,
9 "extension_types": ["extension", "packaged_app", "platform_app"],
10 // unblessed_extension and content_script are required because this module
11 // is needed by extension.json.
12 "contexts": ["blessed_extension", "unblessed_extension", "content_script"],
13 "dependencies": ["api:windows", "api:extension"],
9 "types": [ 14 "types": [
10 { 15 {
11 "id": "Tab", 16 "id": "Tab",
12 "type": "object", 17 "type": "object",
13 "properties": { 18 "properties": {
14 "id": {"type": "integer", "minimum": 0, "description": "The ID of the tab. Tab IDs are unique within a browser session."}, 19 "id": {"type": "integer", "minimum": 0, "description": "The ID of the tab. Tab IDs are unique within a browser session."},
15 "index": {"type": "integer", "minimum": 0, "description": "The zero-ba sed index of the tab within its window."}, 20 "index": {"type": "integer", "minimum": 0, "description": "The zero-ba sed index of the tab within its window."},
16 "windowId": {"type": "integer", "minimum": 0, "description": "The ID o f the window the tab is contained within."}, 21 "windowId": {"type": "integer", "minimum": 0, "description": "The ID o f the window the tab is contained within."},
17 "openerTabId": {"type": "integer", "minimum": 0, "optional": true, "de scription": "The ID of the tab that opened this tab, if any. This will only be p resent if the opener tab still exists."}, 22 "openerTabId": {"type": "integer", "minimum": 0, "optional": true, "de scription": "The ID of the tab that opened this tab, if any. This will only be p resent if the opener tab still exists."},
18 "selected": {"type": "boolean", "description": "Whether the tab is sel ected.", "nodoc": true}, 23 "selected": {"type": "boolean", "description": "Whether the tab is sel ected.", "nodoc": true},
19 "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."}, 24 "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."},
20 "active": {"type": "boolean", "description": "Whether the tab is activ e in its window."}, 25 "active": {"type": "boolean", "description": "Whether the tab is activ e in its window."},
21 "pinned": {"type": "boolean", "description": "Whether the tab is pinne d."}, 26 "pinned": {"type": "boolean", "description": "Whether the tab is pinne d."},
22 "url": {"type": "string", "description": "The URL the tab is displayin g."}, 27 "url": {"type": "string", "description": "The URL the tab is displayin g."},
23 "title": {"type": "string", "optional": true, "description": "The titl e of the tab. This may not be available if the tab is loading."}, 28 "title": {"type": "string", "optional": true, "description": "The titl e of the tab. This may not be available if the tab is loading."},
24 "favIconUrl": {"type": "string", "optional": true, "description": "The URL of the tab's favicon. This may not be available if the tab is loading."}, 29 "favIconUrl": {"type": "string", "optional": true, "description": "The URL of the tab's favicon. This may not be available if the tab is loading."},
25 "status": {"type": "string", "optional": true, "description": "Either <em>loading</em> or <em>complete</em>."}, 30 "status": {"type": "string", "optional": true, "description": "Either <em>loading</em> or <em>complete</em>."},
26 "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."} 31 "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."}
27 } 32 }
28 } 33 }
29 ], 34 ],
30 "functions": [ 35 "functions": [
31 { 36 {
32 "name": "get", 37 "name": "get",
38 "contexts": ["blessed_extension"],
39 "dependencies": ["permission:tabs"],
33 "type": "function", 40 "type": "function",
34 "description": "Retrieves details about the specified tab.", 41 "description": "Retrieves details about the specified tab.",
35 "parameters": [ 42 "parameters": [
36 { 43 {
37 "type": "integer", 44 "type": "integer",
38 "name": "tabId", 45 "name": "tabId",
39 "minimum": 0 46 "minimum": 0
40 }, 47 },
41 { 48 {
42 "type": "function", 49 "type": "function",
43 "name": "callback", 50 "name": "callback",
44 "parameters": [ 51 "parameters": [
45 {"name": "tab", "$ref": "Tab"} 52 {"name": "tab", "$ref": "Tab"}
46 ] 53 ]
47 } 54 }
48 ] 55 ]
49 }, 56 },
50 { 57 {
51 "name": "getCurrent", 58 "name": "getCurrent",
59 "contexts": ["blessed_extension"],
60 "dependencies": ["permission:tabs"],
52 "type": "function", 61 "type": "function",
53 "description": "Gets the tab that this script call is being made from. M ay be undefined if called from a non-tab context (for example: a background page or popup view).", 62 "description": "Gets the tab that this script call is being made from. M ay be undefined if called from a non-tab context (for example: a background page or popup view).",
54 "parameters": [ 63 "parameters": [
55 { 64 {
56 "type": "function", 65 "type": "function",
57 "name": "callback", 66 "name": "callback",
58 "parameters": [ 67 "parameters": [
59 { 68 {
60 "name": "tab", 69 "name": "tab",
61 "$ref": "Tab", 70 "$ref": "Tab",
62 "optional": true 71 "optional": true
63 } 72 }
64 ] 73 ]
65 } 74 }
66 ] 75 ]
67 }, 76 },
68 { 77 {
69 "name": "connect", 78 "name": "connect",
79 "contexts": ["blessed_extension"],
70 "nocompile": true, 80 "nocompile": true,
71 "type": "function", 81 "type": "function",
72 "description": "Connects to the content script(s) in the specified tab. The <a href='extension.html#event-onConnect'>chrome.extension.onConnect</a> even t is fired in each content script running in the specified tab for the current e xtension. For more details, see <a href='content_scripts.html#messaging'>Content Script Messaging</a>.", 82 "description": "Connects to the content script(s) in the specified tab. The <a href='extension.html#event-onConnect'>chrome.extension.onConnect</a> even t is fired in each content script running in the specified tab for the current e xtension. For more details, see <a href='content_scripts.html#messaging'>Content Script Messaging</a>.",
73 "parameters": [ 83 "parameters": [
74 { 84 {
75 "type": "integer", 85 "type": "integer",
76 "name": "tabId", 86 "name": "tabId",
77 "minimum": 0 87 "minimum": 0
78 }, 88 },
79 { 89 {
80 "type": "object", 90 "type": "object",
81 "name": "connectInfo", 91 "name": "connectInfo",
82 "properties": { 92 "properties": {
83 "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connect ion event." } 93 "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connect ion event." }
84 }, 94 },
85 "optional": true 95 "optional": true
86 } 96 }
87 ], 97 ],
88 "returns": { 98 "returns": {
89 "$ref": "Port", 99 "$ref": "Port",
90 "description": "A port that can be used to communicate with the conten t scripts running in the specified tab. The port's <a href='extension.html#type- Port'>onDisconnect</a> event is fired if the tab closes or does not exist. " 100 "description": "A port that can be used to communicate with the conten t scripts running in the specified tab. The port's <a href='extension.html#type- Port'>onDisconnect</a> event is fired if the tab closes or does not exist. "
91 } 101 }
92 }, 102 },
93 { 103 {
94 "name": "sendRequest", 104 "name": "sendRequest",
105 "contexts": ["blessed_extension"],
95 "nodoc": true, 106 "nodoc": true,
96 "nocompile": true, 107 "nocompile": true,
97 "type": "function", 108 "type": "function",
98 "description": "Deprecated: Please use sendMessage.", 109 "description": "Deprecated: Please use sendMessage.",
99 "parameters": [ 110 "parameters": [
100 { 111 {
101 "type": "integer", 112 "type": "integer",
102 "name": "tabId", 113 "name": "tabId",
103 "minimum": 0 114 "minimum": 0
104 }, 115 },
(...skipping 10 matching lines...) Expand all
115 "name": "response", 126 "name": "response",
116 "type": "any", 127 "type": "any",
117 "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callb ack will be called with no arguments and <a href='extension.html#property-lastEr ror'>chrome.extension.lastError</a> will be set to the error message." 128 "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callb ack will be called with no arguments and <a href='extension.html#property-lastEr ror'>chrome.extension.lastError</a> will be set to the error message."
118 } 129 }
119 ] 130 ]
120 } 131 }
121 ] 132 ]
122 }, 133 },
123 { 134 {
124 "name": "sendMessage", 135 "name": "sendMessage",
136 "contexts": ["blessed_extension"],
125 "nocompile": true, 137 "nocompile": true,
126 "type": "function", 138 "type": "function",
127 "description": "Sends a single message to the content script(s) in the s pecified tab, with an optional callback to run when a response is sent back. Th e <a href='extension.html#event-onMessage'>chrome.extension.onMessage</a> event is fired in each content script running in the specified tab for the current ext ension.", 139 "description": "Sends a single message to the content script(s) in the s pecified tab, with an optional callback to run when a response is sent back. Th e <a href='extension.html#event-onMessage'>chrome.extension.onMessage</a> event is fired in each content script running in the specified tab for the current ext ension.",
128 "parameters": [ 140 "parameters": [
129 { 141 {
130 "type": "integer", 142 "type": "integer",
131 "name": "tabId", 143 "name": "tabId",
132 "minimum": 0 144 "minimum": 0
133 }, 145 },
134 { 146 {
135 "type": "any", 147 "type": "any",
136 "name": "message" 148 "name": "message"
137 }, 149 },
138 { 150 {
139 "type": "function", 151 "type": "function",
140 "name": "responseCallback", 152 "name": "responseCallback",
141 "optional": true, 153 "optional": true,
142 "parameters": [ 154 "parameters": [
143 { 155 {
144 "name": "response", 156 "name": "response",
145 "type": "any", 157 "type": "any",
146 "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callb ack will be called with no arguments and <a href='extension.html#property-lastEr ror'>chrome.extension.lastError</a> will be set to the error message." 158 "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callb ack will be called with no arguments and <a href='extension.html#property-lastEr ror'>chrome.extension.lastError</a> will be set to the error message."
147 } 159 }
148 ] 160 ]
149 } 161 }
150 ] 162 ]
151 }, 163 },
152 { 164 {
153 "name": "getSelected", 165 "name": "getSelected",
166 "contexts": ["blessed_extension"],
167 "dependencies": ["permission:tabs"],
154 "nodoc": true, 168 "nodoc": true,
155 "type": "function", 169 "type": "function",
156 "description": "Deprecated. Please use query({'active': true}). Gets the tab that is selected in the specified window.", 170 "description": "Deprecated. Please use query({'active': true}). Gets the tab that is selected in the specified window.",
157 "parameters": [ 171 "parameters": [
158 { 172 {
159 "type": "integer", 173 "type": "integer",
160 "name": "windowId", 174 "name": "windowId",
161 "minimum": -2, 175 "minimum": -2,
162 "optional": true, 176 "optional": true,
163 "description": "Defaults to the <a href='windows.html#current-window '>current window</a>." 177 "description": "Defaults to the <a href='windows.html#current-window '>current window</a>."
164 }, 178 },
165 { 179 {
166 "type": "function", 180 "type": "function",
167 "name": "callback", 181 "name": "callback",
168 "parameters": [ 182 "parameters": [
169 {"name": "tab", "$ref": "Tab"} 183 {"name": "tab", "$ref": "Tab"}
170 ] 184 ]
171 } 185 }
172 ] 186 ]
173 }, 187 },
174 { 188 {
175 "name": "getAllInWindow", 189 "name": "getAllInWindow",
190 "contexts": ["blessed_extension"],
191 "dependencies": ["permission:tabs"],
176 "type": "function", 192 "type": "function",
177 "nodoc": true, 193 "nodoc": true,
178 "description": "Deprecated. Please use query({'windowId': windowId}). Ge ts details about all tabs in the specified window.", 194 "description": "Deprecated. Please use query({'windowId': windowId}). Ge ts details about all tabs in the specified window.",
179 "parameters": [ 195 "parameters": [
180 { 196 {
181 "type": "integer", 197 "type": "integer",
182 "name": "windowId", 198 "name": "windowId",
183 "minimum": -2, 199 "minimum": -2,
184 "optional": true, 200 "optional": true,
185 "description": "Defaults to the <a href='windows.html#current-window '>current window</a>." 201 "description": "Defaults to the <a href='windows.html#current-window '>current window</a>."
186 }, 202 },
187 { 203 {
188 "type": "function", 204 "type": "function",
189 "name": "callback", 205 "name": "callback",
190 "parameters": [ 206 "parameters": [
191 {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } } 207 {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } }
192 ] 208 ]
193 } 209 }
194 ] 210 ]
195 }, 211 },
196 { 212 {
197 "name": "create", 213 "name": "create",
214 "contexts": ["blessed_extension"],
198 "type": "function", 215 "type": "function",
199 "description": "Creates a new tab. Note: This function can be used witho ut requesting the 'tabs' permission in the manifest.", 216 "description": "Creates a new tab. Note: This function can be used witho ut requesting the 'tabs' permission in the manifest.",
200 "parameters": [ 217 "parameters": [
201 { 218 {
202 "type": "object", 219 "type": "object",
203 "name": "createProperties", 220 "name": "createProperties",
204 "properties": { 221 "properties": {
205 "windowId": { 222 "windowId": {
206 "type": "integer", 223 "type": "integer",
207 "minimum": -2, 224 "minimum": -2,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 "name": "tab", 269 "name": "tab",
253 "$ref": "Tab", 270 "$ref": "Tab",
254 "description": "Details about the created tab. Will contain the ID of the new tab." 271 "description": "Details about the created tab. Will contain the ID of the new tab."
255 } 272 }
256 ] 273 ]
257 } 274 }
258 ] 275 ]
259 }, 276 },
260 { 277 {
261 "name": "query", 278 "name": "query",
279 "contexts": ["blessed_extension"],
280 "dependencies": ["permission:tabs"],
262 "type": "function", 281 "type": "function",
263 "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.", 282 "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
264 "parameters": [ 283 "parameters": [
265 { 284 {
266 "type": "object", 285 "type": "object",
267 "name": "queryInfo", 286 "name": "queryInfo",
268 "properties": { 287 "properties": {
269 "active": { 288 "active": {
270 "type": "boolean", 289 "type": "boolean",
271 "optional": true, 290 "optional": true,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 "items": { 356 "items": {
338 "$ref": "Tab" 357 "$ref": "Tab"
339 } 358 }
340 } 359 }
341 ] 360 ]
342 } 361 }
343 ] 362 ]
344 }, 363 },
345 { 364 {
346 "name": "highlight", 365 "name": "highlight",
366 "contexts": ["blessed_extension"],
367 "dependencies": ["permission:tabs"],
347 "type": "function", 368 "type": "function",
348 "description": "Highlights the given tabs.", 369 "description": "Highlights the given tabs.",
349 "parameters": [ 370 "parameters": [
350 { 371 {
351 "type": "object", 372 "type": "object",
352 "name": "highlightInfo", 373 "name": "highlightInfo",
353 "properties": { 374 "properties": {
354 "windowId": { 375 "windowId": {
355 "type": "integer", 376 "type": "integer",
356 "description": "The window that contains the tabs.", 377 "description": "The window that contains the tabs.",
(...skipping 16 matching lines...) Expand all
373 "name": "window", 394 "name": "window",
374 "$ref": "Window", 395 "$ref": "Window",
375 "description": "Contains details about the window whose tabs we re highlighted." 396 "description": "Contains details about the window whose tabs we re highlighted."
376 } 397 }
377 ] 398 ]
378 } 399 }
379 ] 400 ]
380 }, 401 },
381 { 402 {
382 "name": "update", 403 "name": "update",
404 "contexts": ["blessed_extension"],
383 "type": "function", 405 "type": "function",
384 "description": "Modifies the properties of a tab. Properties that are no t specified in <var>updateProperties</var> are not modified. Note: This function can be used without requesting the 'tabs' permission in the manifest.", 406 "description": "Modifies the properties of a tab. Properties that are no t specified in <var>updateProperties</var> are not modified. Note: This function can be used without requesting the 'tabs' permission in the manifest.",
385 "parameters": [ 407 "parameters": [
386 { 408 {
387 "type": "integer", 409 "type": "integer",
388 "name": "tabId", 410 "name": "tabId",
389 "minimum": 0, 411 "minimum": 0,
390 "optional": true, 412 "optional": true,
391 "description": "Defaults to the selected tab of the <a href='windows .html#current-window'>current window</a>." 413 "description": "Defaults to the selected tab of the <a href='windows .html#current-window'>current window</a>."
392 }, 414 },
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 "$ref": "Tab", 460 "$ref": "Tab",
439 "optional": true, 461 "optional": true,
440 "description": "Details about the updated tab, or <code>null</co de> if the 'tabs' permission has not been requested." 462 "description": "Details about the updated tab, or <code>null</co de> if the 'tabs' permission has not been requested."
441 } 463 }
442 ] 464 ]
443 } 465 }
444 ] 466 ]
445 }, 467 },
446 { 468 {
447 "name": "move", 469 "name": "move",
470 "contexts": ["blessed_extension"],
471 "dependencies": ["permission:tabs"],
448 "type": "function", 472 "type": "function",
449 "description": "Moves one or more tabs to a new position within its wind ow, or to a new window. Note that tabs can only be moved to and from normal (win dow.type === \"normal\") windows.", 473 "description": "Moves one or more tabs to a new position within its wind ow, or to a new window. Note that tabs can only be moved to and from normal (win dow.type === \"normal\") windows.",
450 "parameters": [ 474 "parameters": [
451 { 475 {
452 "name": "tabIds", 476 "name": "tabIds",
453 "description": "The tab or list of tabs to move.", 477 "description": "The tab or list of tabs to move.",
454 "choices": [ 478 "choices": [
455 {"type": "integer", "minimum": 0}, 479 {"type": "integer", "minimum": 0},
456 {"type": "array", "items": {"type": "integer", "minimum": 0}} 480 {"type": "array", "items": {"type": "integer", "minimum": 0}}
457 ] 481 ]
(...skipping 27 matching lines...) Expand all
485 {"$ref": "Tab"}, 509 {"$ref": "Tab"},
486 {"type": "array", "items": {"$ref": "Tab"}} 510 {"type": "array", "items": {"$ref": "Tab"}}
487 ] 511 ]
488 } 512 }
489 ] 513 ]
490 } 514 }
491 ] 515 ]
492 }, 516 },
493 { 517 {
494 "name": "reload", 518 "name": "reload",
519 "contexts": ["blessed_extension"],
520 "dependencies": ["permission:tabs"],
495 "type": "function", 521 "type": "function",
496 "description": "Reload a tab.", 522 "description": "Reload a tab.",
497 "parameters": [ 523 "parameters": [
498 {"type": "integer", "name": "tabId", "optional": true, "description": "The ID of the tab to reload; defaults to the selected tab of the current window ."}, 524 {"type": "integer", "name": "tabId", "optional": true, "description": "The ID of the tab to reload; defaults to the selected tab of the current window ."},
499 { 525 {
500 "type": "object", 526 "type": "object",
501 "name": "reloadProperties", 527 "name": "reloadProperties",
502 "optional": true, 528 "optional": true,
503 "properties": { 529 "properties": {
504 "bypassCache": { 530 "bypassCache": {
(...skipping 17 matching lines...) Expand all
522 "choices": [ 548 "choices": [
523 {"type": "integer", "minimum": 0}, 549 {"type": "integer", "minimum": 0},
524 {"type": "array", "items": {"type": "integer", "minimum": 0}} 550 {"type": "array", "items": {"type": "integer", "minimum": 0}}
525 ] 551 ]
526 }, 552 },
527 {"type": "function", "name": "callback", "optional": true, "parameters ": []} 553 {"type": "function", "name": "callback", "optional": true, "parameters ": []}
528 ] 554 ]
529 }, 555 },
530 { 556 {
531 "name": "detectLanguage", 557 "name": "detectLanguage",
558 "contexts": ["blessed_extension"],
559 "dependencies": ["permission:tabs"],
532 "type": "function", 560 "type": "function",
533 "description": "Detects the primary language of the content in a tab.", 561 "description": "Detects the primary language of the content in a tab.",
534 "parameters": [ 562 "parameters": [
535 { 563 {
536 "type": "integer", 564 "type": "integer",
537 "name": "tabId", 565 "name": "tabId",
538 "minimum": 0, 566 "minimum": 0,
539 "optional": true, 567 "optional": true,
540 "description": "Defaults to the active tab of the <a href='windows.h tml#current-window'>current window</a>." 568 "description": "Defaults to the active tab of the <a href='windows.h tml#current-window'>current window</a>."
541 }, 569 },
542 { 570 {
543 "type": "function", 571 "type": "function",
544 "name": "callback", 572 "name": "callback",
545 "parameters": [ 573 "parameters": [
546 { 574 {
547 "type": "string", 575 "type": "string",
548 "name": "language", 576 "name": "language",
549 "description": "An ISO language code such as <code>en</code> or <code>fr</code>. For a complete list of languages supported by this method, see <a href='http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languag es/internal/languages.cc'>kLanguageInfoTable</a>. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chi nese for which zh-CN will be returned. For an unknown language, <code>und</code> will be returned." 577 "description": "An ISO language code such as <code>en</code> or <code>fr</code>. For a complete list of languages supported by this method, see <a href='http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languag es/internal/languages.cc'>kLanguageInfoTable</a>. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chi nese for which zh-CN will be returned. For an unknown language, <code>und</code> will be returned."
550 } 578 }
551 ] 579 ]
552 } 580 }
553 ] 581 ]
554 }, 582 },
555 { 583 {
556 "name": "captureVisibleTab", 584 "name": "captureVisibleTab",
585 "contexts": ["blessed_extension"],
586 "dependencies": ["permission:tabs"],
557 "type": "function", 587 "type": "function",
558 "description": "Captures the visible area of the currently active tab in the specified window. You must have <a href='manifest.html#permissions'>host pe rmission</a> for the URL displayed by the tab.", 588 "description": "Captures the visible area of the currently active tab in the specified window. You must have <a href='manifest.html#permissions'>host pe rmission</a> for the URL displayed by the tab.",
559 "parameters": [ 589 "parameters": [
560 { 590 {
561 "type": "integer", 591 "type": "integer",
562 "name": "windowId", 592 "name": "windowId",
563 "minimum": -2, 593 "minimum": -2,
564 "optional": true, 594 "optional": true,
565 "description": "The target window. Defaults to the <a href='windows. html#current-window'>current window</a>." 595 "description": "The target window. Defaults to the <a href='windows. html#current-window'>current window</a>."
566 }, 596 },
(...skipping 20 matching lines...) Expand all
587 }, 617 },
588 { 618 {
589 "type": "function", "name": "callback", "parameters": [ 619 "type": "function", "name": "callback", "parameters": [
590 {"type": "string", "name": "dataUrl", "description": "A data URL w hich encodes an image of the visible area of the captured tab. May be assigned t o the 'src' property of an HTML Image element for display."} 620 {"type": "string", "name": "dataUrl", "description": "A data URL w hich encodes an image of the visible area of the captured tab. May be assigned t o the 'src' property of an HTML Image element for display."}
591 ] 621 ]
592 } 622 }
593 ] 623 ]
594 }, 624 },
595 { 625 {
596 "name": "executeScript", 626 "name": "executeScript",
627 "contexts": ["blessed_extension"],
628 "dependencies": ["permission:tabs"],
597 "type": "function", 629 "type": "function",
598 "description": "Injects JavaScript code into a page. For details, see th e <a href='content_scripts.html#pi'>programmatic injection</a> section of the co ntent scripts doc.", 630 "description": "Injects JavaScript code into a page. For details, see th e <a href='content_scripts.html#pi'>programmatic injection</a> section of the co ntent scripts doc.",
599 "parameters": [ 631 "parameters": [
600 {"type": "integer", "name": "tabId", "optional": true, "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."}, 632 {"type": "integer", "name": "tabId", "optional": true, "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."},
601 { 633 {
602 "type": "object", 634 "type": "object",
603 "name": "details", 635 "name": "details",
604 "description": "Details of the script to run. Either the code or the file property must be set, but both may not be set at the same time.", 636 "description": "Details of the script to run. Either the code or the file property must be set, but both may not be set at the same time.",
605 "properties": { 637 "properties": {
606 "code": {"type": "string", "optional": true, "description": "JavaS cript code to execute."}, 638 "code": {"type": "string", "optional": true, "description": "JavaS cript code to execute."},
607 "file": {"type": "string", "optional": true, "description": "JavaS cript file to execute."}, 639 "file": {"type": "string", "optional": true, "description": "JavaS cript file to execute."},
608 "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is true, this function injects script into all frames of current p age. By default, it's false and script is injected only into the top main frame. "} 640 "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is true, this function injects script into all frames of current p age. By default, it's false and script is injected only into the top main frame. "}
609 } 641 }
610 }, 642 },
611 { 643 {
612 "type": "function", 644 "type": "function",
613 "name": "callback", 645 "name": "callback",
614 "optional": true, 646 "optional": true,
615 "description": "Called after all the JavaScript has been executed.", 647 "description": "Called after all the JavaScript has been executed.",
616 "parameters": [] 648 "parameters": []
617 } 649 }
618 ] 650 ]
619 }, 651 },
620 { 652 {
621 "name": "insertCSS", 653 "name": "insertCSS",
654 "contexts": ["blessed_extension"],
655 "dependencies": ["permission:tabs"],
622 "type": "function", 656 "type": "function",
623 "description": "Injects CSS into a page. For details, see the <a href='c ontent_scripts.html#pi'>programmatic injection</a> section of the content script s doc.", 657 "description": "Injects CSS into a page. For details, see the <a href='c ontent_scripts.html#pi'>programmatic injection</a> section of the content script s doc.",
624 "parameters": [ 658 "parameters": [
625 {"type": "integer", "name": "tabId", "optional": true, "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."}, 659 {"type": "integer", "name": "tabId", "optional": true, "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."},
626 { 660 {
627 "type": "object", 661 "type": "object",
628 "name": "details", 662 "name": "details",
629 "description": "Details of the CSS text to insert. Either the code o r the file property must be set, but both may not be set at the same time.", 663 "description": "Details of the CSS text to insert. Either the code o r the file property must be set, but both may not be set at the same time.",
630 "properties": { 664 "properties": {
631 "code": {"type": "string", "optional": true, "description": "CSS c ode to be injected."}, 665 "code": {"type": "string", "optional": true, "description": "CSS c ode to be injected."},
632 "file": {"type": "string", "optional": true, "description": "CSS f ile to be injected."}, 666 "file": {"type": "string", "optional": true, "description": "CSS f ile to be injected."},
633 "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is true, this function injects CSS text into all frames of current page. By default, it's false and CSS is injected only into the top main frame." } 667 "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is true, this function injects CSS text into all frames of current page. By default, it's false and CSS is injected only into the top main frame." }
634 } 668 }
635 }, 669 },
636 { 670 {
637 "type": "function", 671 "type": "function",
638 "name": "callback", 672 "name": "callback",
639 "optional": true, 673 "optional": true,
640 "description": "Called when all the CSS has been inserted.", 674 "description": "Called when all the CSS has been inserted.",
641 "parameters": [] 675 "parameters": []
642 } 676 }
643 ] 677 ]
644 } 678 }
645 ], 679 ],
646 "events": [ 680 "events": [
647 { 681 {
648 "name": "onCreated", 682 "name": "onCreated",
683 "contexts": ["blessed_extension"],
684 "dependencies": ["permission:tabs"],
649 "type": "function", 685 "type": "function",
650 "description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.", 686 "description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
651 "parameters": [ 687 "parameters": [
652 { 688 {
653 "$ref": "Tab", 689 "$ref": "Tab",
654 "name": "tab", 690 "name": "tab",
655 "description": "Details of the tab that was created." 691 "description": "Details of the tab that was created."
656 } 692 }
657 ] 693 ]
658 }, 694 },
659 { 695 {
660 "name": "onUpdated", 696 "name": "onUpdated",
697 "contexts": ["blessed_extension"],
698 "dependencies": ["permission:tabs"],
661 "type": "function", 699 "type": "function",
662 "description": "Fired when a tab is updated.", 700 "description": "Fired when a tab is updated.",
663 "parameters": [ 701 "parameters": [
664 {"type": "integer", "name": "tabId", "minimum": 0}, 702 {"type": "integer", "name": "tabId", "minimum": 0},
665 { 703 {
666 "type": "object", 704 "type": "object",
667 "name": "changeInfo", 705 "name": "changeInfo",
668 "description": "Lists the changes to the state of the tab that was u pdated.", 706 "description": "Lists the changes to the state of the tab that was u pdated.",
669 "properties": { 707 "properties": {
670 "status": { 708 "status": {
(...skipping 15 matching lines...) Expand all
686 }, 724 },
687 { 725 {
688 "$ref": "Tab", 726 "$ref": "Tab",
689 "name": "tab", 727 "name": "tab",
690 "description": "Gives the state of the tab that was updated." 728 "description": "Gives the state of the tab that was updated."
691 } 729 }
692 ] 730 ]
693 }, 731 },
694 { 732 {
695 "name": "onMoved", 733 "name": "onMoved",
734 "contexts": ["blessed_extension"],
735 "dependencies": ["permission:tabs"],
696 "type": "function", 736 "type": "function",
697 "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are n ot fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see <a href='#event-onDetached'>o nDetached</a>.", 737 "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are n ot fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see <a href='#event-onDetached'>o nDetached</a>.",
698 "parameters": [ 738 "parameters": [
699 {"type": "integer", "name": "tabId", "minimum": 0}, 739 {"type": "integer", "name": "tabId", "minimum": 0},
700 { 740 {
701 "type": "object", 741 "type": "object",
702 "name": "moveInfo", 742 "name": "moveInfo",
703 "properties": { 743 "properties": {
704 "windowId": {"type": "integer", "minimum": 0}, 744 "windowId": {"type": "integer", "minimum": 0},
705 "fromIndex": {"type": "integer", "minimum": 0}, 745 "fromIndex": {"type": "integer", "minimum": 0},
706 "toIndex": {"type": "integer", "minimum": 0} 746 "toIndex": {"type": "integer", "minimum": 0}
707 } 747 }
708 } 748 }
709 ] 749 ]
710 }, 750 },
711 { 751 {
712 "name": "onSelectionChanged", 752 "name": "onSelectionChanged",
753 "contexts": ["blessed_extension"],
754 "dependencies": ["permission:tabs"],
713 "nodoc": true, 755 "nodoc": true,
714 "type": "function", 756 "type": "function",
715 "description": "Deprecated. Please use onActivated.", 757 "description": "Deprecated. Please use onActivated.",
716 "parameters": [ 758 "parameters": [
717 { 759 {
718 "type": "integer", 760 "type": "integer",
719 "name": "tabId", 761 "name": "tabId",
720 "minimum": 0, 762 "minimum": 0,
721 "description": "The ID of the tab that has become active." 763 "description": "The ID of the tab that has become active."
722 }, 764 },
723 { 765 {
724 "type": "object", 766 "type": "object",
725 "name": "selectInfo", 767 "name": "selectInfo",
726 "properties": { 768 "properties": {
727 "windowId": { 769 "windowId": {
728 "type": "integer", 770 "type": "integer",
729 "minimum": 0, 771 "minimum": 0,
730 "description": "The ID of the window the selected tab changed in side of." 772 "description": "The ID of the window the selected tab changed in side of."
731 } 773 }
732 } 774 }
733 } 775 }
734 ] 776 ]
735 }, 777 },
736 { 778 {
737 "name": "onActiveChanged", 779 "name": "onActiveChanged",
780 "contexts": ["blessed_extension"],
781 "dependencies": ["permission:tabs"],
738 "nodoc": true, 782 "nodoc": true,
739 "type": "function", 783 "type": "function",
740 "description": "Deprecated. Please use onActivated.", 784 "description": "Deprecated. Please use onActivated.",
741 "parameters": [ 785 "parameters": [
742 { 786 {
743 "type": "integer", 787 "type": "integer",
744 "name": "tabId", 788 "name": "tabId",
745 "minimum": 0, 789 "minimum": 0,
746 "description": "The ID of the tab that has become active." 790 "description": "The ID of the tab that has become active."
747 }, 791 },
748 { 792 {
749 "type": "object", 793 "type": "object",
750 "name": "selectInfo", 794 "name": "selectInfo",
751 "properties": { 795 "properties": {
752 "windowId": { 796 "windowId": {
753 "type": "integer", 797 "type": "integer",
754 "minimum": 0, 798 "minimum": 0,
755 "description": "The ID of the window the selected tab changed in side of." 799 "description": "The ID of the window the selected tab changed in side of."
756 } 800 }
757 } 801 }
758 } 802 }
759 ] 803 ]
760 }, 804 },
761 { 805 {
762 "name": "onActivated", 806 "name": "onActivated",
807 "contexts": ["blessed_extension"],
808 "dependencies": ["permission:tabs"],
763 "type": "function", 809 "type": "function",
764 "description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen t o onUpdated events to be notified when a URL is set.", 810 "description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen t o onUpdated events to be notified when a URL is set.",
765 "parameters": [ 811 "parameters": [
766 { 812 {
767 "type": "object", 813 "type": "object",
768 "name": "activeInfo", 814 "name": "activeInfo",
769 "properties": { 815 "properties": {
770 "tabId": { 816 "tabId": {
771 "type": "integer", 817 "type": "integer",
772 "minimum": 0, 818 "minimum": 0,
773 "description": "The ID of the tab that has become active." 819 "description": "The ID of the tab that has become active."
774 }, 820 },
775 "windowId": { 821 "windowId": {
776 "type": "integer", 822 "type": "integer",
777 "minimum": 0, 823 "minimum": 0,
778 "description": "The ID of the window the active tab changed insi de of." 824 "description": "The ID of the window the active tab changed insi de of."
779 } 825 }
780 } 826 }
781 } 827 }
782 ] 828 ]
783 }, 829 },
784 { 830 {
785 "name": "onHighlightChanged", 831 "name": "onHighlightChanged",
832 "contexts": ["blessed_extension"],
833 "dependencies": ["permission:tabs"],
786 "type": "function", 834 "type": "function",
787 "nodoc": true, 835 "nodoc": true,
788 "description": "Deprecated. Please use onHighlighted.", 836 "description": "Deprecated. Please use onHighlighted.",
789 "parameters": [ 837 "parameters": [
790 { 838 {
791 "type": "object", 839 "type": "object",
792 "name": "selectInfo", 840 "name": "selectInfo",
793 "properties": { 841 "properties": {
794 "windowId": { 842 "windowId": {
795 "type": "integer", 843 "type": "integer",
796 "minimum": 0, 844 "minimum": 0,
797 "description": "The window whose tabs changed." 845 "description": "The window whose tabs changed."
798 }, 846 },
799 "tabIds": { 847 "tabIds": {
800 "type": "array", 848 "type": "array",
801 "name": "tabIds", 849 "name": "tabIds",
802 "items": {"type": "integer", "minimum": 0}, 850 "items": {"type": "integer", "minimum": 0},
803 "description": "All highlighted tabs in the window." 851 "description": "All highlighted tabs in the window."
804 } 852 }
805 } 853 }
806 } 854 }
807 ] 855 ]
808 }, 856 },
809 { 857 {
810 "name": "onHighlighted", 858 "name": "onHighlighted",
859 "contexts": ["blessed_extension"],
860 "dependencies": ["permission:tabs"],
811 "type": "function", 861 "type": "function",
812 "description": "Fired when the highlighted or selected tabs in a window changes.", 862 "description": "Fired when the highlighted or selected tabs in a window changes.",
813 "parameters": [ 863 "parameters": [
814 { 864 {
815 "type": "object", 865 "type": "object",
816 "name": "highlightInfo", 866 "name": "highlightInfo",
817 "properties": { 867 "properties": {
818 "windowId": { 868 "windowId": {
819 "type": "integer", 869 "type": "integer",
820 "minimum": 0, 870 "minimum": 0,
821 "description": "The window whose tabs changed." 871 "description": "The window whose tabs changed."
822 }, 872 },
823 "tabIds": { 873 "tabIds": {
824 "type": "array", 874 "type": "array",
825 "name": "tabIds", 875 "name": "tabIds",
826 "items": {"type": "integer", "minimum": 0}, 876 "items": {"type": "integer", "minimum": 0},
827 "description": "All highlighted tabs in the window." 877 "description": "All highlighted tabs in the window."
828 } 878 }
829 } 879 }
830 } 880 }
831 ] 881 ]
832 }, 882 },
833 { 883 {
834 "name": "onDetached", 884 "name": "onDetached",
885 "contexts": ["blessed_extension"],
886 "dependencies": ["permission:tabs"],
835 "type": "function", 887 "type": "function",
836 "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.", 888 "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
837 "parameters": [ 889 "parameters": [
838 {"type": "integer", "name": "tabId", "minimum": 0}, 890 {"type": "integer", "name": "tabId", "minimum": 0},
839 { 891 {
840 "type": "object", 892 "type": "object",
841 "name": "detachInfo", 893 "name": "detachInfo",
842 "properties": { 894 "properties": {
843 "oldWindowId": {"type": "integer", "minimum": 0}, 895 "oldWindowId": {"type": "integer", "minimum": 0},
844 "oldPosition": {"type": "integer", "minimum": 0} 896 "oldPosition": {"type": "integer", "minimum": 0}
845 } 897 }
846 } 898 }
847 ] 899 ]
848 }, 900 },
849 { 901 {
850 "name": "onAttached", 902 "name": "onAttached",
903 "contexts": ["blessed_extension"],
904 "dependencies": ["permission:tabs"],
851 "type": "function", 905 "type": "function",
852 "description": "Fired when a tab is attached to a window, for example be cause it was moved between windows.", 906 "description": "Fired when a tab is attached to a window, for example be cause it was moved between windows.",
853 "parameters": [ 907 "parameters": [
854 {"type": "integer", "name": "tabId", "minimum": 0}, 908 {"type": "integer", "name": "tabId", "minimum": 0},
855 { 909 {
856 "type": "object", 910 "type": "object",
857 "name": "attachInfo", 911 "name": "attachInfo",
858 "properties": { 912 "properties": {
859 "newWindowId": {"type": "integer", "minimum": 0}, 913 "newWindowId": {"type": "integer", "minimum": 0},
860 "newPosition": {"type": "integer", "minimum": 0} 914 "newPosition": {"type": "integer", "minimum": 0}
861 } 915 }
862 } 916 }
863 ] 917 ]
864 }, 918 },
865 { 919 {
866 "name": "onRemoved", 920 "name": "onRemoved",
921 "contexts": ["blessed_extension"],
867 "type": "function", 922 "type": "function",
868 "description": "Fired when a tab is closed. Note: A listener can be regi stered for this event without requesting the 'tabs' permission in the manifest." , 923 "description": "Fired when a tab is closed. Note: A listener can be regi stered for this event without requesting the 'tabs' permission in the manifest." ,
869 "parameters": [ 924 "parameters": [
870 {"type": "integer", "name": "tabId", "minimum": 0}, 925 {"type": "integer", "name": "tabId", "minimum": 0},
871 { 926 {
872 "type": "object", 927 "type": "object",
873 "name": "removeInfo", 928 "name": "removeInfo",
874 "properties": { 929 "properties": {
875 "isWindowClosing": {"type": "boolean", "description": "True when t he tab is being closed because its window is being closed." } 930 "isWindowClosing": {"type": "boolean", "description": "True when t he tab is being closed because its window is being closed." }
876 } 931 }
877 } 932 }
878 ] 933 ]
879 } 934 }
880 ] 935 ]
881 } 936 }
882 ] 937 ]
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/extension_api_unittest.cc ('k') | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698