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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 "optional": true | 83 "optional": true |
84 } | 84 } |
85 ] | 85 ] |
86 } | 86 } |
87 ] | 87 ] |
88 }, | 88 }, |
89 { | 89 { |
90 "name": "connect", | 90 "name": "connect", |
91 "nocompile": true, | 91 "nocompile": true, |
92 "type": "function", | 92 "type": "function", |
93 "description": "Connects to the content script(s) in the specified tab.
The $(ref:runtime.onConnect) event is fired in each content script running in th
e specified tab for the current extension. For more details, see <a href='messag
ing.html'>Content Script Messaging</a>.", | 93 "description": "Connects to the content script(s) in the specified tab.
The $(ref:runtime.onConnect) event is fired in each content script running in th
e specified tab for the current extension. For more details, see <a href='messag
ing'>Content Script Messaging</a>.", |
94 "parameters": [ | 94 "parameters": [ |
95 { | 95 { |
96 "type": "integer", | 96 "type": "integer", |
97 "name": "tabId", | 97 "name": "tabId", |
98 "minimum": 0 | 98 "minimum": 0 |
99 }, | 99 }, |
100 { | 100 { |
101 "type": "object", | 101 "type": "object", |
102 "name": "connectInfo", | 102 "name": "connectInfo", |
103 "properties": { | 103 "properties": { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 "name": "getSelected", | 174 "name": "getSelected", |
175 "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.
", | 175 "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.
", |
176 "type": "function", | 176 "type": "function", |
177 "description": "Gets the tab that is selected in the specified window.", | 177 "description": "Gets the tab that is selected in the specified window.", |
178 "parameters": [ | 178 "parameters": [ |
179 { | 179 { |
180 "type": "integer", | 180 "type": "integer", |
181 "name": "windowId", | 181 "name": "windowId", |
182 "minimum": -2, | 182 "minimum": -2, |
183 "optional": true, | 183 "optional": true, |
184 "description": "Defaults to the <a href='windows.html#current-window
'>current window</a>." | 184 "description": "Defaults to the <a href='windows#current-window'>cur
rent window</a>." |
185 }, | 185 }, |
186 { | 186 { |
187 "type": "function", | 187 "type": "function", |
188 "name": "callback", | 188 "name": "callback", |
189 "parameters": [ | 189 "parameters": [ |
190 {"name": "tab", "$ref": "Tab"} | 190 {"name": "tab", "$ref": "Tab"} |
191 ] | 191 ] |
192 } | 192 } |
193 ] | 193 ] |
194 }, | 194 }, |
195 { | 195 { |
196 "name": "getAllInWindow", | 196 "name": "getAllInWindow", |
197 "type": "function", | 197 "type": "function", |
198 "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</
code>.", | 198 "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</
code>.", |
199 "description": "Gets details about all tabs in the specified window.", | 199 "description": "Gets details about all tabs in the specified window.", |
200 "parameters": [ | 200 "parameters": [ |
201 { | 201 { |
202 "type": "integer", | 202 "type": "integer", |
203 "name": "windowId", | 203 "name": "windowId", |
204 "minimum": -2, | 204 "minimum": -2, |
205 "optional": true, | 205 "optional": true, |
206 "description": "Defaults to the <a href='windows.html#current-window
'>current window</a>." | 206 "description": "Defaults to the <a href='windows#current-window'>cur
rent window</a>." |
207 }, | 207 }, |
208 { | 208 { |
209 "type": "function", | 209 "type": "function", |
210 "name": "callback", | 210 "name": "callback", |
211 "parameters": [ | 211 "parameters": [ |
212 {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } } | 212 {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } } |
213 ] | 213 ] |
214 } | 214 } |
215 ] | 215 ] |
216 }, | 216 }, |
217 { | 217 { |
218 "name": "create", | 218 "name": "create", |
219 "type": "function", | 219 "type": "function", |
220 "description": "Creates a new tab.", | 220 "description": "Creates a new tab.", |
221 "parameters": [ | 221 "parameters": [ |
222 { | 222 { |
223 "type": "object", | 223 "type": "object", |
224 "name": "createProperties", | 224 "name": "createProperties", |
225 "properties": { | 225 "properties": { |
226 "windowId": { | 226 "windowId": { |
227 "type": "integer", | 227 "type": "integer", |
228 "minimum": -2, | 228 "minimum": -2, |
229 "optional": true, | 229 "optional": true, |
230 "description": "The window to create the new tab in. Defaults to
the <a href='windows.html#current-window'>current window</a>." | 230 "description": "The window to create the new tab in. Defaults to
the <a href='windows#current-window'>current window</a>." |
231 }, | 231 }, |
232 "index": { | 232 "index": { |
233 "type": "integer", | 233 "type": "integer", |
234 "minimum": 0, | 234 "minimum": 0, |
235 "optional": true, | 235 "optional": true, |
236 "description": "The position the tab should take in the window.
The provided value will be clamped to between zero and the number of tabs in the
window." | 236 "description": "The position the tab should take in the window.
The provided value will be clamped to between zero and the number of tabs in the
window." |
237 }, | 237 }, |
238 "url": { | 238 "url": { |
239 "type": "string", | 239 "type": "string", |
240 "optional": true, | 240 "optional": true, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 "description": "Whether the tabs are pinned." | 324 "description": "Whether the tabs are pinned." |
325 }, | 325 }, |
326 "highlighted": { | 326 "highlighted": { |
327 "type": "boolean", | 327 "type": "boolean", |
328 "optional": true, | 328 "optional": true, |
329 "description": "Whether the tabs are highlighted." | 329 "description": "Whether the tabs are highlighted." |
330 }, | 330 }, |
331 "currentWindow": { | 331 "currentWindow": { |
332 "type": "boolean", | 332 "type": "boolean", |
333 "optional": true, | 333 "optional": true, |
334 "description": "Whether the tabs are in the <a href='windows.htm
l#current-window'>current window</a>." | 334 "description": "Whether the tabs are in the <a href='windows#cur
rent-window'>current window</a>." |
335 }, | 335 }, |
336 "lastFocusedWindow": { | 336 "lastFocusedWindow": { |
337 "type": "boolean", | 337 "type": "boolean", |
338 "optional": true, | 338 "optional": true, |
339 "description": "Whether the tabs are in the last focused window.
" | 339 "description": "Whether the tabs are in the last focused window.
" |
340 }, | 340 }, |
341 "status": { | 341 "status": { |
342 "type": "string", | 342 "type": "string", |
343 "optional": true, | 343 "optional": true, |
344 "enum": ["loading", "complete"], | 344 "enum": ["loading", "complete"], |
345 "description": "Whether the tabs have completed loading." | 345 "description": "Whether the tabs have completed loading." |
346 }, | 346 }, |
347 "title": { | 347 "title": { |
348 "type": "string", | 348 "type": "string", |
349 "optional": true, | 349 "optional": true, |
350 "description": "Match page titles against a pattern." | 350 "description": "Match page titles against a pattern." |
351 }, | 351 }, |
352 "url": { | 352 "url": { |
353 "type": "string", | 353 "type": "string", |
354 "optional": true, | 354 "optional": true, |
355 "description": "Match tabs against a <a href='match_patterns.htm
l'>URL pattern</a>. Note that fragment identifiers are not matched." | 355 "description": "Match tabs against a <a href='match_patterns'>UR
L pattern</a>. Note that fragment identifiers are not matched." |
356 }, | 356 }, |
357 "windowId": { | 357 "windowId": { |
358 "type": "integer", | 358 "type": "integer", |
359 "optional": true, | 359 "optional": true, |
360 "minimum": -2, | 360 "minimum": -2, |
361 "description": "The ID of the parent window, or $(ref:windows.WI
NDOW_ID_CURRENT) for the <a href='windows.html#current-window'>current window</a
>." | 361 "description": "The ID of the parent window, or $(ref:windows.WI
NDOW_ID_CURRENT) for the <a href='windows#current-window'>current window</a>." |
362 }, | 362 }, |
363 "windowType": { | 363 "windowType": { |
364 "type": "string", | 364 "type": "string", |
365 "optional": true, | 365 "optional": true, |
366 "enum": ["normal", "popup", "panel", "app"], | 366 "enum": ["normal", "popup", "panel", "app"], |
367 "description": "The type of window the tabs are in." | 367 "description": "The type of window the tabs are in." |
368 }, | 368 }, |
369 "index": { | 369 "index": { |
370 "type": "integer", | 370 "type": "integer", |
371 "optional": true, | 371 "optional": true, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 { | 429 { |
430 "name": "update", | 430 "name": "update", |
431 "type": "function", | 431 "type": "function", |
432 "description": "Modifies the properties of a tab. Properties that are no
t specified in <var>updateProperties</var> are not modified.", | 432 "description": "Modifies the properties of a tab. Properties that are no
t specified in <var>updateProperties</var> are not modified.", |
433 "parameters": [ | 433 "parameters": [ |
434 { | 434 { |
435 "type": "integer", | 435 "type": "integer", |
436 "name": "tabId", | 436 "name": "tabId", |
437 "minimum": 0, | 437 "minimum": 0, |
438 "optional": true, | 438 "optional": true, |
439 "description": "Defaults to the selected tab of the <a href='windows
.html#current-window'>current window</a>." | 439 "description": "Defaults to the selected tab of the <a href='windows
#current-window'>current window</a>." |
440 }, | 440 }, |
441 { | 441 { |
442 "type": "object", | 442 "type": "object", |
443 "name": "updateProperties", | 443 "name": "updateProperties", |
444 "properties": { | 444 "properties": { |
445 "url": { | 445 "url": { |
446 "type": "string", | 446 "type": "string", |
447 "optional": true, | 447 "optional": true, |
448 "description": "A URL to navigate the tab to." | 448 "description": "A URL to navigate the tab to." |
449 }, | 449 }, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 { | 578 { |
579 "name": "detectLanguage", | 579 "name": "detectLanguage", |
580 "type": "function", | 580 "type": "function", |
581 "description": "Detects the primary language of the content in a tab.", | 581 "description": "Detects the primary language of the content in a tab.", |
582 "parameters": [ | 582 "parameters": [ |
583 { | 583 { |
584 "type": "integer", | 584 "type": "integer", |
585 "name": "tabId", | 585 "name": "tabId", |
586 "minimum": 0, | 586 "minimum": 0, |
587 "optional": true, | 587 "optional": true, |
588 "description": "Defaults to the active tab of the <a href='windows.h
tml#current-window'>current window</a>." | 588 "description": "Defaults to the active tab of the <a href='windows#c
urrent-window'>current window</a>." |
589 }, | 589 }, |
590 { | 590 { |
591 "type": "function", | 591 "type": "function", |
592 "name": "callback", | 592 "name": "callback", |
593 "parameters": [ | 593 "parameters": [ |
594 { | 594 { |
595 "type": "string", | 595 "type": "string", |
596 "name": "language", | 596 "name": "language", |
597 "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." | 597 "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." |
598 } | 598 } |
599 ] | 599 ] |
600 } | 600 } |
601 ] | 601 ] |
602 }, | 602 }, |
603 { | 603 { |
604 "name": "captureVisibleTab", | 604 "name": "captureVisibleTab", |
605 "type": "function", | 605 "type": "function", |
606 "description": "Captures the visible area of the currently active tab in
the specified window. You must have <a href='declare_permissions.html'><all_
urls></a> permission to use this method.", | 606 "description": "Captures the visible area of the currently active tab in
the specified window. You must have <a href='declare_permissions'><all_urls&
gt;</a> permission to use this method.", |
607 "parameters": [ | 607 "parameters": [ |
608 { | 608 { |
609 "type": "integer", | 609 "type": "integer", |
610 "name": "windowId", | 610 "name": "windowId", |
611 "minimum": -2, | 611 "minimum": -2, |
612 "optional": true, | 612 "optional": true, |
613 "description": "The target window. Defaults to the <a href='windows.
html#current-window'>current window</a>." | 613 "description": "The target window. Defaults to the <a href='windows#
current-window'>current window</a>." |
614 }, | 614 }, |
615 { | 615 { |
616 "$ref": "types.ImageDetails", | 616 "$ref": "types.ImageDetails", |
617 "name": "options", | 617 "name": "options", |
618 "optional": true | 618 "optional": true |
619 }, | 619 }, |
620 { | 620 { |
621 "type": "function", "name": "callback", "parameters": [ | 621 "type": "function", "name": "callback", "parameters": [ |
622 {"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."} | 622 {"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."} |
623 ] | 623 ] |
624 } | 624 } |
625 ] | 625 ] |
626 }, | 626 }, |
627 { | 627 { |
628 "name": "executeScript", | 628 "name": "executeScript", |
629 "type": "function", | 629 "type": "function", |
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.", | 630 "description": "Injects JavaScript code into a page. For details, see th
e <a href='content_scripts#pi'>programmatic injection</a> section of the content
scripts doc.", |
631 "parameters": [ | 631 "parameters": [ |
632 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to run the script; defaults to the act
ive tab of the current window."}, | 632 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to run the script; defaults to the act
ive tab of the current window."}, |
633 { | 633 { |
634 "$ref": "tabs.InjectDetails", | 634 "$ref": "tabs.InjectDetails", |
635 "name": "details", | 635 "name": "details", |
636 "description": "Details of the script to run." | 636 "description": "Details of the script to run." |
637 }, | 637 }, |
638 { | 638 { |
639 "type": "function", | 639 "type": "function", |
640 "name": "callback", | 640 "name": "callback", |
641 "optional": true, | 641 "optional": true, |
642 "description": "Called after all the JavaScript has been executed.", | 642 "description": "Called after all the JavaScript has been executed.", |
643 "parameters": [ | 643 "parameters": [ |
644 { | 644 { |
645 "name": "result", | 645 "name": "result", |
646 "optional": true, | 646 "optional": true, |
647 "type": "array", | 647 "type": "array", |
648 "items": {"type": "any", "minimum": 0}, | 648 "items": {"type": "any", "minimum": 0}, |
649 "description": "The result of the script in every injected frame
." | 649 "description": "The result of the script in every injected frame
." |
650 } | 650 } |
651 ] | 651 ] |
652 } | 652 } |
653 ] | 653 ] |
654 }, | 654 }, |
655 { | 655 { |
656 "name": "insertCSS", | 656 "name": "insertCSS", |
657 "type": "function", | 657 "type": "function", |
658 "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.", | 658 "description": "Injects CSS into a page. For details, see the <a href='c
ontent_scripts#pi'>programmatic injection</a> section of the content scripts doc
.", |
659 "parameters": [ | 659 "parameters": [ |
660 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to insert the CSS; defaults to the act
ive tab of the current window."}, | 660 {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "
description": "The ID of the tab in which to insert the CSS; defaults to the act
ive tab of the current window."}, |
661 { | 661 { |
662 "$ref": "tabs.InjectDetails", | 662 "$ref": "tabs.InjectDetails", |
663 "name": "details", | 663 "name": "details", |
664 "description": "Details of the CSS text to insert." | 664 "description": "Details of the CSS text to insert." |
665 }, | 665 }, |
666 { | 666 { |
667 "type": "function", | 667 "type": "function", |
668 "name": "callback", | 668 "name": "callback", |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 "type": "function", | 918 "type": "function", |
919 "description": "Fired when a tab is replaced with another tab due to pre
rendering or instant.", | 919 "description": "Fired when a tab is replaced with another tab due to pre
rendering or instant.", |
920 "parameters": [ | 920 "parameters": [ |
921 {"type": "integer", "name": "addedTabId", "minimum": 0}, | 921 {"type": "integer", "name": "addedTabId", "minimum": 0}, |
922 {"type": "integer", "name": "removedTabId", "minimum": 0} | 922 {"type": "integer", "name": "removedTabId", "minimum": 0} |
923 ] | 923 ] |
924 } | 924 } |
925 ] | 925 ] |
926 } | 926 } |
927 ] | 927 ] |
OLD | NEW |