-
Notifications
You must be signed in to change notification settings - Fork 46
/
stable-api-ff.json
8058 lines (8058 loc) · 318 KB
/
stable-api-ff.json
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
[
{
"namespace": "alarms",
"permissions": ["alarms"],
"types": [
{
"id": "Alarm",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of this alarm."
},
"scheduledTime": {
"type": "number",
"description": "Time when the alarm is scheduled to fire, in milliseconds past the epoch."
},
"periodInMinutes": {
"type": "number",
"optional": true,
"description": "When present, signals that the alarm triggers periodically after so many minutes."
}
}
}
],
"functions": [
{
"name": "create",
"type": "function",
"description": "Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.",
"parameters": [
{
"type": "string",
"name": "name",
"optional": true,
"description": "Optional name to identify this alarm. Defaults to the empty string."
},
{
"type": "object",
"name": "alarmInfo",
"description": "Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.",
"properties": {
"when": {"type": "number", "optional": true,
"description": "Time when the alarm is scheduled to first fire, in milliseconds past the epoch."},
"delayInMinutes": {"type": "number", "optional": true,
"description": "Number of minutes from the current time after which the alarm should first fire."},
"periodInMinutes": {"type": "number", "optional": true,
"description": "Number of minutes after which the alarm should recur repeatedly."}
}
}
]
},
{
"name": "get",
"type": "function",
"description": "Retrieves details about the specified alarm.",
"async": "callback",
"parameters": [
{
"type": "string",
"name": "name",
"optional": true,
"description": "The name of the alarm to get. Defaults to the empty string."
},
{
"type": "function",
"name": "callback",
"parameters": [
{ "name": "alarm", "$ref": "Alarm" }
]
}
]
},
{
"name": "getAll",
"type": "function",
"description": "Gets an array of all the alarms.",
"async": "callback",
"parameters": [
{
"type": "function",
"name": "callback",
"parameters": [
{ "name": "alarms", "type": "array", "items": { "$ref": "Alarm" } }
]
}
]
},
{
"name": "clear",
"type": "function",
"description": "Clears the alarm with the given name.",
"async": "callback",
"parameters": [
{
"type": "string",
"name": "name",
"optional": true,
"description": "The name of the alarm to clear. Defaults to the empty string."
},
{
"type": "function",
"name": "callback",
"parameters": [
{ "name": "wasCleared", "type": "boolean", "description": "Whether an alarm of the given name was found to clear." }
]
}
]
},
{
"name": "clearAll",
"type": "function",
"description": "Clears all alarms.",
"async": "callback",
"parameters": [
{
"type": "function",
"name": "callback",
"parameters": [
{ "name": "wasCleared", "type": "boolean", "description": "Whether any alarm was found to clear." }
]
}
]
}
],
"events": [
{
"name": "onAlarm",
"type": "function",
"description": "Fired when an alarm has expired. Useful for transient background pages.",
"parameters": [
{
"name": "name",
"$ref": "Alarm",
"description": "The alarm that has expired."
}
]
}
]
},
{
"namespace": "cookies",
"description": "Use the <code>browser.cookies</code> API to query and modify cookies, and to be notified when they change.",
"permissions": ["cookies"],
"types": [
{
"id": "Cookie",
"type": "object",
"description": "Represents information about an HTTP cookie.",
"properties": {
"name": {"type": "string", "description": "The name of the cookie."},
"value": {"type": "string", "description": "The value of the cookie."},
"domain": {"type": "string", "description": "The domain of the cookie (e.g. \"www.google.com\", \"example.com\")."},
"hostOnly": {"type": "boolean", "description": "True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie)."},
"path": {"type": "string", "description": "The path of the cookie."},
"secure": {"type": "boolean", "description": "True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS)."},
"httpOnly": {"type": "boolean", "description": "True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts)."},
"session": {"type": "boolean", "description": "True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date."},
"expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies."},
"storeId": {"type": "string", "description": "The ID of the cookie store containing this cookie, as provided in getAllCookieStores()."}
}
},
{
"id": "CookieStore",
"type": "object",
"description": "Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window.",
"properties": {
"id": {"type": "string", "description": "The unique identifier for the cookie store."},
"tabIds": {"type": "array", "items": {"type": "integer"}, "description": "Identifiers of all the browser tabs that share this cookie store."}
}
},
{
"id": "OnChangedCause",
"type": "string",
"enum": ["evicted", "expired", "explicit", "expired_overwrite", "overwrite"],
"description": "The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to $(ref:cookies.remove), \"cause\" will be \"explicit\". If a cookie was automatically removed due to expiry, \"cause\" will be \"expired\". If a cookie was removed due to being overwritten with an already-expired expiration date, \"cause\" will be set to \"expired_overwrite\". If a cookie was automatically removed due to garbage collection, \"cause\" will be \"evicted\". If a cookie was automatically removed due to a \"set\" call that overwrote it, \"cause\" will be \"overwrite\". Plan your response accordingly."
}
],
"functions": [
{
"name": "get",
"type": "function",
"description": "Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.",
"async": "callback",
"parameters": [
{
"type": "object",
"name": "details",
"description": "Details to identify the cookie being retrieved.",
"properties": {
"url": {"type": "string", "description": "The URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
"name": {"type": "string", "description": "The name of the cookie to retrieve."},
"storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used."}
}
},
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie. This parameter is null if no such cookie was found."
}
]
}
]
},
{
"name": "getAll",
"type": "function",
"description": "Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.",
"async": "callback",
"parameters": [
{
"type": "object",
"name": "details",
"description": "Information to filter the cookies being retrieved.",
"properties": {
"url": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those that would match the given URL."},
"name": {"type": "string", "optional": true, "description": "Filters the cookies by name."},
"domain": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose domains match or are subdomains of this one."},
"path": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose path exactly matches this string."},
"secure": {"type": "boolean", "optional": true, "description": "Filters the cookies by their Secure property."},
"session": {"type": "boolean", "optional": true, "description": "Filters out session vs. persistent cookies."},
"storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."}
}
},
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "cookies", "type": "array", "items": {"$ref": "Cookie"}, "description": "All the existing, unexpired cookies that match the given cookie info."
}
]
}
]
},
{
"name": "set",
"type": "function",
"description": "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.",
"async": "callback",
"parameters": [
{
"type": "object",
"name": "details",
"description": "Details about the cookie being set.",
"properties": {
"url": {"type": "string", "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
"name": {"type": "string", "optional": true, "description": "The name of the cookie. Empty by default if omitted."},
"value": {"type": "string", "optional": true, "description": "The value of the cookie. Empty by default if omitted."},
"domain": {"type": "string", "optional": true, "description": "The domain of the cookie. If omitted, the cookie becomes a host-only cookie."},
"path": {"type": "string", "optional": true, "description": "The path of the cookie. Defaults to the path portion of the url parameter."},
"secure": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as Secure. Defaults to false."},
"httpOnly": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as HttpOnly. Defaults to false."},
"expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie."},
"storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set."
}
]
}
]
},
{
"name": "remove",
"type": "function",
"description": "Deletes a cookie by name.",
"async": "callback",
"parameters": [
{
"type": "object",
"name": "details",
"description": "Information to identify the cookie to remove.",
"properties": {
"url": {"type": "string", "description": "The URL associated with the cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
"name": {"type": "string", "description": "The name of the cookie to remove."},
"storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store to look in for the cookie. If unspecified, the cookie is looked for by default in the current execution context's cookie store."}
}
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "details",
"type": "object",
"description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set.",
"optional": true,
"properties": {
"url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
"name": {"type": "string", "description": "The name of the cookie that's been removed."},
"storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."}
}
}
]
}
]
},
{
"name": "getAllCookieStores",
"type": "function",
"description": "Lists all existing cookie stores.",
"async": "callback",
"parameters": [
{
"type": "function",
"name": "callback",
"parameters": [
{
"name": "cookieStores", "type": "array", "items": {"$ref": "CookieStore"}, "description": "All the existing cookie stores."
}
]
}
]
}
],
"events": [
{
"name": "onChanged",
"type": "function",
"description": "Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with \"cause\" of \"overwrite\" . Afterwards, a new cookie is written with the updated values, generating a second notification with \"cause\" \"explicit\".",
"parameters": [
{
"type": "object",
"name": "changeInfo",
"properties": {
"removed": {"type": "boolean", "description": "True if a cookie was removed."},
"cookie": {"$ref": "Cookie", "description": "Information about the cookie that was set or removed."},
"cause": {"$ref": "OnChangedCause", "description": "The underlying reason behind the cookie's change."}
}
}
]
}
]
},
{
"namespace": "downloads",
"permissions": ["downloads"],
"types": [
{
"id": "FilenameConflictAction",
"type": "string",
"enum": [
"uniquify",
"overwrite",
"prompt"
]
},
{
"id": "InterruptReason",
"type": "string",
"enum": [
"FILE_FAILED",
"FILE_ACCESS_DENIED",
"FILE_NO_SPACE",
"FILE_NAME_TOO_LONG",
"FILE_TOO_LARGE",
"FILE_VIRUS_INFECTED",
"FILE_TRANSIENT_ERROR",
"FILE_BLOCKED",
"FILE_SECURITY_CHECK_FAILED",
"FILE_TOO_SHORT",
"NETWORK_FAILED",
"NETWORK_TIMEOUT",
"NETWORK_DISCONNECTED",
"NETWORK_SERVER_DOWN",
"NETWORK_INVALID_REQUEST",
"SERVER_FAILED",
"SERVER_NO_RANGE",
"SERVER_BAD_CONTENT",
"SERVER_UNAUTHORIZED",
"SERVER_CERT_PROBLEM",
"SERVER_FORBIDDEN",
"USER_CANCELED",
"USER_SHUTDOWN",
"CRASH"
]
},
{
"id": "DangerType",
"type": "string",
"enum": [
"file",
"url",
"content",
"uncommon",
"host",
"unwanted",
"safe",
"accepted"
],
"description": "<dl><dt>file</dt><dd>The download's filename is suspicious.</dd><dt>url</dt><dd>The download's URL is known to be malicious.</dd><dt>content</dt><dd>The downloaded file is known to be malicious.</dd><dt>uncommon</dt><dd>The download's URL is not commonly downloaded and could be dangerous.</dd><dt>safe</dt><dd>The download presents no known danger to the user's computer.</dd></dl>These string constants will never change, however the set of DangerTypes may change."
},
{
"id": "State",
"type": "string",
"enum": [
"in_progress",
"interrupted",
"complete"
],
"description": "<dl><dt>in_progress</dt><dd>The download is currently receiving data from the server.</dd><dt>interrupted</dt><dd>An error broke the connection with the file host.</dd><dt>complete</dt><dd>The download completed successfully.</dd></dl>These string constants will never change, however the set of States may change."
},
{
"id": "DownloadItem",
"type": "object",
"properties": {
"id": {
"description": "An identifier that is persistent across browser sessions.",
"type": "integer"
},
"url": {
"description": "Absolute URL.",
"type": "string"
},
"referrer": {
"type": "string"
},
"filename": {
"description": "Absolute local path.",
"type": "string"
},
"incognito": {
"description": "False if this download is recorded in the history, true if it is not recorded.",
"type": "boolean"
},
"danger": {
"$ref": "DangerType",
"description": "Indication of whether this download is thought to be safe or known to be suspicious."
},
"mime": {
"description": "The file's MIME type.",
"type": "string"
},
"startTime": {
"description": "Number of milliseconds between the unix epoch and when this download began.",
"type": "string"
},
"endTime": {
"description": "Number of milliseconds between the unix epoch and when this download ended.",
"optional": true,
"type": "string"
},
"estimatedEndTime": {
"type": "string",
"optional": true
},
"state": {
"$ref": "State",
"description": "Indicates whether the download is progressing, interrupted, or complete."
},
"paused": {
"description": "True if the download has stopped reading data from the host, but kept the connection open.",
"type": "boolean"
},
"canResume": {
"type": "boolean"
},
"error": {
"description": "Number indicating why a download was interrupted.",
"optional": true,
"$ref": "InterruptReason"
},
"bytesReceived": {
"description": "Number of bytes received so far from the host, without considering file compression.",
"type": "number"
},
"totalBytes": {
"description": "Number of bytes in the whole file, without considering file compression, or -1 if unknown.",
"type": "number"
},
"fileSize": {
"description": "Number of bytes in the whole file post-decompression, or -1 if unknown.",
"type": "number"
},
"exists": {
"type": "boolean"
},
"byExtensionId": {
"type": "string",
"optional": true
},
"byExtensionName": {
"type": "string",
"optional": true
}
}
},
{
"id": "StringDelta",
"type": "object",
"properties": {
"current": {
"optional": true,
"type": "string"
},
"previous": {
"optional": true,
"type": "string"
}
}
},
{
"id": "DoubleDelta",
"type": "object",
"properties": {
"current": {
"optional": true,
"type": "number"
},
"previous": {
"optional": true,
"type": "number"
}
}
},
{
"id": "BooleanDelta",
"type": "object",
"properties": {
"current": {
"optional": true,
"type": "boolean"
},
"previous": {
"optional": true,
"type": "boolean"
}
}
},
{
"id": "DownloadTime",
"description": "A time specified as a Date object, a number or string representing milliseconds since the epoch, or an ISO 8601 string",
"choices": [
{
"type": "string",
"pattern": "^[1-9]\\d*$"
},
{
"$ref": "extensionTypes.Date"
}
]
},
{
"id": "DownloadQuery",
"description": "Parameters that combine to specify a predicate that can be used to select a set of downloads. Used for example in search() and erase()",
"type": "object",
"properties": {
"query": {
"description": "This array of search terms limits results to <a href='#type-DownloadItem'>DownloadItems</a> whose <code>filename</code> or <code>url</code> contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash.",
"optional": true,
"type": "array",
"items": { "type": "string" }
},
"startedBefore": {
"description": "Limits results to downloads that started before the given ms since the epoch.",
"optional": true,
"$ref": "DownloadTime"
},
"startedAfter": {
"description": "Limits results to downloads that started after the given ms since the epoch.",
"optional": true,
"$ref": "DownloadTime"
},
"endedBefore": {
"description": "Limits results to downloads that ended before the given ms since the epoch.",
"optional": true,
"$ref": "DownloadTime"
},
"endedAfter": {
"description": "Limits results to downloads that ended after the given ms since the epoch.",
"optional": true,
"$ref": "DownloadTime"
},
"totalBytesGreater": {
"description": "Limits results to downloads whose totalBytes is greater than the given integer.",
"optional": true,
"type": "number"
},
"totalBytesLess": {
"description": "Limits results to downloads whose totalBytes is less than the given integer.",
"optional": true,
"type": "number"
},
"filenameRegex": {
"description": "Limits results to <a href='#type-DownloadItem'>DownloadItems</a> whose <code>filename</code> matches the given regular expression.",
"optional": true,
"type": "string"
},
"urlRegex": {
"description": "Limits results to <a href='#type-DownloadItem'>DownloadItems</a> whose <code>url</code> matches the given regular expression.",
"optional": true,
"type": "string"
},
"limit": {
"description": "Setting this integer limits the number of results. Otherwise, all matching <a href='#type-DownloadItem'>DownloadItems</a> will be returned.",
"optional": true,
"type": "integer"
},
"orderBy": {
"description": "Setting elements of this array to <a href='#type-DownloadItem'>DownloadItem</a> properties in order to sort the search results. For example, setting <code>orderBy='startTime'</code> sorts the <a href='#type-DownloadItem'>DownloadItems</a> by their start time in ascending order. To specify descending order, prefix <code>orderBy</code> with a hyphen: '-startTime'.",
"optional": true,
"type": "array",
"items": { "type": "string" }
},
"id": {
"type": "integer",
"optional": true
},
"url": {
"description": "Absolute URL.",
"optional": true,
"type": "string"
},
"filename": {
"description": "Absolute local path.",
"optional": true,
"type": "string"
},
"danger": {
"$ref": "DangerType",
"description": "Indication of whether this download is thought to be safe or known to be suspicious.",
"optional": true
},
"mime": {
"description": "The file's MIME type.",
"optional": true,
"type": "string"
},
"startTime": {
"optional": true,
"type": "string"
},
"endTime": {
"optional": true,
"type": "string"
},
"state": {
"$ref": "State",
"description": "Indicates whether the download is progressing, interrupted, or complete.",
"optional": true
},
"paused": {
"description": "True if the download has stopped reading data from the host, but kept the connection open.",
"optional": true,
"type": "boolean"
},
"error": {
"description": "Why a download was interrupted.",
"optional": true,
"$ref": "InterruptReason"
},
"bytesReceived": {
"description": "Number of bytes received so far from the host, without considering file compression.",
"optional": true,
"type": "number"
},
"totalBytes": {
"description": "Number of bytes in the whole file, without considering file compression, or -1 if unknown.",
"optional": true,
"type": "number"
},
"fileSize": {
"description": "Number of bytes in the whole file post-decompression, or -1 if unknown.",
"optional": true,
"type": "number"
},
"exists": {
"type": "boolean",
"optional": true
}
}
}
],
"functions": [
{
"name": "download",
"type": "function",
"async": "callback",
"description": "Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both <code>filename</code> and <code>saveAs</code> are specified, then the Save As dialog will be displayed, pre-populated with the specified <code>filename</code>. If the download started successfully, <code>callback</code> will be called with the new <a href='#type-DownloadItem'>DownloadItem</a>'s <code>downloadId</code>. If there was an error starting the download, then <code>callback</code> will be called with <code>downloadId=undefined</code> and <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. You must not parse it.",
"parameters": [
{
"description": "What to download and how.",
"name": "options",
"type": "object",
"properties": {
"url": {
"description": "The URL to download.",
"type": "string",
"format": "url"
},
"filename": {
"description": "A file path relative to the Downloads directory to contain the downloaded file.",
"optional": true,
"type": "string"
},
"conflictAction": {
"$ref": "FilenameConflictAction",
"optional": true
},
"saveAs": {
"description": "Use a file-chooser to allow the user to select a filename.",
"optional": true,
"type": "boolean"
},
"method": {
"unsupported": true,
"description": "The HTTP method to use if the URL uses the HTTP[S] protocol.",
"enum": [
"GET",
"POST"
],
"optional": true,
"type": "string"
},
"headers": {
"unsupported": true,
"optional": true,
"type": "array",
"description": "Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys <code>name</code> and either <code>value</code> or <code>binaryValue</code>, restricted to those allowed by XMLHttpRequest.",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Name of the HTTP header.",
"type": "string"
},
"value": {
"description": "Value of the HTTP header.",
"type": "string"
}
}
}
},
"body": {
"unsupported": true,
"description": "Post body.",
"optional": true,
"type": "string"
}
}
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "downloadId",
"type": "integer"
}
]
}
]
},
{
"name": "search",
"type": "function",
"async": "callback",
"description": "Find <a href='#type-DownloadItem'>DownloadItems</a>. Set <code>query</code> to the empty object to get all <a href='#type-DownloadItem'>DownloadItems</a>. To get a specific <a href='#type-DownloadItem'>DownloadItem</a>, set only the <code>id</code> field.",
"parameters": [
{
"name": "query",
"$ref": "DownloadQuery"
},
{
"name": "callback",
"type": "function",
"parameters": [
{
"items": {
"$ref": "DownloadItem"
},
"name": "results",
"type": "array"
}
]
}
]
},
{
"name": "pause",
"type": "function",
"async": "callback",
"description": "Pause the download. If the request was successful the download is in a paused state. Otherwise <a href='extension.html#property-lastError'>chrome.extension.lastError</a> contains an error message. The request will fail if the download is not active.",
"parameters": [
{
"description": "The id of the download to pause.",
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"optional": true,
"parameters": [],
"type": "function"
}
]
},
{
"name": "resume",
"type": "function",
"async": "callback",
"description": "Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise <a href='extension.html#property-lastError'>chrome.extension.lastError</a> contains an error message. The request will fail if the download is not active.",
"parameters": [
{
"description": "The id of the download to resume.",
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"optional": true,
"parameters": [],
"type": "function"
}
]
},
{
"name": "cancel",
"type": "function",
"async": "callback",
"description": "Cancel a download. When <code>callback</code> is run, the download is cancelled, completed, interrupted or doesn't exist anymore.",
"parameters": [
{
"description": "The id of the download to cancel.",
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"optional": true,
"parameters": [],
"type": "function"
}
]
},
{
"name": "getFileIcon",
"type": "function",
"async": "callback",
"description": "Retrieve an icon for the specified download. For new downloads, file icons are available after the <a href='#event-onCreated'>onCreated</a> event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will contain an error message.",
"parameters": [
{
"description": "The identifier for the download.",
"name": "downloadId",
"type": "integer"
},
{
"name": "options",
"optional": true,
"properties": {
"size": {
"description": "The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32x32 pixels.",
"optional": true,
"minimum": 1,
"maximum": 127,
"type": "integer"
}
},
"type": "object"
},
{
"name": "callback",
"parameters": [
{
"name": "iconURL",
"optional": true,
"type": "string"
}
],
"type": "function"
}
]
},
{
"name": "open",
"type": "function",
"async": "callback",
"description": "Open the downloaded file.",
"permissions": ["downloads.open"],
"parameters": [
{
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
},
{
"name": "show",
"type": "function",
"description": "Show the downloaded file in its folder in a file manager.",
"async": "callback",
"parameters": [
{
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "success",
"type": "boolean"
}
]
}
]
},
{
"name": "showDefaultFolder",
"type": "function",
"parameters": []
},
{
"name": "erase",
"type": "function",
"async": "callback",
"description": "Erase matching <a href='#type-DownloadItem'>DownloadItems</a> from history",
"parameters": [
{
"name": "query",
"$ref": "DownloadQuery"
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"items": {
"type": "integer"
},
"name": "erasedIds",
"type": "array"
}
]
}
]
},
{
"name": "removeFile",
"async": "callback",
"type": "function",
"parameters": [
{
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [ ]
}
]
},
{
"description": "Prompt the user to either accept or cancel a dangerous download. <code>acceptDanger()</code> does not automatically accept dangerous downloads.",
"name": "acceptDanger",
"unsupported": true,
"parameters": [
{
"name": "downloadId",
"type": "integer"
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [ ]
}
],
"type": "function"
},
{
"description": "Initiate dragging the file to another application.",
"name": "drag",
"unsupported": true,
"parameters": [
{
"name": "downloadId",
"type": "integer"