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