Home | History | Annotate | Download | only in api
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 [
      6   {
      7     "namespace": "tabs",
      8     "description": "Use the <code>chrome.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.",
      9     "types": [
     10       {
     11         "id": "Tab",
     12         "type": "object",
     13         "properties": {
     14           "id": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present."},
     15           // TODO(kalman): Investigate how this is ending up as -1 (based on window type? a bug?) and whether it should be optional instead.
     16           "index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."},
     17           "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window the tab is contained within."},
     18           "openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."},
     19           "selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."},
     20           "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."},
     21           "active": {"type": "boolean", "description": "Whether the tab is active in its window. (Does not necessarily mean the window is focused.)"},
     22           "pinned": {"type": "boolean", "description": "Whether the tab is pinned."},
     23           "url": {"type": "string", "optional": true, "description": "The URL the tab is displaying. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."},
     24           "title": {"type": "string", "optional": true, "optional": true, "description": "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 the extension's manifest includes the <code>\"tabs\"</code> permission. It may also be an empty string if the tab is loading."},
     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."},
     28           "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."},
     29           "height": {"type": "integer", "optional": true, "description": "The height 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."}
     31         }
     32       },
     33       {
     34         "id": "ZoomSettings",
     35         "type": "object",
     36         "description": "Defines how zoom changes in a tab are handled and at what scope.",
     37         "properties": {
     38           "mode": {
     39             "type": "string",
     40             "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>.",
     41             "optional": true,
     42             "enum": [
     43               {
     44                 "name": "automatic",
     45                 "description": "Zoom changes are handled automatically by the browser."
     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 responsibility 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>."
     50               },
     51               {
     52                 "name": "disabled",
     53                 "description": "Disables all zooming in the tab. The tab will revert to default (100%) zoom, and all attempted zoom changes will be ignored."
     54               }
     55             ]
     56           },
     57           "scope": {
     58             "type": "string",
     59             "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> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.",
     60             "optional": true,
     61             "enum": [
     62               {
     63                 "name": "per-origin",
     64                 "description": "Zoom changes will persist in the zoomed page's origin, 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, meaning that when navigating to other pages in the same origin, they will all be zoomed 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 zoom changes in other tabs will not affect the zooming of this tab. Also, <code>per-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           }
     72         }
     73       }
     74     ],
     75     "functions": [
     76       {
     77         "name": "get",
     78         "type": "function",
     79         "description": "Retrieves details about the specified tab.",
     80         "parameters": [
     81           {
     82             "type": "integer",
     83             "name": "tabId",
     84             "minimum": 0
     85           },
     86           {
     87             "type": "function",
     88             "name": "callback",
     89             "parameters": [
     90               {"name": "tab", "$ref": "Tab"}
     91             ]
     92           }
     93         ]
     94       },
     95       {
     96         "name": "getCurrent",
     97         "type": "function",
     98         "description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).",
     99         "parameters": [
    100           {
    101             "type": "function",
    102             "name": "callback",
    103             "parameters": [
    104               {
    105                 "name": "tab",
    106                 "$ref": "Tab",
    107                 "optional": true
    108               }
    109             ]
    110           }
    111         ]
    112       },
    113       {
    114         "name": "connect",
    115         "nocompile": true,
    116         "type": "function",
    117         "description": "Connects to the content script(s) in the specified tab. The $(ref:runtime.onConnect) event is fired in each content script running in the specified tab for the current extension. For more details, see <a href='messaging'>Content Script Messaging</a>.",
    118         "parameters": [
    119           {
    120             "type": "integer",
    121             "name": "tabId",
    122             "minimum": 0
    123           },
    124           {
    125             "type": "object",
    126             "name": "connectInfo",
    127             "properties": {
    128               "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connection event." }
    129             },
    130             "optional": true
    131           }
    132         ],
    133         "returns": {
    134           "$ref": "runtime.Port",
    135           "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $(ref:runtime.Port) event is fired if the tab closes or does not exist. "
    136         }
    137       },
    138       {
    139         "name": "sendRequest",
    140         "deprecated": "Please use $(ref:runtime.sendMessage).",
    141         "nocompile": true,
    142         "type": "function",
    143         "description": "Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back.  The $(ref:extension.onRequest) event is fired in each content script running in the specified tab for the current extension.",
    144         "parameters": [
    145           {
    146             "type": "integer",
    147             "name": "tabId",
    148             "minimum": 0
    149           },
    150           {
    151             "type": "any",
    152             "name": "request"
    153           },
    154           {
    155             "type": "function",
    156             "name": "responseCallback",
    157             "optional": true,
    158             "parameters": [
    159               {
    160                 "name": "response",
    161                 "type": "any",
    162                 "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
    163               }
    164             ]
    165           }
    166         ]
    167       },
    168       {
    169         "name": "sendMessage",
    170         "nocompile": true,
    171         "type": "function",
    172         "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back.  The $(ref:runtime.onMessage) event is fired in each content script running in the specified tab for the current extension.",
    173         "parameters": [
    174           {
    175             "type": "integer",
    176             "name": "tabId",
    177             "minimum": 0
    178           },
    179           {
    180             "type": "any",
    181             "name": "message"
    182           },
    183           {
    184             "type": "function",
    185             "name": "responseCallback",
    186             "optional": true,
    187             "parameters": [
    188               {
    189                 "name": "response",
    190                 "type": "any",
    191                 "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
    192               }
    193             ]
    194           }
    195         ]
    196       },
    197       {
    198         "name": "getSelected",
    199         "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.",
    200         "type": "function",
    201         "description": "Gets the tab that is selected in the specified window.",
    202         "parameters": [
    203           {
    204             "type": "integer",
    205             "name": "windowId",
    206             "minimum": -2,
    207             "optional": true,
    208             "description": "Defaults to the <a href='windows#current-window'>current window</a>."
    209           },
    210           {
    211             "type": "function",
    212             "name": "callback",
    213             "parameters": [
    214               {"name": "tab", "$ref": "Tab"}
    215             ]
    216           }
    217         ]
    218       },
    219       {
    220         "name": "getAllInWindow",
    221         "type": "function",
    222         "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</code>.",
    223         "description": "Gets details about all tabs in the specified window.",
    224         "parameters": [
    225           {
    226             "type": "integer",
    227             "name": "windowId",
    228             "minimum": -2,
    229             "optional": true,
    230             "description": "Defaults to the <a href='windows#current-window'>current window</a>."
    231             },
    232           {
    233             "type": "function",
    234             "name": "callback",
    235             "parameters": [
    236               {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } }
    237             ]
    238           }
    239         ]
    240       },
    241       {
    242         "name": "create",
    243         "type": "function",
    244         "description": "Creates a new tab.",
    245         "parameters": [
    246           {
    247             "type": "object",
    248             "name": "createProperties",
    249             "properties": {
    250               "windowId": {
    251                 "type": "integer",
    252                 "minimum": -2,
    253                 "optional": true,
    254                 "description": "The window to create the new tab in. Defaults to the <a href='windows#current-window'>current window</a>."
    255               },
    256               "index": {
    257                 "type": "integer",
    258                 "minimum": 0,
    259                 "optional": true,
    260                 "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."
    261               },
    262               "url": {
    263                 "type": "string",
    264                 "optional": true,
    265                 "description": "The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page."
    266               },
    267               "active": {
    268                 "type": "boolean",
    269                 "optional": true,
    270                 "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to <var>true</var>."
    271               },
    272               "selected": {
    273                 "deprecated": "Please use <em>active</em>.",
    274                 "type": "boolean",
    275                 "optional": true,
    276                 "description": "Whether the tab should become the selected tab in the window. Defaults to <var>true</var>"
    277               },
    278               "pinned": {
    279                 "type": "boolean",
    280                 "optional": true,
    281                 "description": "Whether the tab should be pinned. Defaults to <var>false</var>"
    282               },
    283               "openerTabId": {
    284                 "type": "integer",
    285                 "minimum": 0,
    286                 "optional": true,
    287                 "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab."
    288               }
    289             }
    290           },
    291           {
    292             "type": "function",
    293             "name": "callback",
    294             "optional": true,
    295             "parameters": [
    296               {
    297                 "name": "tab",
    298                 "$ref": "Tab",
    299                 "description": "Details about the created tab. Will contain the ID of the new tab."
    300               }
    301             ]
    302           }
    303         ]
    304       },
    305       {
    306         "name": "duplicate",
    307         "type": "function",
    308         "description": "Duplicates a tab.",
    309         "parameters": [
    310           {
    311             "type": "integer",
    312             "name": "tabId",
    313             "minimum": 0,
    314             "description": "The ID of the tab which is to be duplicated."
    315           },
    316           {
    317             "type": "function",
    318             "name": "callback",
    319             "optional": true,
    320             "parameters": [
    321               {
    322                 "name": "tab",
    323                 "optional": true,
    324                 "description": "Details about the duplicated tab. The $(ref:tabs.Tab) object doesn't contain <code>url</code>, <code>title</code> and <code>favIconUrl</code> if the <code>\"tabs\"</code> permission has not been requested.",
    325                 "$ref": "Tab"
    326               }
    327             ]
    328           }
    329         ]
    330       },
    331       {
    332         "name": "query",
    333         "type": "function",
    334         "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
    335         "parameters": [
    336           {
    337             "type": "object",
    338             "name": "queryInfo",
    339             "properties": {
    340               "active": {
    341                 "type": "boolean",
    342                 "optional": true,
    343                 "description": "Whether the tabs are active in their windows."
    344               },
    345               "pinned": {
    346                 "type": "boolean",
    347                 "optional": true,
    348                 "description": "Whether the tabs are pinned."
    349               },
    350               "highlighted": {
    351                 "type": "boolean",
    352                 "optional": true,
    353                 "description": "Whether the tabs are highlighted."
    354               },
    355               "currentWindow": {
    356                 "type": "boolean",
    357                 "optional": true,
    358                 "description": "Whether the tabs are in the <a href='windows#current-window'>current window</a>."
    359               },
    360               "lastFocusedWindow": {
    361                 "type": "boolean",
    362                 "optional": true,
    363                 "description": "Whether the tabs are in the last focused window."
    364               },
    365               "status": {
    366                 "type": "string",
    367                 "optional": true,
    368                 "enum": ["loading", "complete"],
    369                 "description": "Whether the tabs have completed loading."
    370               },
    371               "title": {
    372                 "type": "string",
    373                 "optional": true,
    374                 "description": "Match page titles against a pattern."
    375               },
    376               "url": {
    377                 "choices": [
    378                   {"type": "string"},
    379                   {"type": "array", "items": {"type": "string"}}
    380                 ],
    381                 "optional": true,
    382                 "description": "Match tabs against one or more <a href='match_patterns'>URL patterns</a>. Note that fragment identifiers are not matched."
    383               },
    384               "windowId": {
    385                 "type": "integer",
    386                 "optional": true,
    387                 "minimum": -2,
    388                 "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the <a href='windows#current-window'>current window</a>."
    389               },
    390               "windowType": {
    391                 "type": "string",
    392                 "optional": true,
    393                 "enum": ["normal", "popup", "panel", "app"],
    394                 "description": "The type of window the tabs are in."
    395               },
    396               "index": {
    397                 "type": "integer",
    398                 "optional": true,
    399                 "minimum": 0,
    400                 "description": "The position of the tabs within their windows."
    401               }
    402             }
    403           },
    404           {
    405             "type": "function",
    406             "name": "callback",
    407             "parameters": [
    408               {
    409                 "name": "result",
    410                 "type": "array",
    411                 "items": {
    412                   "$ref": "Tab"
    413                 }
    414               }
    415             ]
    416           }
    417         ]
    418       },
    419       {
    420         "name": "highlight",
    421         "type": "function",
    422         "description": "Highlights the given tabs.",
    423         "parameters": [
    424           {
    425             "type": "object",
    426             "name": "highlightInfo",
    427             "properties": {
    428                "windowId": {
    429                  "type": "integer",
    430                  "optional": true,
    431                  "description": "The window that contains the tabs.",
    432                  "minimum": -2
    433                },
    434                "tabs": {
    435                  "description": "One or more tab indices to highlight.",
    436                  "choices": [
    437                    {"type": "array", "items": {"type": "integer", "minimum": 0}},
    438                    {"type": "integer"}
    439                  ]
    440                }
    441              }
    442            },
    443            {
    444              "type": "function",
    445              "name": "callback",
    446              "parameters": [
    447                {
    448                  "name": "window",
    449                  "$ref": "windows.Window",
    450                  "description": "Contains details about the window whose tabs were highlighted."
    451                }
    452              ]
    453            }
    454         ]
    455       },
    456       {
    457         "name": "update",
    458         "type": "function",
    459         "description": "Modifies the properties of a tab. Properties that are not specified in <var>updateProperties</var> are not modified.",
    460         "parameters": [
    461           {
    462             "type": "integer",
    463             "name": "tabId",
    464             "minimum": 0,
    465             "optional": true,
    466             "description": "Defaults to the selected tab of the <a href='windows#current-window'>current window</a>."
    467           },
    468           {
    469             "type": "object",
    470             "name": "updateProperties",
    471             "properties": {
    472               "url": {
    473                 "type": "string",
    474                 "optional": true,
    475                 "description": "A URL to navigate the tab to."
    476               },
    477               "active": {
    478                 "type": "boolean",
    479                 "optional": true,
    480                 "description": "Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update))."
    481               },
    482               "highlighted": {
    483                 "type": "boolean",
    484                 "optional": true,
    485                 "description": "Adds or removes the tab from the current selection."
    486               },
    487               "selected": {
    488                 "deprecated": "Please use <em>highlighted</em>.",
    489                 "type": "boolean",
    490                 "optional": true,
    491                 "description": "Whether the tab should be selected."
    492               },
    493               "pinned": {
    494                 "type": "boolean",
    495                 "optional": true,
    496                 "description": "Whether the tab should be pinned."
    497               },
    498               "openerTabId": {
    499                 "type": "integer",
    500                 "minimum": 0,
    501                 "optional": true,
    502                 "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab."
    503               }
    504             }
    505           },
    506           {
    507             "type": "function",
    508             "name": "callback",
    509             "optional": true,
    510             "parameters": [
    511               {
    512                 "name": "tab",
    513                 "$ref": "Tab",
    514                 "optional": true,
    515                 "description": "Details about the updated tab. The $(ref:tabs.Tab) object doesn't contain <code>url</code>, <code>title</code> and <code>favIconUrl</code> if the <code>\"tabs\"</code> permission has not been requested."
    516               }
    517             ]
    518           }
    519         ]
    520       },
    521       {
    522         "name": "move",
    523         "type": "function",
    524         "description": "Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === \"normal\") windows.",
    525         "parameters": [
    526           {
    527             "name": "tabIds",
    528             "description": "The tab or list of tabs to move.",
    529             "choices": [
    530               {"type": "integer", "minimum": 0},
    531               {"type": "array", "items": {"type": "integer", "minimum": 0}}
    532             ]
    533           },
    534           {
    535             "type": "object",
    536             "name": "moveProperties",
    537             "properties": {
    538               "windowId": {
    539                 "type": "integer",
    540                 "minimum": -2,
    541                 "optional": true,
    542                 "description": "Defaults to the window the tab is currently in."
    543               },
    544               "index": {
    545                 "type": "integer",
    546                 "minimum": -1,
    547                 "description": "The position to move the window to. -1 will place the tab at the end of the window."
    548               }
    549             }
    550           },
    551           {
    552             "type": "function",
    553             "name": "callback",
    554             "optional": true,
    555             "parameters": [
    556               {
    557                 "name": "tabs",
    558                 "description": "Details about the moved tabs.",
    559                 "choices": [
    560                   {"$ref": "Tab"},
    561                   {"type": "array", "items": {"$ref": "Tab"}}
    562                 ]
    563               }
    564             ]
    565           }
    566         ]
    567       },
    568       {
    569         "name": "reload",
    570         "type": "function",
    571         "description": "Reload a tab.",
    572         "parameters": [
    573           {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "description": "The ID of the tab to reload; defaults to the selected tab of the current window."},
    574           {
    575             "type": "object",
    576             "name": "reloadProperties",
    577             "optional": true,
    578             "properties": {
    579               "bypassCache": {
    580                 "type": "boolean",
    581                 "optional": true,
    582                 "description": "Whether using any local cache. Default is false."
    583               }
    584             }
    585           },
    586           {"type": "function", "name": "callback", "optional": true, "parameters": []}
    587         ]
    588       },
    589       {
    590         "name": "remove",
    591         "type": "function",
    592         "description": "Closes one or more tabs.",
    593         "parameters": [
    594           {
    595             "name": "tabIds",
    596             "description": "The tab or list of tabs to close.",
    597             "choices": [
    598               {"type": "integer", "minimum": 0},
    599               {"type": "array", "items": {"type": "integer", "minimum": 0}}
    600             ]
    601           },
    602           {"type": "function", "name": "callback", "optional": true, "parameters": []}
    603         ]
    604       },
    605       {
    606         "name": "detectLanguage",
    607         "type": "function",
    608         "description": "Detects the primary language of the content in a tab.",
    609         "parameters": [
    610           {
    611             "type": "integer",
    612             "name": "tabId",
    613             "minimum": 0,
    614             "optional": true,
    615             "description": "Defaults to the active tab of the <a href='windows#current-window'>current window</a>."
    616           },
    617           {
    618             "type": "function",
    619             "name": "callback",
    620             "parameters": [
    621               {
    622                 "type": "string",
    623                 "name": "language",
    624                 "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/languages/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 Chinese for which zh-CN will be returned. For an unknown language, <code>und</code> will be returned."
    625               }
    626             ]
    627           }
    628         ]
    629       },
    630       {
    631         "name": "captureVisibleTab",
    632         "type": "function",
    633         "description": "Captures the visible area of the currently active tab in the specified window. You must have <a href='declare_permissions'>&lt;all_urls&gt;</a> permission to use this method.",
    634         "parameters": [
    635           {
    636             "type": "integer",
    637             "name": "windowId",
    638             "minimum": -2,
    639             "optional": true,
    640             "description": "The target window. Defaults to the <a href='windows#current-window'>current window</a>."
    641           },
    642           {
    643             "$ref": "extensionTypes.ImageDetails",
    644             "name": "options",
    645             "optional": true
    646           },
    647           {
    648             "type": "function", "name": "callback", "parameters": [
    649               {"type": "string", "name": "dataUrl", "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."}
    650             ]
    651           }
    652         ]
    653       },
    654       {
    655         "name": "executeScript",
    656         "type": "function",
    657         "description": "Injects JavaScript code into a page. For details, see the <a href='content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
    658         "parameters": [
    659           {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."},
    660           {
    661             "$ref": "extensionTypes.InjectDetails",
    662             "name": "details",
    663             "description": "Details of the script to run."
    664           },
    665           {
    666             "type": "function",
    667             "name": "callback",
    668             "optional": true,
    669             "description": "Called after all the JavaScript has been executed.",
    670             "parameters": [
    671               {
    672                 "name": "result",
    673                 "optional": true,
    674                 "type": "array",
    675                 "items": {"type": "any", "minimum": 0},
    676                 "description": "The result of the script in every injected frame."
    677               }
    678             ]
    679           }
    680         ]
    681       },
    682       {
    683         "name": "insertCSS",
    684         "type": "function",
    685         "description": "Injects CSS into a page. For details, see the <a href='content_scripts#pi'>programmatic injection</a> section of the content scripts doc.",
    686         "parameters": [
    687           {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."},
    688           {
    689             "$ref": "extensionTypes.InjectDetails",
    690             "name": "details",
    691             "description": "Details of the CSS text to insert."
    692           },
    693           {
    694             "type": "function",
    695             "name": "callback",
    696             "optional": true,
    697             "description": "Called when all the CSS has been inserted.",
    698             "parameters": []
    699           }
    700         ]
    701       },
    702       {
    703         "name": "setZoom",
    704         "type": "function",
    705         "description": "Zooms a specified tab.",
    706         "parameters": [
    707           {
    708             "type": "integer",
    709             "name": "tabId",
    710             "minimum": 0,
    711             "optional": true,
    712             "description": "The ID of the tab to zoom; defaults to the active tab of the current window."
    713           },
    714           {
    715             "type": "number",
    716             "name": "zoomFactor",
    717             "description": "The new zoom factor."
    718           },
    719           {
    720             "type": "function",
    721             "name": "callback",
    722             "optional": true,
    723             "description": "Called after the zoom factor has been changed.",
    724             "parameters": []
    725           }
    726         ]
    727       },
    728       {
    729         "name": "getZoom",
    730         "type": "function",
    731         "description": "Gets the current zoom factor of a specified tab.",
    732         "parameters": [
    733           {
    734             "type": "integer",
    735             "name": "tabId",
    736             "minimum": 0,
    737             "optional": true,
    738             "description": "The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window."
    739           },
    740           {
    741             "type": "function",
    742             "name": "callback",
    743             "description": "Called with the tab's current zoom factor after it has been fetched.",
    744             "parameters": [
    745               {
    746                 "type": "number",
    747                 "name": "zoomFactor",
    748                 "description": "The tab's current zoom factor."
    749               }
    750             ]
    751           }
    752         ]
    753       },
    754       {
    755         "name": "setZoomSettings",
    756         "type": "function",
    757         "description": "Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.",
    758         "parameters": [
    759           {
    760             "type": "integer",
    761             "name": "tabId",
    762             "optional": true,
    763             "minimum": 0,
    764             "description": "The ID of the tab to change the zoom settings for; defaults to the active tab of the current window."
    765           },
    766           {
    767             "$ref": "ZoomSettings",
    768             "name": "zoomSettings",
    769             "description": "Defines how zoom changes are handled and at what scope."
    770           },
    771           {
    772             "type": "function",
    773             "name": "callback",
    774             "description": "Called after the zoom settings have been changed.",
    775             "parameters": []
    776           }
    777         ]
    778       },
    779       {
    780         "name": "getZoomSettings",
    781         "type": "function",
    782         "description": "Gets the current zoom settings of a specified tab.",
    783         "parameters": [
    784           {
    785             "type": "integer",
    786             "name": "tabId",
    787             "optional": true,
    788             "minimum": 0,
    789             "description": "The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window."
    790           },
    791           {
    792             "type": "function",
    793             "name": "callback",
    794             "description": "Called with the tab's current zoom settings.",
    795             "parameters": [
    796               {
    797                 "$ref": "ZoomSettings",
    798                 "name": "zoomSettings",
    799                 "description": "The tab's current zoom settings."
    800               }
    801             ]
    802           }
    803         ]
    804       }
    805     ],
    806     "events": [
    807       {
    808         "name": "onCreated",
    809         "type": "function",
    810         "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.",
    811         "parameters": [
    812           {
    813             "$ref": "Tab",
    814             "name": "tab",
    815             "description": "Details of the tab that was created."
    816           }
    817         ]
    818       },
    819       {
    820         "name": "onUpdated",
    821         "type": "function",
    822         "description": "Fired when a tab is updated.",
    823         "parameters": [
    824           {"type": "integer", "name": "tabId", "minimum": 0},
    825           {
    826             "type": "object",
    827             "name": "changeInfo",
    828             "description": "Lists the changes to the state of the tab that was updated.",
    829             "properties": {
    830               "status": {
    831                 "type": "string",
    832                 "optional": true,
    833                 "description": "The status of the tab. Can be either <em>loading</em> or <em>complete</em>."
    834               },
    835               "url": {
    836                 "type": "string",
    837                 "optional": true,
    838                 "description": "The tab's URL if it has changed."
    839               },
    840               "pinned": {
    841                 "type": "boolean",
    842                 "optional": true,
    843                 "description": "The tab's new pinned state."
    844               },
    845               "favIconUrl": {
    846                 "type": "string",
    847                 "optional": true,
    848                 "description": "The tab's new favicon URL."
    849               }
    850             }
    851           },
    852           {
    853             "$ref": "Tab",
    854             "name": "tab",
    855             "description": "Gives the state of the tab that was updated."
    856           }
    857         ]
    858       },
    859       {
    860         "name": "onMoved",
    861         "type": "function",
    862         "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 not 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 $(ref:tabs.onDetached).",
    863         "parameters": [
    864           {"type": "integer", "name": "tabId", "minimum": 0},
    865           {
    866             "type": "object",
    867             "name": "moveInfo",
    868             "properties": {
    869               "windowId": {"type": "integer", "minimum": 0},
    870               "fromIndex": {"type": "integer", "minimum": 0},
    871               "toIndex": {"type": "integer", "minimum": 0}
    872             }
    873           }
    874         ]
    875       },
    876       {
    877         "name": "onSelectionChanged",
    878         "deprecated": "Please use $(ref:tabs.onActivated).",
    879         "type": "function",
    880         "description": "Fires when the selected tab in a window changes.",
    881         "parameters": [
    882           {
    883             "type": "integer",
    884             "name": "tabId",
    885             "minimum": 0,
    886             "description": "The ID of the tab that has become active."
    887           },
    888           {
    889             "type": "object",
    890             "name": "selectInfo",
    891             "properties": {
    892               "windowId": {
    893                 "type": "integer",
    894                 "minimum": 0,
    895                 "description": "The ID of the window the selected tab changed inside of."
    896               }
    897             }
    898           }
    899         ]
    900       },
    901       {
    902         "name": "onActiveChanged",
    903         "deprecated": "Please use $(ref:tabs.onActivated).",
    904         "type": "function",
    905         "description": "Fires when the selected 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 to $(ref:tabs.onUpdated) events to be notified when a URL is set.",
    906         "parameters": [
    907           {
    908             "type": "integer",
    909             "name": "tabId",
    910             "minimum": 0,
    911             "description": "The ID of the tab that has become active."
    912           },
    913           {
    914             "type": "object",
    915             "name": "selectInfo",
    916             "properties": {
    917               "windowId": {
    918                 "type": "integer",
    919                 "minimum": 0,
    920                 "description": "The ID of the window the selected tab changed inside of."
    921               }
    922             }
    923           }
    924         ]
    925       },
    926       {
    927         "name": "onActivated",
    928         "type": "function",
    929         "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 to onUpdated events to be notified when a URL is set.",
    930         "parameters": [
    931           {
    932             "type": "object",
    933             "name": "activeInfo",
    934             "properties": {
    935               "tabId": {
    936                 "type": "integer",
    937                 "minimum": 0,
    938                 "description": "The ID of the tab that has become active."
    939               },
    940               "windowId": {
    941                 "type": "integer",
    942                 "minimum": 0,
    943                 "description": "The ID of the window the active tab changed inside of."
    944               }
    945             }
    946           }
    947         ]
    948       },
    949       {
    950         "name": "onHighlightChanged",
    951         "deprecated": "Please use $(ref:tabs.onHighlighted).",
    952         "type": "function",
    953         "description": "Fired when the highlighted or selected tabs in a window changes.",
    954         "parameters": [
    955           {
    956             "type": "object",
    957             "name": "selectInfo",
    958             "properties": {
    959               "windowId": {
    960                 "type": "integer",
    961                 "minimum": 0,
    962                 "description": "The window whose tabs changed."
    963               },
    964               "tabIds": {
    965                 "type": "array",
    966                 "name": "tabIds",
    967                 "items": {"type": "integer", "minimum": 0},
    968                 "description": "All highlighted tabs in the window."
    969               }
    970             }
    971           }
    972         ]
    973       },
    974       {
    975         "name": "onHighlighted",
    976         "type": "function",
    977         "description": "Fired when the highlighted or selected tabs in a window changes.",
    978         "parameters": [
    979           {
    980             "type": "object",
    981             "name": "highlightInfo",
    982             "properties": {
    983               "windowId": {
    984                 "type": "integer",
    985                 "minimum": 0,
    986                 "description": "The window whose tabs changed."
    987               },
    988               "tabIds": {
    989                 "type": "array",
    990                 "name": "tabIds",
    991                 "items": {"type": "integer", "minimum": 0},
    992                 "description": "All highlighted tabs in the window."
    993               }
    994             }
    995           }
    996         ]
    997       },
    998       {
    999         "name": "onDetached",
   1000         "type": "function",
   1001         "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
   1002         "parameters": [
   1003           {"type": "integer", "name": "tabId", "minimum": 0},
   1004           {
   1005             "type": "object",
   1006             "name": "detachInfo",
   1007             "properties": {
   1008               "oldWindowId": {"type": "integer", "minimum": 0},
   1009               "oldPosition": {"type": "integer", "minimum": 0}
   1010             }
   1011           }
   1012         ]
   1013       },
   1014       {
   1015         "name": "onAttached",
   1016         "type": "function",
   1017         "description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
   1018         "parameters": [
   1019           {"type": "integer", "name": "tabId", "minimum": 0},
   1020           {
   1021             "type": "object",
   1022             "name": "attachInfo",
   1023             "properties": {
   1024               "newWindowId": {"type": "integer", "minimum": 0},
   1025               "newPosition": {"type": "integer", "minimum": 0}
   1026             }
   1027           }
   1028         ]
   1029       },
   1030       {
   1031         "name": "onRemoved",
   1032         "type": "function",
   1033         "description": "Fired when a tab is closed.",
   1034         "parameters": [
   1035           {"type": "integer", "name": "tabId", "minimum": 0},
   1036           {
   1037             "type": "object",
   1038             "name": "removeInfo",
   1039             "properties": {
   1040               "windowId": {"type": "integer", "minimum": 0, "description": "The window whose tab is closed." },
   1041               "isWindowClosing": {"type": "boolean", "description": "True when the tab is being closed because its window is being closed." }
   1042             }
   1043           }
   1044         ]
   1045       },
   1046       {
   1047         "name": "onReplaced",
   1048         "type": "function",
   1049         "description": "Fired when a tab is replaced with another tab due to prerendering or instant.",
   1050         "parameters": [
   1051           {"type": "integer", "name": "addedTabId", "minimum": 0},
   1052           {"type": "integer", "name": "removedTabId", "minimum": 0}
   1053         ]
   1054       },
   1055       {
   1056         "name": "onZoomChange",
   1057         "type": "function",
   1058         "description": "Fired when a tab is zoomed.",
   1059         "parameters": [{
   1060           "type": "object",
   1061           "name": "ZoomChangeInfo",
   1062           "properties": {
   1063             "tabId": {"type": "integer", "minimum": 0},
   1064             "oldZoomFactor": {"type": "number"},
   1065             "newZoomFactor": {"type": "number"},
   1066             "zoomSettings": {"$ref": "ZoomSettings"}
   1067           }
   1068         }]
   1069       }
   1070     ]
   1071   }
   1072 ]
   1073