summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/extension_api.json
blob: ab44b7de5e52e6725deea3bd7cc3b3bceaf3c56c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
[
  {
    "namespace": "extension",
    "types": [
      {
        "id": "Port",
        "type": "object",
        "description": "An object which allows two way communication with other pages.",
        "properties": {
          "name": {"type": "string"},
          "onDisconnect": {"type": "object"},
          "onMessage": {"type": "object"},
          "postMessage": {"type": "function"},
          "sender": {
            "type": "object",
            "optional": true,
            "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners.",
            "properties": {
              "tab": {"$ref": "Tab", "optional": true, "description":"This property will <b>only</b> be present when the connection was opened from a tab or content script."},
              "id": {"type": "string", "description": "The extension ID of the extension that opened the connection."}
            }
          }
        }
      }
    ],
    "properties": {
      "lastError": {
        "type": "object",
        "optional": true,
        "description": "Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be <var>undefined</var>.",
        "properties": {
          "message": { "type": "string", "description": "Description of the error that has taken place." }
        }
      }
    },
    "functions": [
      {
        "name": "connect",
        "type": "function",
        "description": "Attempts to connect to other listeners within the extension (listeners may be toolstrips or the extension's background page). This is primarily useful for content scripts connecting to their extension processes. Extensions may connect to content scripts embedded in tabs via <a href='broken'><var>chrome.tabs.connectToTab</var></a>.",
        "parameters": [
          {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
          {
            "type": "object",
            "name": "connectInfo",
            "properties": {
              "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for extension processes that are listening for the connection event." }
            },
            "optional": true
          }
        ],
        "returns": {
          "$ref": "Port",
          "description": "Port through which messages can be sent and received with the extension."
        }
      },
      {
        "name": "sendRequest",
        "type": "function",
        "description": "Sends a single request to other listeners within the extension. Similar to chrome.extension.connect, but only sends a single request with an optional response.",
        "parameters": [
          {"type": "string", "name": "extensionId", "optional": true, "description": "The extension ID of the extension you want to connect to. If omitted, default is your own extension."},
          { "type": "any", "name": "request" },
          {
            "type": "function",
            "name": "responseCallback",
            "optional": true
          }
        ]
      },
      {
        "name": "getURL",
        "type": "function",
        "description": "Convert a relative path within an extension install directory to a fully-qualified URL.",
        "parameters": [
          {
            "type": "string",
            "name": "path",
            "description": "A path to a resource within an extension expressed relative to it's install directory."
          }
        ],
        "returns": {
          "type": "string",
          "description": "The fully-qualified URL to the resource."
        }
      },
      {
        "name": "getViews",
        "type": "function",
        "description": "Returns an array of the global JavaScript objects for each of the views running inside the current extension. This includes toolstrips, background pages, and tabs.",
        "parameters": [],
        "returns": {
          "type": "array",
          "description": "Array of global objects",
          "items": { "type": "object" }
        }
      },
      {
        "name": "getBackgroundPage",
        "type": "function",
        "description": "Returns the global JavaScript object for the background page running inside the current extension. Returns null if the extension has no backround page.",
        "parameters": [],
        "returns": {
          "type": "object"
        }
      },
      {
        "name": "getToolstrips",
        "type": "function",
        "description": "Returns an array of the global JavaScript objects for each of the toolstrip views running inside the current extension. If windowId is specified, returns only the toolstrips attached to the specified window.",
        "parameters": [
          {"type": "integer", "name": "windowId", "optional": true}
        ],
        "returns": {
          "type": "array",
          "description": "Array of global objects",
          "items": { "type": "object" }
        }
      },
      {
        "name": "getTabContentses",
        "type": "function",
        "description": "Returns an array of the global JavaScript objects for each of the tab contents views running inside the current extension. If windowId is specified, returns only the tab contentses attached to the specified window.",
        "parameters": [
          {"type": "integer", "name": "windowId", "optional": true}
        ],
        "returns": {
          "type": "array",
          "description": "Array of global objects",
          "items": { "type": "object" }
        }
      }
    ],
    "events": [
      {
        "name": "onConnect",
        "type": "function",
        "description": "Fired when a connection is made from either an extension process or a content script.",
        "parameters": [
          {"$ref": "Port", "name": "port"}
        ]
      },
      {
        "name": "onConnectExternal",
        "type": "function",
        "description": "Fired when a connection is made from another extension.",
        "parameters": [
          {"$ref": "Port", "name": "port"}
        ]
      },
      {
        "name": "onRequest",
        "type": "function",
        "description": "Fired when a request is sent from either an extension process or a content script.",
        "parameters": [
          { "type": "any", "name": "request" },
          { "type": "function", "name": "sendResponse", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
        ]
      },
      {
        "name": "onRequestExternal",
        "type": "function",
        "description": "Fired when a request is sent from another extension.",
        "parameters": [
          { "type": "any", "name": "request" },
          { "type": "function", "name": "sendResponse", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
        ]
      }
    ]
  },
  {
    "namespace": "windows",
    "types": [
      {
        "id": "Window",
        "type": "object",
        "properties": {
          "id": {"type": "integer", "minimum": 0, "description": "The ID of the window. Window IDs are unique within a browser session."},
          "focused": {"type": "boolean", "description": "Whether the window is currently the focused window."},
          "top": {"type": "integer", "description": "The offset of the window from the top edge of the screen in pixels."},
          "left": {"type": "integer", "description": "The offset of the window from the left edge of the screen in pixels."},
          "width": {"type": "integer", "description": "The width of the window in pixels."},
          "height": {"type": "integer", "description": "The height of the window in pixels."},
          "tabs": {"type": "array", "items": { "$ref": "Tab" }, "optional": true, "description": "Array of <a href='tabs.html#type-Tab'>Tab</a> objects representing the current tabs in the window."}
        }
      }
    ],
    "functions": [
      {
        "name": "get",
        "type": "function",
        "description": "Gets details about a window.",
        "parameters": [
          {"type": "integer", "name": "windowId", "minimum": 0},
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "window", "$ref": "Window"
              }
            ]
          }
        ]
      },
      {
        "name": "getCurrent",
        "type": "function",
        "description": "Gets the <a href='#current-window'>current window</a>.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "window", "$ref": "Window"
              }
            ]
          }
        ]
      },
      {
        "name": "getLastFocused",
        "type": "function",
        "description": "Get the window that was most recently focused -- typically the window 'on top'.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "window", "$ref": "Window"
              }
            ]
          }
        ]
      },
      {
        "name": "getAll",
        "type": "function",
        "description": "Get all windows.",
        "parameters": [
          {
            "type": "object",
            "name": "getInfo",
            "optional": true,
            "description": "",
            "properties": {
              "populate": {"type": "boolean", "optional": true, "description": "If true, each window object will have a <var>tabs</var> property that contains a list of the <a href='tabs.html#type-Tab'>Tab</a> objects for that window." }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "name": "windows", "type": "array", "items": { "$ref": "Window" }
              }
            ]
          }
        ]
      },
      {
        "name": "create",
        "type": "function",
        "description": "Create (open) a new browser with any optional sizing, position or default url provided.",
        "parameters": [
          {
            "type": "object",
            "name": "createData",
            "properties": {
              "url": {"type": "string", "optional": true, "description": "The URL to navigate the first tab to. 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."},
              "left": {"type": "integer", "optional": true, "description": "The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focusd window."},
              "top": {"type": "integer", "optional": true, "description": "The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focusd window."},
              "width": {"type": "integer", "minimum": 0, "optional": true, "description": "The width in pixels of the new window. If not specified defaults to a natural width."},
              "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height in pixels of the new window. If not specified defaults to a natural height."}
            },
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "window", "$ref": "Window", "description": "Contains details about the created window."
              }
            ]
          }
        ]
      },
      {
        "name": "update",
        "type": "function",
        "description": "Update the properties of a window. Only specify the properties that you want to change, unspecified properties will be left unchanged.",
        "parameters": [
          {"type": "integer", "name": "windowId", "minimum": 0},
          {
            "type": "object",
            "name": "updateInfo",
            "properties": {
              "left": {"type": "integer", "optional": true, "description": "The offset from the left edge of the screen to move the window to in pixels."},
              "top": {"type": "integer", "optional": true, "description": "The offset from the top edge of the screen to move the window to in pixels."},
              "width": {"type": "integer", "minimum": 0, "optional": true, "description": "The width to resize the window to in pixels."},
              "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height to resize the window to in pixels."}
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "window", "$ref": "Window"
              }
            ]
          }
        ]
      },
      {
        "name": "remove",
        "type": "function",
        "description": "Removes (closes) a window, and all the tabs inside it.",
        "parameters": [
          {"type": "integer", "name": "windowId", "minimum": 0},
          {"type": "function", "name": "callback", "optional": true, "parameters": []}
        ]
      }
    ],
    "events": [
      {
        "name": "onCreated",
        "type": "function",
        "description": "Fired when a window is created.",
        "parameters": [
          {
            "$ref": "Window",
            "name": "window",
            "description": "Details of the window that was created."
          }
        ]
      },
      {
        "name": "onRemoved",
        "type": "function",
        "description": "Fired when a window is removed (closed).",
        "parameters": [
          {"type": "integer", "name": "windowId", "minimum": 0, "description": "ID of the removed window."}
        ]
      },
      {
        "name": "onFocusChanged",
        "type": "function",
        "description": "Fired when the currently focused window changes.",
        "parameters": [
          {"type": "integer", "name": "windowId", "minimum": 0, "description": "ID of the newly focused window."}
        ]
      }
    ]
  },
  {
    "namespace": "tabs",
    "types": [
      {
        "id": "Tab",
        "type": "object",
        "properties": {
          "id": {"type": "integer", "minimum": 0, "description": "The ID of the tab. Tab IDs are unique within a browser session."},
          "index": {"type": "integer", "minimum": 0, "description": "The zero-based index of the tab within its window."},
          "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window the tab is contained within."},
          "selected": {"type": "boolean", "description": "Whether the tab is selected."},
          "url": {"type": "string", "description": "The URL the tab is displaying."},
          "title": {"type": "string", "optional": true, "description": "The title of the tab. This may not be available if the tab is loading."},
          "favIconUrl": {"type": "string", "optional": true, "description": "The URL of the tab's favicon. This may not be available if the tab is loading."},
          "status": {"type": "string", "optional": true, "description": "Either <em>loading</em> or <em>complete</em>."}
        }
      }
    ],
    "functions": [
      {
        "name": "get",
        "type": "function",
        "description": "Retrieves details about the specified tab.",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "tab", "$ref": "Tab"}
            ]
          }
        ]
      },
      {
        "name": "connect",
        "type": "function",
        "description": "Connects to the content script(s) in the specified tab. The <a href='extension.html#event-onConnect'>chrome.extension.onConnect</a> event is fired in each content script running in the specified tab for the current extension. For more details, see <a href='content_scripts.html#messaging'>Content Script Messaging</a>.",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "object",
            "name": "connectInfo",
            "properties": {
              "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connection event." }
            },
            "optional": true
          }
        ],
        "returns": {
          "$ref": "Port",
          "description": "A port that can be used to communicate with the content scripts running in the specified tab."
        }
      },
      {
        "name": "sendRequest",
        "type": "function",
        "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 <a href='extension.html#event-onRequest'>chrome.extension.onRequest</a> event is fired in each content script running in the specified tab for the current extension.",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0
          },
          {
            "type": "any",
            "name": "request"
          },
          {
            "type": "function",
            "name": "responseCallback",
            "optional": true
          }
        ]
      },
      {
        "name": "getSelected",
        "type": "function",
        "description": "Gets the tab that is selected in the specified window.",
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "minimum": 0,
            "optional": true,
            "description": "Defaults to the <a href='windows.html#current-window'>current window</a>."
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "tab", "$ref": "Tab"}
            ]
          }
        ]
      },
      {
        "name": "getAllInWindow",
        "type": "function",
        "description": "Gets details about all tabs in the specified window.",
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "minimum": 0,
            "optional": true,
            "description": "Defaults to the <a href='windows.html#current-window'>current window</a>."
            },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } }
            ]
          }
        ]
      },
      {
        "name": "create",
        "type": "function",
        "description": "Creates a new tab.",
        "parameters": [
          {
            "type": "object",
            "name": "createProperties",
            "properties": {
              "windowId": {
                "type": "integer",
                "minimum": 0,
                "optional": true,
                "description": "The window to create the new tab in. Defaults to the <a href='windows.html#current-window'>current window</a>."
              },
              "index": {
                "type": "integer",
                "minimum": 0,
                "optional": true,
                "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."
              },
              "url": {
                "type": "string",
                "optional": true,
                "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."
              },
              "selected": {
                "type": "boolean",
                "optional": true,
                "description": "Whether the tab should become the selected tab in the window. Defaults to <var>true</var>"
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "tab",
                "$ref": "Tab",
                "description": "Details about the created tab. Will contain the ID of the new tab."
              }
            ]
          }
        ]
      },
      {
        "name": "update",
        "type": "function",
        "description": "Modify the properties of a tab. Properties that are not specified in <var>updateProperties</var> are not modified.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {
            "type": "object",
            "name": "updateProperties",
            "properties": {
              "url": {"type": "string", "optional": true},
              "selected": {"type": "boolean", "optional": true}
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "tab",
                "$ref": "Tab",
                "description": "Details about the updated tab."
              }
            ]
          }
        ]
      },
      {
        "name": "move",
        "type": "function",
        "description": "Move a tab to a new position within its window, or to a new window.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {
            "type": "object",
            "name": "moveProperties",
            "properties": {
              "windowId": {
                "type": "integer",
                "minimum": 0,
                "optional": true,
                "description": "Defaults to the window the tab is currently in."
              },
              "index": {
                "type": "integer",
                "minimum": 0,
                "description": "The position to move the window to. The provided value will be clamped to between zero and the number of tabs in the window."
              }
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {
                "name": "tab",
                "$ref": "Tab",
                "description": "Details about the moved tab."
              }
            ]
          }
        ]
      },
      {
        "name": "remove",
        "type": "function",
        "description": "Closes a tab.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {"type": "function", "name": "callback", "optional": true, "parameters": []}
        ]
      },
      {
        "name": "detectLanguage",
        "type": "function",
        "description": "Detects the primary language of the content in a tab.",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0,
            "optional": true,
            "description": "Defaults to the selected tab of the <a href='windows.html#current-window'>current window</a>."
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {
                "type": "string",
                "name": "language",
                "description": "An ISO language code like <var>en</var> or <var>fr</var>. For the complete list of languages supported by this method, see 2nd column of kLanguageInfoTable in http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/bar/toolbar/cld/i18n/languages/internal/languages.cc"
              }
            ]
          }
        ]
      },
      {
        "name": "captureVisibleTab",
        "type": "function",
        "description": "Captures the visible area of the currently selected tab in the specified window.",
        "parameters": [
          {
            "type": "integer",
            "name": "windowId",
            "minimum": 0,
            "optional": true,
            "description": "The target window. Defaults to the <a href='windows.html#current-window'>current window</a>."
          },
          {
            "type": "function", "name": "callback", "parameters": [
              {"type": "string", "name": "dataUrl", "description": "A data URL of a JPEG encoding of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."}
            ]
          }
        ]
      },
      {
        "name": "executeScript",
        "type": "function",
        "description": "",
        "parameters": [
          {"type": "integer", "name": "tabId", "optional": true, "description": "The id of tab which run the script, default to selected tab of current window."},
          {
            "type": "object",
            "name": "scriptDef",
            "description": "Note:scripts are injected in the following definition order.",
            "properties": {
              "code": {"type": "string", "optional": true, "description": "JavaScript code to execute."},
              "file": {"type": "string", "optional": true, "description": "JavaScript file to execute."}
            },
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "When all scripts are executed, this callback is called.",
            "parameters": []
          }
        ],
        "returns": {
          "type": "boolean",
          "description": "Whether this call is successful"
        }
      },
      {
        "name": "insertCSS",
        "type": "function",
        "description": "",
        "parameters": [
          {"type": "integer", "name": "tabId", "optional": true, "description": "The id of tab which run the script, default to selected tab of current window."},
          {
            "type": "object",
            "name": "scriptDef",
            "description": "Note:css are injected in the following definition order.",
            "properties": {
              "code": {"type": "string", "optional": true, "description": "CSS code to be injected."},
              "file": {"type": "string", "optional": true, "description": "CSS file to be injected."}
            },
            "optional": true
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "When all css are inserted, this callback is called.",
            "parameters": []
          }
        ],
        "returns": {
          "type": "boolean",
          "description": "Whether this call is successful"
        }
      }
    ],
    "events": [
      {
        "name": "onCreated",
        "type": "function",
        "description": "Fires when a tab is created.",
        "parameters": [
          {
            "$ref": "Tab",
            "name": "tab",
            "description": "Details of the tab that was created."
          }
        ]
      },
      {
        "name": "onUpdated",
        "type": "function",
        "description": "Fires when a tab is updated.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {
            "type": "object",
            "name": "changeInfo",
            "properties": {
              "status": {
                "type": "string",
                "description": "The status of the tab. Can be either <em>loading</em> or <em>complete</em>."
              },
              "url": {
                "type": "string",
                "optional": true,
                "description": "Only specified if the tab's URL changed."
              }
            }
          }
        ]
      },
      {
        "name": "onMoved",
        "type": "function",
        "description": "Fires 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 <a href='#event-onDetached'>onDetached</a>.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {
            "type": "object",
            "name": "moveInfo",
            "properties": {
              "windowId": {"type": "integer", "minimum": 0},
              "fromIndex": {"type": "integer", "minimum": 0},
              "toIndex": {"type": "integer", "minimum": 0}
            }
          }
        ]
      },
      {
        "name": "onSelectionChanged",
        "type": "function",
        "description": "Fires when the selected tab in a window changes.",
        "parameters": [
          {
            "type": "integer",
            "name": "tabId",
            "minimum": 0,
            "description": "The ID of the tab that has become selected."
          },
          {
            "type": "object",
            "name": "selectInfo",
            "properties": {
              "windowId": {
                "type": "integer",
                "minimum": 0,
                "description": "The ID of the window the selected tab changed inside of."
              }
            }
          }
        ]
      },
      {
        "name": "onDetached",
        "type": "function",
        "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {
            "type": "object",
            "name": "detachInfo",
            "properties": {
              "oldWindowId": {"type": "integer", "minimum": 0},
              "oldPosition": {"type": "integer", "minimum": 0}
            }
          }
        ]
      },
      {
        "name": "onAttached",
        "type": "function",
        "description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0},
          {
            "type": "object",
            "name": "attachInfo",
            "properties": {
              "newWindowId": {"type": "integer", "minimum": 0},
              "newPosition": {"type": "integer", "minimum": 0}
            }
          }
        ]
      },
      {
        "name": "onRemoved",
        "type": "function",
        "description": "Fires when a tab is closed.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0}
        ]
      }
    ]
  },
  {
    "namespace": "pageActions",
    "types": [],
    "functions": [
      {
        "name": "enableForTab",
        "type": "function",
        "description": "Enables a page action for a particular tab+url combination (makes its icon visible in the OmniBox when a certain url is active in a given tab). The page action will automatically be disabled (its icon hidden) if the user navigates to a new URL or closes the tab. The action will also automatically be enabled/disabled as the user switches tabs.",
        "parameters": [
          {"type": "string", "name": "pageActionId", "description": "An extension can have multiple page actions specified in the manifest, each with a unique identifier. This string identifies which page action you want to enable (and must match a page action id declared in the manifest)."},
          {
            "type": "object",
            "name": "action",
            "description": "An object specifing what action should be applied to the page action. Contains the following properties:",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to enable the page action."},
              "url": {"type": "string", "description": "The URL of the page you want the page action to apply to. If the URL specified does not match the currently navigated URL (user has navigated to another page) then no action is taken."},
              "title": {"type": "string", "optional": true, "description": "Specifying <b>title</b> allows you to change the tooltip that appears when you hover over the page action icon in the OmniBox. This parameter is optional and if omitted then the page action <b>name</b> property declared in the manifest is used."},
              "iconId": {"type": "integer", "minimum": 0, "optional": true, "description": "A zero-based index into the <b>icons</b> vector specified in the manifest. This parameter is optional and if omitted then the first icon in the <b>icons</b> vector of the page action is used. This id is useful to represent different page action states. Example: An RSS feed icon could have a 'subscribe now' icon and an 'already subscribed' icon."}
            },
            "optional": false
          }
        ]
      },
      {
        "name": "disableForTab",
        "type": "function",
        "description": "Disables a page action for a particular tab+url combination (makes its OmniBox page action icon hidden when a certain url is active in a given tab). This can be useful to disable a page action before the user navigates away from a page containing an enabled page action.",
        "parameters": [
          {"type": "string", "name": "pageActionId", "description": "An extension can have multiple page actions specified in the manifest, each with a unique identifier. This string identifies which page action you want to disable (and must match a page action id declared in the manifest)."},
          {
            "type": "object",
            "name": "action",
            "description": "An object specifying what action should be applied to the page action. Contains the following properties:",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to disable the page action."},
              "url": {"type": "string", "description": "The URL of the page you want the page action to not apply to. If the URL specified does not match the currently navigated URL (user has navigated to another page) then no action is taken."}
            },
            "optional": false
          }
        ]
      }
    ],
    "events": [
    ]
  },
  {
    "namespace": "pageAction",
    "types": [],
    "functions": [
      {
        "name": "show",
        "type": "function",
        "description": "Shows the page action. The page action is shown whenever the tab is selected.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
        ]
      },
      {
        "name": "hide",
        "type": "function",
        "description": "Hides the page action.",
        "parameters": [
          {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}
        ]
      },
      {
        "name": "setTitle",
        "type": "function",
        "description": "Sets the title of the page action. This is displayed in a tooltip over the page action.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
              "title": {"type": "string", "description": "The tooltip string."}
            }
          }
        ]
      },
      {
        "name": "setIcon",
        "type": "function",
        "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
              "imageData": {
                "type": "any",
                "description": "Pixel data for an image. Must be an ImageData object (for example, from a canvas element).",
                "optional": true
              },
              "iconIndex": {
                "type": "integer",
                "minimum": 0,
                "description": "<b>Deprecated.</b> The zero-based index into the <b>icons</b> vector specified in the manifest.",
                "optional": true
              }
            }
          }
        ]
      },
      {
        "name": "setBadgeText",
        "type": "function",
        "description": "Sets the badge text for the page action. The badge is displayed on top of the icon.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
              "text": {"type": "string", "description": "Any number of characters can be passed, but only about four can fit in the space."}
            }
          }
        ]
      },
      {
        "name": "setBadgeTextColor",
        "type": "function",
        "description": "Sets the text color for the badge.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
              "color": {
                "type": "array",
                "description": "An array of four integers in the range [0,255] that make up the RGBA color for the text of the badge.",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 255
                },
                "minItems": 4,
                "maxItems": 4
              }
            }
          }
        ]
      },
      {
        "name": "setBadgeBackgroundColor",
        "type": "function",
        "description": "Sets the background color for the badge.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
              "color": {
                "type": "array",
                "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>.",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 255
                },
                "minItems": 4,
                "maxItems": 4
              }
            }
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onClicked",
        "type": "function",
        "description": "Fired when a page action icon is clicked.",
        "parameters": [
          {
            "name": "tab",
            "$ref": "Tab"
          }
        ]
      }
    ]
  },
  {
    "namespace": "browserAction",
    "types": [],
    "functions": [
      {
        "name": "setTitle",
        "type": "function",
        "description": "Sets the title of the browser action. This shows up in the tooltip.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "The string the browser action should display when moused over."
              }
            }
          }
        ]
      },
      {
        "name": "setIcon",
        "type": "function",
        "description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "imageData": {
                "type": "any",
                "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element).",
                "optional": true
              },
              "iconIndex": {
                "type": "integer",
                "minimum": 0,
                "description": "<b>Deprecated.</b> The zero-based index into the <b>icons</b> vector specified in the manifest.",
                "optional": true
              },
              "path": {
                "type": "string",
                "description": "Relative path to an image in the extension to show in the browser action.",
                "optional": true
              }
            }
          }
        ]
      },
      {
        "name": "setBadgeText",
        "type": "function",
        "description": "Sets the badge text for the browser action. The badge is displayed on top of the icon.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "description": "Any number of characters can be passed, but only about four can fit in the space."
              }
            }
          }
        ]
      },
      {
        "name": "setBadgeBackgroundColor",
        "type": "function",
        "description": "Sets the background color for the badge.",
        "parameters": [
          {
            "name": "details",
            "type": "object",
            "properties": {
              "color": {
                "type": "array",
                "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>.",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 255
                },
                "minItems": 4,
                "maxItems": 4
              }
            }
          }
        ]
      }
    ],
    "events": [
      {
        "name": "onClicked",
        "type": "function",
        "description": "Fired when a browser action icon is clicked.",
        "parameters": [
          {
            "name": "tab",
            "$ref": "Tab"
          }
        ]
      }
    ]
  },
  {
    "namespace": "bookmarks",
    "types": [
      {
        "id": "BookmarkTreeNode",
        "type": "object",
        "description": "A node (either a bookmark or a folder) in the bookmark tree.  Child nodes are ordered within their parent folder.",
        "properties": {
          "id": {"type": "string", "minimum": 0, "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted."},
          "parentId": {"type": "string", "minimum": 0, "optional": true, "description": "The <code>id</code> of the parent folder.  Omitted for the root node."},
          "index": {"type": "integer", "optional": true, "description": "The 0-based position of this node within its parent folder."},
          "url": {"type": "string", "optional": true, "description": "The URL navigated to when a user clicks the bookmark. Omitted for folders."},
          "title": {"type": "string", "description": "The text displayed for the node."},
          "dateAdded": {"type": "number", "optional": true, "description": "When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>)."},
          "dateGroupModified": {"type": "number", "optional": true, "description": "When the contents of this folder last changed, in milliseconds since the epoch."},
          "children": {"type": "array", "optional": true, "items": {"$ref": "BookmarkTreeNode"}, "description": "An ordered list of children of this node."}
        }
      }
    ],
    "functions": [
      {
        "name": "get",
        "type": "function",
        "description": "Retrieves the specified BookmarkTreeNode(s).",
        "parameters": [
          {
            "name": "idOrIdList",
            "description": "A single string-valued id, or an array of string-valued ids",
            "choices": [
              {"type": "string"},
              {"type": "array", "items": {"type": "string"}, "minItems": 1}
            ]
          },
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "results", "type": "array", "items": { "$ref": "BookmarkTreeNode"} }
            ]
          }
        ]
      },
      {
        "name": "getChildren",
        "type": "function",
        "description": "Retrieves the children of the specified BookmarkTreeNode id.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "results", "type": "array", "items": { "$ref": "BookmarkTreeNode"} }
            ]
          }
        ]
      },
      {
        "name": "getTree",
        "type": "function",
        "description": "Retrieves the entire Bookmarks hierarchy.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "results", "type": "array", "items": { "$ref": "BookmarkTreeNode"} }
            ]
          }
        ]
      },
      {
        "name": "search",
        "type": "function",
        "description": "Seaches for BookmarkTreeNodes matching the given query.",
        "parameters": [
          {"type": "string", "name": "query"},
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "results", "type": "array", "items": { "$ref": "BookmarkTreeNode"} }
            ]
          }
        ]
      },
      {
        "name": "create",
        "type": "function",
        "description": "Creates a bookmark or folder under the specified parentId.  If url is NULL or missing, it will be a folder.",
        "parameters": [
          {
            "type": "object",
            "name": "bookmark",
            "properties": {
              "parentId": {"type": "string"},
              "index": {"type": "integer", "minimum": 0, "optional": true},
              "title": {"type": "string", "optional": true},
              "url": {"type": "string", "optional": true}
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {"name": "result", "$ref": "BookmarkTreeNode" }
            ]
          }
        ]
      },
      {
        "name": "move",
        "type": "function",
        "description": "Moves the specified BookmarkTreeNode to the provided location.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "object",
            "name": "destination",
            "properties": {
              "parentId": {"type": "string"},
              "index": {"type": "integer", "minimum": 0, "optional": true}
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {"name": "result", "$ref": "BookmarkTreeNode" }
            ]
          }
        ]
      },
      {
        "name": "update",
        "type": "function",
        "description": "Updates the properties of a bookmark or folder. Only specify the properties that you want to change, unspecified properties will be left unchanged.  NOTE: currently, only 'title' is supported.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "object",
            "name": "changes",
            "properties": {
              "title": {"type": "string", "optional": true}
            }
          },
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "parameters": [
              {"name": "result", "$ref": "BookmarkTreeNode" }
            ]
          }
        ]
      },
      {
        "name": "remove",
        "type": "function",
        "description": "Removes a bookmark or an empty bookmark folder.",
        "parameters": [
          {"type": "string", "name": "id"},
          {"type": "function", "name": "callback", "optional": true, "parameters": []}
        ]
      },
      {
        "name": "removeTree",
        "type": "function",
        "description": "Recursively removes a bookmark folder.",
        "parameters": [
          {"type": "string", "name": "id"},
          {"type": "function", "name": "callback", "optional": true, "parameters": []}
        ]
      }
    ],
    "events": [
      {
        "name": "onCreated",
        "type": "function",
        "description": "Fired when a bookmark or folder is created.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "$ref": "BookmarkTreeNode",
            "name": "bookmark"
          }
        ]
      },
      {
        "name": "onRemoved",
        "type": "function",
        "description": "Fired when a bookmark or folder is removed.  When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "object",
            "name": "removeInfo",
            "properties": {
              "parentId": { "type": "string" },
              "index": { "type": "integer" }
            }
          }
        ]
      },
      {
        "name": "onChanged",
        "type": "function",
        "description": "Fired when a bookmark or folder changes.  NOTE: currently, only title changes trigger this.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "object",
            "name": "changeInfo",
            "properties": {
              "title": { "type": "string" }
            }
          }
        ]
      },
      {
        "name": "onMoved",
        "type": "function",
        "description": "Fired when a bookmark or folder is moved to a different parent folder.",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "object",
            "name": "moveInfo",
            "properties": {
              "parentId": { "type": "string" },
              "index": { "type": "integer" },
              "oldParentId": { "type": "string" },
              "oldIndex": { "type": "integer" }
            }
          }
        ]
      },
      {
        "name": "onChildrenReordered",
        "type": "function",
        "description": "Fired when the children of a folder have changed their order due to the order being sorted in the UI.  This is not called as a result of a move().",
        "parameters": [
          {"type": "string", "name": "id"},
          {
            "type": "object",
            "name": "reorderInfo",
            "properties": {
              "childIds": { "type": "array", "items": { "type": "string" } }
            }
          }
        ]
      }
    ]
  },
  {
    "namespace": "toolstrip",
    "types": [],
    "functions": [
      {
        "name": "expand",
        "type": "function",
        "description": "",
        "parameters": [
          {
            "type": "object",
            "name": "expandInfo",
            "properties": {
              "height": { "type": "integer", "minimum": 0, "description": "The vertical pixel height required of the toolstrip area." },
              "url": { "type": "string", "optional": true, "description": "If present, the toolstrip mole will change it's content to the provided url. Otherwise, the current page will just be expanded in size." }
            }
          },
          {"type": "function", "name": "callback", "optional": true, "parameters": []}
        ]
      },
      {
        "name": "collapse",
        "type": "function",
        "description": "",
        "parameters": [
          {
            "type": "object",
            "name": "collapseInfo",
            "optional": true,
            "properties": {
              "url": { "type": "string", "optional": true, "description": "If present, the toolstrip mole will change it's content to the provided url. Otherwise, the current page will just be collapsed in size." }
            }
          },
          {"type": "function", "name": "callback", "optional": true, "parameters": []}
        ]
      }
    ],
    "events": []
  },
  {
    "namespace": "i18n",
    "types": [],
    "functions": [
      {
        "name": "getAcceptLanguages",
        "type": "function",
        "description": "Get accept languages of browser",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "parameters": [
              {"name": "languages", "type": "array", "items": {"type": "string"}, "description": "Array of the accept languages of the browser, such as en-US,en,zh-CN"}
            ]
          }
        ]
      },
      {
        "name": "getMessage",
        "type": "function",
        "description": "Get a message from the extension language catalog, for a current locale.",
        "parameters": [
          { "type": "string",
            "name": "message_name",
            "description": "Message name from the extension catalog."
          },
          {
            "choices": [
              { "type": "string" },
              {
                "type": "array",
                "items": { "type": "string" },
                "minItems": 1,
                "maxItems": 9
              }
            ],
            "optional": true,
            "description": "1 - 9 substitution parameters, if the message requires any."
          }
        ],
        "returns": {
          "type": "string",
          "description": "Message localized for current locale."
        }
      }
    ],
    "events": []
  },
  {
    "namespace": "devtools",
    "types": [
    ],
    "functions": [
      {
        "name": "getTabEvents",
        "type": "function",
        "description": "EXPERIMENTAL support for timeline API",
        "nodocs": "true",
        "parameters": [
          {
            "name": "tab_id",
            "type": "integer"
          }
        ],
        "returns": {
          "type": "object",
          "description": "DevTools tab events object"
        }
      }
    ]
  },
  {
    "namespace": "test",
    "types": [],
    "functions": [
      {
        "name": "notifyFail",
        "type": "function",
        "description": "Notify the browser process that test code running in the extension failed.  This is only used for internal unit testing.",
        "parameters": [
          {"type": "string", "name": "message"}
        ]
      },
      {
        "name": "notifyPass",
        "type": "function",
        "description": "Notify the browser process that test code running in the extension passed.  This is only used for internal unit testing.",
        "parameters": [
          {"type": "string", "name": "message", "optional": true}
        ]
      },
      {
        "name": "log",
        "type": "function",
        "description": "Logs a message during internal unit testing.",
        "parameters": [
          {"type": "string", "name": "message"}
        ]
      }
    ],
    "events": []
  }
]