Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / common / extensions / api / tabs.json
blob879c1b84efcdda8f9beb4c6f0fc0e772c79e9bf7
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.
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": "InjectDetails",
35         "type": "object",
36         "description": "Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.",
37         "properties": {
38           "code": {"type": "string", "optional": true, "description": "JavaScript or CSS code to inject.<br><br><b>Warning:</b><br>Be careful using the <code>code</code> parameter. Incorrect use of it may open your extension to <a href=\"https://en.wikipedia.org/wiki/Cross-site_scripting\">cross site scripting</a> attacks."},
39           "file": {"type": "string", "optional": true, "description": "JavaScript or CSS file to inject."},
40           "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is <code>true</code>, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame."},
41           "runAt": {
42             "type": "string",
43             "optional": true,
44             "enum": ["document_start", "document_end", "document_idle"],
45             "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
46           }
47         }
48       }
49     ],
50     "functions": [
51       {
52         "name": "get",
53         "type": "function",
54         "description": "Retrieves details about the specified tab.",
55         "parameters": [
56           {
57             "type": "integer",
58             "name": "tabId",
59             "minimum": 0
60           },
61           {
62             "type": "function",
63             "name": "callback",
64             "parameters": [
65               {"name": "tab", "$ref": "Tab"}
66             ]
67           }
68         ]
69       },
70       {
71         "name": "getCurrent",
72         "type": "function",
73         "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).",
74         "parameters": [
75           {
76             "type": "function",
77             "name": "callback",
78             "parameters": [
79               {
80                 "name": "tab",
81                 "$ref": "Tab",
82                 "optional": true
83               }
84             ]
85           }
86         ]
87       },
88       {
89         "name": "connect",
90         "nocompile": true,
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 the specified tab for the current extension. For more details, see <a href='messaging.html'>Content Script Messaging</a>.",
93         "parameters": [
94           {
95             "type": "integer",
96             "name": "tabId",
97             "minimum": 0
98           },
99           {
100             "type": "object",
101             "name": "connectInfo",
102             "properties": {
103               "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connection event." }
104             },
105             "optional": true
106           }
107         ],
108         "returns": {
109           "$ref": "runtime.Port",
110           "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. "
111         }
112       },
113       {
114         "name": "sendRequest",
115         "deprecated": "Please use $(ref:runtime.sendMessage).",
116         "nocompile": true,
117         "type": "function",
118         "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.",
119         "parameters": [
120           {
121             "type": "integer",
122             "name": "tabId",
123             "minimum": 0
124           },
125           {
126             "type": "any",
127             "name": "request"
128           },
129           {
130             "type": "function",
131             "name": "responseCallback",
132             "optional": true,
133             "parameters": [
134               {
135                 "name": "response",
136                 "type": "any",
137                 "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."
138               }
139             ]
140           }
141         ]
142       },
143       {
144         "name": "sendMessage",
145         "nocompile": true,
146         "type": "function",
147         "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.",
148         "parameters": [
149           {
150             "type": "integer",
151             "name": "tabId",
152             "minimum": 0
153           },
154           {
155             "type": "any",
156             "name": "message"
157           },
158           {
159             "type": "function",
160             "name": "responseCallback",
161             "optional": true,
162             "parameters": [
163               {
164                 "name": "response",
165                 "type": "any",
166                 "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."
167               }
168             ]
169           }
170         ]
171       },
172       {
173         "name": "getSelected",
174         "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.",
175         "type": "function",
176         "description": "Gets the tab that is selected in the specified window.",
177         "parameters": [
178           {
179             "type": "integer",
180             "name": "windowId",
181             "minimum": -2,
182             "optional": true,
183             "description": "Defaults to the <a href='windows.html#current-window'>current window</a>."
184           },
185           {
186             "type": "function",
187             "name": "callback",
188             "parameters": [
189               {"name": "tab", "$ref": "Tab"}
190             ]
191           }
192         ]
193       },
194       {
195         "name": "getAllInWindow",
196         "type": "function",
197         "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</code>.",
198         "description": "Gets details about all tabs in the specified window.",
199         "parameters": [
200           {
201             "type": "integer",
202             "name": "windowId",
203             "minimum": -2,
204             "optional": true,
205             "description": "Defaults to the <a href='windows.html#current-window'>current window</a>."
206             },
207           {
208             "type": "function",
209             "name": "callback",
210             "parameters": [
211               {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } }
212             ]
213           }
214         ]
215       },
216       {
217         "name": "create",
218         "type": "function",
219         "description": "Creates a new tab.",
220         "parameters": [
221           {
222             "type": "object",
223             "name": "createProperties",
224             "properties": {
225               "windowId": {
226                 "type": "integer",
227                 "minimum": -2,
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>."
230               },
231               "index": {
232                 "type": "integer",
233                 "minimum": 0,
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."
236               },
237               "url": {
238                 "type": "string",
239                 "optional": true,
240                 "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."
241               },
242               "active": {
243                 "type": "boolean",
244                 "optional": true,
245                 "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>."
246               },
247               "selected": {
248                 "deprecated": "Please use <em>active</em>.",
249                 "type": "boolean",
250                 "optional": true,
251                 "description": "Whether the tab should become the selected tab in the window. Defaults to <var>true</var>"
252               },
253               "pinned": {
254                 "type": "boolean",
255                 "optional": true,
256                 "description": "Whether the tab should be pinned. Defaults to <var>false</var>"
257               },
258               "openerTabId": {
259                 "type": "integer",
260                 "minimum": 0,
261                 "optional": true,
262                 "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."
263               }
264             }
265           },
266           {
267             "type": "function",
268             "name": "callback",
269             "optional": true,
270             "parameters": [
271               {
272                 "name": "tab",
273                 "$ref": "Tab",
274                 "description": "Details about the created tab. Will contain the ID of the new tab."
275               }
276             ]
277           }
278         ]
279       },
280       {
281         "name": "duplicate",
282         "type": "function",
283         "description": "Duplicates a tab.",
284         "parameters": [
285           {
286             "type": "integer",
287             "name": "tabId",
288             "minimum": 0,
289             "description": "The ID of the tab which is to be duplicated."
290           },
291           {
292             "type": "function",
293             "name": "callback",
294             "optional": true,
295             "parameters": [
296               {
297                 "name": "tab",
298                 "optional": true,
299                 "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.",
300                 "$ref": "Tab"
301               }
302             ]
303           }
304         ]
305       },
306       {
307         "name": "query",
308         "type": "function",
309         "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
310         "parameters": [
311           {
312             "type": "object",
313             "name": "queryInfo",
314             "properties": {
315               "active": {
316                 "type": "boolean",
317                 "optional": true,
318                 "description": "Whether the tabs are active in their windows."
319               },
320               "pinned": {
321                 "type": "boolean",
322                 "optional": true,
323                 "description": "Whether the tabs are pinned."
324               },
325               "highlighted": {
326                 "type": "boolean",
327                 "optional": true,
328                 "description": "Whether the tabs are highlighted."
329               },
330               "currentWindow": {
331                 "type": "boolean",
332                 "optional": true,
333                 "description": "Whether the tabs are in the <a href='windows.html#current-window'>current window</a>."
334               },
335               "lastFocusedWindow": {
336                 "type": "boolean",
337                 "optional": true,
338                 "description": "Whether the tabs are in the last focused window."
339               },
340               "status": {
341                 "type": "string",
342                 "optional": true,
343                 "enum": ["loading", "complete"],
344                 "description": "Whether the tabs have completed loading."
345               },
346               "title": {
347                 "type": "string",
348                 "optional": true,
349                 "description": "Match page titles against a pattern."
350               },
351               "url": {
352                 "type": "string",
353                 "optional": true,
354                 "description": "Match tabs against a <a href='match_patterns.html'>URL pattern</a>. Note that fragment identifiers are not matched."
355               },
356               "windowId": {
357                 "type": "integer",
358                 "optional": true,
359                 "minimum": -2,
360                 "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the <a href='windows.html#current-window'>current window</a>."
361               },
362               "windowType": {
363                 "type": "string",
364                 "optional": true,
365                 "enum": ["normal", "popup", "panel", "app"],
366                 "description": "The type of window the tabs are in."
367               },
368               "index": {
369                 "type": "integer",
370                 "optional": true,
371                 "minimum": 0,
372                 "description": "The position of the tabs within their windows."
373               }
374             }
375           },
376           {
377             "type": "function",
378             "name": "callback",
379             "parameters": [
380               {
381                 "name": "result",
382                 "type": "array",
383                 "items": {
384                   "$ref": "Tab"
385                 }
386               }
387             ]
388           }
389         ]
390       },
391       {
392         "name": "highlight",
393         "type": "function",
394         "description": "Highlights the given tabs.",
395         "parameters": [
396           {
397             "type": "object",
398             "name": "highlightInfo",
399             "properties": {
400                "windowId": {
401                  "type": "integer",
402                  "optional": true,
403                  "description": "The window that contains the tabs.",
404                  "minimum": -2
405                },
406                "tabs": {
407                  "description": "One or more tab indices to highlight.",
408                  "choices": [
409                    {"type": "array", "items": {"type": "integer", "minimum": 0}},
410                    {"type": "integer"}
411                  ]
412                }
413              }
414            },
415            {
416              "type": "function",
417              "name": "callback",
418              "parameters": [
419                {
420                  "name": "window",
421                  "$ref": "windows.Window",
422                  "description": "Contains details about the window whose tabs were highlighted."
423                }
424              ]
425            }
426         ]
427       },
428       {
429         "name": "update",
430         "type": "function",
431         "description": "Modifies the properties of a tab. Properties that are not specified in <var>updateProperties</var> are not modified.",
432         "parameters": [
433           {
434             "type": "integer",
435             "name": "tabId",
436             "minimum": 0,
437             "optional": true,
438             "description": "Defaults to the selected tab of the <a href='windows.html#current-window'>current window</a>."
439           },
440           {
441             "type": "object",
442             "name": "updateProperties",
443             "properties": {
444               "url": {
445                 "type": "string",
446                 "optional": true,
447                 "description": "A URL to navigate the tab to."
448               },
449               "active": {
450                 "type": "boolean",
451                 "optional": true,
452                 "description": "Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update))."
453               },
454               "highlighted": {
455                 "type": "boolean",
456                 "optional": true,
457                 "description": "Adds or removes the tab from the current selection."
458               },
459               "selected": {
460                 "deprecated": "Please use <em>highlighted</em>.",
461                 "type": "boolean",
462                 "optional": true,
463                 "description": "Whether the tab should be selected."
464               },
465               "pinned": {
466                 "type": "boolean",
467                 "optional": true,
468                 "description": "Whether the tab should be pinned."
469               },
470               "openerTabId": {
471                 "type": "integer",
472                 "minimum": 0,
473                 "optional": true,
474                 "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab."
475               }
476             }
477           },
478           {
479             "type": "function",
480             "name": "callback",
481             "optional": true,
482             "parameters": [
483               {
484                 "name": "tab",
485                 "$ref": "Tab",
486                 "optional": true,
487                 "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."
488               }
489             ]
490           }
491         ]
492       },
493       {
494         "name": "move",
495         "type": "function",
496         "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.",
497         "parameters": [
498           {
499             "name": "tabIds",
500             "description": "The tab or list of tabs to move.",
501             "choices": [
502               {"type": "integer", "minimum": 0},
503               {"type": "array", "items": {"type": "integer", "minimum": 0}}
504             ]
505           },
506           {
507             "type": "object",
508             "name": "moveProperties",
509             "properties": {
510               "windowId": {
511                 "type": "integer",
512                 "minimum": -2,
513                 "optional": true,
514                 "description": "Defaults to the window the tab is currently in."
515               },
516               "index": {
517                 "type": "integer",
518                 "minimum": -1,
519                 "description": "The position to move the window to. -1 will place the tab at the end of the window."
520               }
521             }
522           },
523           {
524             "type": "function",
525             "name": "callback",
526             "optional": true,
527             "parameters": [
528               {
529                 "name": "tabs",
530                 "description": "Details about the moved tabs.",
531                 "choices": [
532                   {"$ref": "Tab"},
533                   {"type": "array", "items": {"$ref": "Tab"}}
534                 ]
535               }
536             ]
537           }
538         ]
539       },
540       {
541         "name": "reload",
542         "type": "function",
543         "description": "Reload a tab.",
544         "parameters": [
545           {"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."},
546           {
547             "type": "object",
548             "name": "reloadProperties",
549             "optional": true,
550             "properties": {
551               "bypassCache": {
552                 "type": "boolean",
553                 "optional": true,
554                 "description": "Whether using any local cache. Default is false."
555               }
556             }
557           },
558           {"type": "function", "name": "callback", "optional": true, "parameters": []}
559         ]
560       },
561       {
562         "name": "remove",
563         "type": "function",
564         "description": "Closes one or more tabs.",
565         "parameters": [
566           {
567             "name": "tabIds",
568             "description": "The tab or list of tabs to close.",
569             "choices": [
570               {"type": "integer", "minimum": 0},
571               {"type": "array", "items": {"type": "integer", "minimum": 0}}
572             ]
573           },
574           {"type": "function", "name": "callback", "optional": true, "parameters": []}
575         ]
576       },
577       {
578         "name": "detectLanguage",
579         "type": "function",
580         "description": "Detects the primary language of the content in a tab.",
581         "parameters": [
582           {
583             "type": "integer",
584             "name": "tabId",
585             "minimum": 0,
586             "optional": true,
587             "description": "Defaults to the active tab of the <a href='windows.html#current-window'>current window</a>."
588           },
589           {
590             "type": "function",
591             "name": "callback",
592             "parameters": [
593               {
594                 "type": "string",
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/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."
597               }
598             ]
599           }
600         ]
601       },
602       {
603         "name": "captureVisibleTab",
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'>&lt;all_urls&gt;</a> permission to use this method.",
606         "parameters": [
607           {
608             "type": "integer",
609             "name": "windowId",
610             "minimum": -2,
611             "optional": true,
612             "description": "The target window. Defaults to the <a href='windows.html#current-window'>current window</a>."
613           },
614           {
615             "$ref": "types.ImageDetails",
616             "name": "options",
617             "optional": true
618           },
619           {
620             "type": "function", "name": "callback", "parameters": [
621               {"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."}
622             ]
623           }
624         ]
625       },
626       {
627         "name": "executeScript",
628         "type": "function",
629         "description": "Injects JavaScript code into a page. For details, see the <a href='content_scripts.html#pi'>programmatic injection</a> section of the content scripts doc.",
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 active tab of the current window."},
632           {
633             "$ref": "tabs.InjectDetails",
634             "name": "details",
635             "description": "Details of the script to run."
636           },
637           {
638             "type": "function",
639             "name": "callback",
640             "optional": true,
641             "description": "Called after all the JavaScript has been executed.",
642             "parameters": [
643               {
644                 "name": "result",
645                 "optional": true,
646                 "type": "array",
647                 "items": {"type": "any", "minimum": 0},
648                 "description": "The result of the script in every injected frame."
649               }
650             ]
651           }
652         ]
653       },
654       {
655         "name": "insertCSS",
656         "type": "function",
657         "description": "Injects CSS into a page. For details, see the <a href='content_scripts.html#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 insert the CSS; defaults to the active tab of the current window."},
660           {
661             "$ref": "tabs.InjectDetails",
662             "name": "details",
663             "description": "Details of the CSS text to insert."
664           },
665           {
666             "type": "function",
667             "name": "callback",
668             "optional": true,
669             "description": "Called when all the CSS has been inserted.",
670             "parameters": []
671           }
672         ]
673       }
674     ],
675     "events": [
676       {
677         "name": "onCreated",
678         "type": "function",
679         "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.",
680         "parameters": [
681           {
682             "$ref": "Tab",
683             "name": "tab",
684             "description": "Details of the tab that was created."
685           }
686         ]
687       },
688       {
689         "name": "onUpdated",
690         "type": "function",
691         "description": "Fired when a tab is updated.",
692         "parameters": [
693           {"type": "integer", "name": "tabId", "minimum": 0},
694           {
695             "type": "object",
696             "name": "changeInfo",
697             "description": "Lists the changes to the state of the tab that was updated.",
698             "properties": {
699               "status": {
700                 "type": "string",
701                 "optional": true,
702                 "description": "The status of the tab. Can be either <em>loading</em> or <em>complete</em>."
703               },
704               "url": {
705                 "type": "string",
706                 "optional": true,
707                 "description": "The tab's URL if it has changed."
708               },
709               "pinned": {
710                 "type": "boolean",
711                 "optional": true,
712                 "description": "The tab's new pinned state."
713               },
714               "favIconUrl": {
715                 "type": "string",
716                 "optional": true,
717                 "description": "The tab's new favicon URL."
718               }
719             }
720           },
721           {
722             "$ref": "Tab",
723             "name": "tab",
724             "description": "Gives the state of the tab that was updated."
725           }
726         ]
727       },
728       {
729         "name": "onMoved",
730         "type": "function",
731         "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).",
732         "parameters": [
733           {"type": "integer", "name": "tabId", "minimum": 0},
734           {
735             "type": "object",
736             "name": "moveInfo",
737             "properties": {
738               "windowId": {"type": "integer", "minimum": 0},
739               "fromIndex": {"type": "integer", "minimum": 0},
740               "toIndex": {"type": "integer", "minimum": 0}
741             }
742           }
743         ]
744       },
745       {
746         "name": "onSelectionChanged",
747         "deprecated": "Please use $(ref:tabs.onActivated).",
748         "type": "function",
749         "description": "Fires when the selected tab in a window changes.",
750         "parameters": [
751           {
752             "type": "integer",
753             "name": "tabId",
754             "minimum": 0,
755             "description": "The ID of the tab that has become active."
756           },
757           {
758             "type": "object",
759             "name": "selectInfo",
760             "properties": {
761               "windowId": {
762                 "type": "integer",
763                 "minimum": 0,
764                 "description": "The ID of the window the selected tab changed inside of."
765               }
766             }
767           }
768         ]
769       },
770       {
771         "name": "onActiveChanged",
772         "deprecated": "Please use $(ref:tabs.onActivated).",
773         "type": "function",
774         "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.",
775         "parameters": [
776           {
777             "type": "integer",
778             "name": "tabId",
779             "minimum": 0,
780             "description": "The ID of the tab that has become active."
781           },
782           {
783             "type": "object",
784             "name": "selectInfo",
785             "properties": {
786               "windowId": {
787                 "type": "integer",
788                 "minimum": 0,
789                 "description": "The ID of the window the selected tab changed inside of."
790               }
791             }
792           }
793         ]
794       },
795       {
796         "name": "onActivated",
797         "type": "function",
798         "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.",
799         "parameters": [
800           {
801             "type": "object",
802             "name": "activeInfo",
803             "properties": {
804               "tabId": {
805                 "type": "integer",
806                 "minimum": 0,
807                 "description": "The ID of the tab that has become active."
808               },
809               "windowId": {
810                 "type": "integer",
811                 "minimum": 0,
812                 "description": "The ID of the window the active tab changed inside of."
813               }
814             }
815           }
816         ]
817       },
818       {
819         "name": "onHighlightChanged",
820         "deprecated": "Please use $(ref:tabs.onHighlighted).",
821         "type": "function",
822         "description": "Fired when the highlighted or selected tabs in a window changes.",
823         "parameters": [
824           {
825             "type": "object",
826             "name": "selectInfo",
827             "properties": {
828               "windowId": {
829                 "type": "integer",
830                 "minimum": 0,
831                 "description": "The window whose tabs changed."
832               },
833               "tabIds": {
834                 "type": "array",
835                 "name": "tabIds",
836                 "items": {"type": "integer", "minimum": 0},
837                 "description": "All highlighted tabs in the window."
838               }
839             }
840           }
841         ]
842       },
843       {
844         "name": "onHighlighted",
845         "type": "function",
846         "description": "Fired when the highlighted or selected tabs in a window changes.",
847         "parameters": [
848           {
849             "type": "object",
850             "name": "highlightInfo",
851             "properties": {
852               "windowId": {
853                 "type": "integer",
854                 "minimum": 0,
855                 "description": "The window whose tabs changed."
856               },
857               "tabIds": {
858                 "type": "array",
859                 "name": "tabIds",
860                 "items": {"type": "integer", "minimum": 0},
861                 "description": "All highlighted tabs in the window."
862               }
863             }
864           }
865         ]
866       },
867       {
868         "name": "onDetached",
869         "type": "function",
870         "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
871         "parameters": [
872           {"type": "integer", "name": "tabId", "minimum": 0},
873           {
874             "type": "object",
875             "name": "detachInfo",
876             "properties": {
877               "oldWindowId": {"type": "integer", "minimum": 0},
878               "oldPosition": {"type": "integer", "minimum": 0}
879             }
880           }
881         ]
882       },
883       {
884         "name": "onAttached",
885         "type": "function",
886         "description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
887         "parameters": [
888           {"type": "integer", "name": "tabId", "minimum": 0},
889           {
890             "type": "object",
891             "name": "attachInfo",
892             "properties": {
893               "newWindowId": {"type": "integer", "minimum": 0},
894               "newPosition": {"type": "integer", "minimum": 0}
895             }
896           }
897         ]
898       },
899       {
900         "name": "onRemoved",
901         "type": "function",
902         "description": "Fired when a tab is closed.",
903         "parameters": [
904           {"type": "integer", "name": "tabId", "minimum": 0},
905           {
906             "type": "object",
907             "name": "removeInfo",
908             "properties": {
909               "windowId": {"type": "integer", "minimum": 0, "description": "The window whose tab is closed." },
910               "isWindowClosing": {"type": "boolean", "description": "True when the tab is being closed because its window is being closed." }
911             }
912           }
913         ]
914       },
915       {
916         "name": "onReplaced",
917         "type": "function",
918         "description": "Fired when a tab is replaced with another tab due to prerendering or instant.",
919         "parameters": [
920           {"type": "integer", "name": "addedTabId", "minimum": 0},
921           {"type": "integer", "name": "removedTabId", "minimum": 0}
922         ]
923       }
924     ]
925   }