-
Notifications
You must be signed in to change notification settings - Fork 1
/
webextension.d.ts
13005 lines (11127 loc) · 370 KB
/
webextension.d.ts
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: browser.activityLog
* Generated from Mozilla sources. Do not manually edit!
*
* Monitor extension activity
* Permissions: "activityLog"
*/
export declare namespace ActivityLog {
interface OnExtensionActivityDetailsType {
/**
* The date string when this call is triggered.
*/
timeStamp: ExtensionTypes.DateType;
/**
* The type of log entry. api_call is a function call made by the extension and api_event is an event callback to the extension. content_script is logged when a content script is injected.
*/
type: OnExtensionActivityDetailsTypeTypeEnum;
/**
* The type of view where the activity occurred. Content scripts will not have a viewType.
* Optional.
*/
viewType?: OnExtensionActivityDetailsTypeViewTypeEnum;
/**
* The name of the api call or event, or the script url if this is a content or user script event.
*/
name: string;
data: OnExtensionActivityDetailsTypeDataType;
}
/**
* The type of log entry. api_call is a function call made by the extension and api_event is an event callback to the extension. content_script is logged when a content script is injected.
*/
type OnExtensionActivityDetailsTypeTypeEnum =
| "api_call"
| "api_event"
| "content_script"
| "user_script";
/**
* The type of view where the activity occurred. Content scripts will not have a viewType.
*/
type OnExtensionActivityDetailsTypeViewTypeEnum =
| "background"
| "popup"
| "sidebar"
| "tab"
| "devtools_page"
| "devtools_panel";
/**
* The result of the call.
*/
interface OnExtensionActivityDetailsTypeDataResultType {}
interface OnExtensionActivityDetailsTypeDataType {
/**
* A list of arguments passed to the call.
* Optional.
*/
args?: any[];
/**
* The result of the call.
* Optional.
*/
result?: OnExtensionActivityDetailsTypeDataResultType;
/**
* The tab associated with this event if it is a tab or content script.
* Optional.
*/
tabId?: number;
/**
* If the type is content_script, this is the url of the script that was injected.
* Optional.
*/
url?: string;
}
/**
* Receives an activityItem for each logging event.
*/
interface onExtensionActivityEvent
extends Events.Event<(details: OnExtensionActivityDetailsType) => void> {
/**
* Registers an event listener <em>callback</em> to an event.
*
* @param callback Called when an event occurs. The parameters of this function depend on the type of event.
* @param id
*/
addListener(
callback: (details: OnExtensionActivityDetailsType) => void,
id: string
): void;
}
interface Static {
/**
* Receives an activityItem for each logging event.
*/
onExtensionActivity: onExtensionActivityEvent;
}
}
/**
* Namespace: browser.alarms
* Generated from Mozilla sources. Do not manually edit!
*
* Permissions: "alarms"
*
* Comments found in source JSON schema files:
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
export declare namespace Alarms {
interface Alarm {
/**
* Name of this alarm.
*/
name: string;
/**
* Time when the alarm is scheduled to fire, in milliseconds past the epoch.
*/
scheduledTime: number;
/**
* When present, signals that the alarm triggers periodically after so many minutes.
* Optional.
*/
periodInMinutes?: number;
}
/**
* 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.
*/
interface CreateAlarmInfoType {
/**
* Time when the alarm is scheduled to first fire, in milliseconds past the epoch.
* Optional.
*/
when?: number;
/**
* Number of minutes from the current time after which the alarm should first fire.
* Optional.
*/
delayInMinutes?: number;
/**
* Number of minutes after which the alarm should recur repeatedly.
* Optional.
*/
periodInMinutes?: number;
}
interface Static {
/**
* 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.
*
* @param name Optional. Optional name to identify this alarm. Defaults to the empty string.
* @param alarmInfo 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.
*/
create(name: string | undefined, alarmInfo: CreateAlarmInfoType): void;
/**
* 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.
*
* @param alarmInfo 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.
*/
create(alarmInfo: CreateAlarmInfoType): void;
/**
* Retrieves details about the specified alarm.
*
* @param name Optional. The name of the alarm to get. Defaults to the empty string.
* @returns Promise<Alarm>
*/
get(name?: string): Promise<Alarm>;
/**
* Gets an array of all the alarms.
*
* @returns Promise<Alarm[]>
*/
getAll(): Promise<Alarm[]>;
/**
* Clears the alarm with the given name.
*
* @param name Optional. The name of the alarm to clear. Defaults to the empty string.
* @returns Promise<boolean>
*/
clear(name?: string): Promise<boolean>;
/**
* Clears all alarms.
*
* @returns Promise<boolean>
*/
clearAll(): Promise<boolean>;
/**
* Fired when an alarm has expired. Useful for transient background pages.
*
* @param name The alarm that has expired.
*/
onAlarm: Events.Event<(name: Alarm) => void>;
}
}
/**
* Namespace: browser.bookmarks
* Generated from Mozilla sources. Do not manually edit!
*
* Use the <code>browser.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks. Also see $(topic:override)[Override Pages], which you can use to create a custom Bookmark Manager page.
* Permissions: "bookmarks"
*
* Comments found in source JSON schema files:
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
export declare namespace Bookmarks {
/**
* Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
*/
type BookmarkTreeNodeUnmodifiable = "managed";
/**
* Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator.
*/
type BookmarkTreeNodeType = "bookmark" | "folder" | "separator";
/**
* A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.
*/
interface BookmarkTreeNode {
/**
* The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted.
*/
id: string;
/**
* The <code>id</code> of the parent folder. Omitted for the root node.
* Optional.
*/
parentId?: string;
/**
* The 0-based position of this node within its parent folder.
* Optional.
*/
index?: number;
/**
* The URL navigated to when a user clicks the bookmark. Omitted for folders.
* Optional.
*/
url?: string;
/**
* The text displayed for the node.
*/
title: string;
/**
* When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>).
* Optional.
*/
dateAdded?: number;
/**
* When the contents of this folder last changed, in milliseconds since the epoch.
* Optional.
*/
dateGroupModified?: number;
/**
* Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
* Optional.
*/
unmodifiable?: BookmarkTreeNodeUnmodifiable;
/**
* Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator.
* Optional.
*/
type?: BookmarkTreeNodeType;
/**
* An ordered list of children of this node.
* Optional.
*/
children?: BookmarkTreeNode[];
}
/**
* Object passed to the create() function.
*/
interface CreateDetails {
/**
* Defaults to the Other Bookmarks folder.
* Optional.
*/
parentId?: string;
/**
* Optional.
*/
index?: number;
/**
* Optional.
*/
title?: string;
/**
* Optional.
*/
url?: string;
/**
* Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator.
* Optional.
*/
type?: BookmarkTreeNodeType;
}
/**
* An object specifying properties and values to match when searching. Produces bookmarks matching all properties.
*/
interface SearchQueryC2Type {
/**
* A string of words that are matched against bookmark URLs and titles.
* Optional.
*/
query?: string;
/**
* The URL of the bookmark; matches verbatim. Note that folders have no URL.
* Optional.
*/
url?: string;
/**
* The title of the bookmark; matches verbatim.
* Optional.
*/
title?: string;
}
interface MoveDestinationType {
/**
* Optional.
*/
parentId?: string;
/**
* Optional.
*/
index?: number;
}
interface UpdateChangesType {
/**
* Optional.
*/
title?: string;
/**
* Optional.
*/
url?: string;
}
interface OnRemovedRemoveInfoType {
parentId: string;
index: number;
node: BookmarkTreeNode;
}
interface OnChangedChangeInfoType {
title: string;
/**
* Optional.
*/
url?: string;
}
interface OnMovedMoveInfoType {
parentId: string;
index: number;
oldParentId: string;
oldIndex: number;
}
interface Static {
/**
* Retrieves the specified BookmarkTreeNode(s).
*
* @param idOrIdList A single string-valued id, or an array of string-valued ids
* @returns Promise<BookmarkTreeNode[]>
*/
get(idOrIdList: string | string[]): Promise<BookmarkTreeNode[]>;
/**
* Retrieves the children of the specified BookmarkTreeNode id.
*
* @param id
* @returns Promise<BookmarkTreeNode[]>
*/
getChildren(id: string): Promise<BookmarkTreeNode[]>;
/**
* Retrieves the recently added bookmarks.
*
* @param numberOfItems The maximum number of items to return.
* @returns Promise<BookmarkTreeNode[]>
*/
getRecent(numberOfItems: number): Promise<BookmarkTreeNode[]>;
/**
* Retrieves the entire Bookmarks hierarchy.
*
* @returns Promise<BookmarkTreeNode[]>
*/
getTree(): Promise<BookmarkTreeNode[]>;
/**
* Retrieves part of the Bookmarks hierarchy, starting at the specified node.
*
* @param id The ID of the root of the subtree to retrieve.
* @returns Promise<BookmarkTreeNode[]>
*/
getSubTree(id: string): Promise<BookmarkTreeNode[]>;
/**
* Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
*
* @param query Either a string of words that are matched against bookmark URLs and titles, or an object. If an object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be specified and bookmarks matching all specified properties will be produced.
* @returns Promise<BookmarkTreeNode[]>
*/
search(query: string | SearchQueryC2Type): Promise<BookmarkTreeNode[]>;
/**
* Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
*
* @param bookmark
* @returns Promise<BookmarkTreeNode>
*/
create(bookmark: CreateDetails): Promise<BookmarkTreeNode>;
/**
* Moves the specified BookmarkTreeNode to the provided location.
*
* @param id
* @param destination
* @returns Promise<BookmarkTreeNode>
*/
move(
id: string,
destination: MoveDestinationType
): Promise<BookmarkTreeNode>;
/**
* Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. <b>Note:</b> Currently, only 'title' and 'url' are supported.
*
* @param id
* @param changes
* @returns Promise<BookmarkTreeNode>
*/
update(id: string, changes: UpdateChangesType): Promise<BookmarkTreeNode>;
/**
* Removes a bookmark or an empty bookmark folder.
*
* @param id
* @returns Promise<void>
*/
remove(id: string): Promise<void>;
/**
* Recursively removes a bookmark folder.
*
* @param id
* @returns Promise<void>
*/
removeTree(id: string): Promise<void>;
/**
* Fired when a bookmark or folder is created.
*
* @param id
* @param bookmark
*/
onCreated: Events.Event<(id: string, bookmark: BookmarkTreeNode) => void>;
/**
* 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.
*
* @param id
* @param removeInfo
*/
onRemoved: Events.Event<
(id: string, removeInfo: OnRemovedRemoveInfoType) => void
>;
/**
* Fired when a bookmark or folder changes. <b>Note:</b> Currently, only title and url changes trigger this.
*
* @param id
* @param changeInfo
*/
onChanged: Events.Event<
(id: string, changeInfo: OnChangedChangeInfoType) => void
>;
/**
* Fired when a bookmark or folder is moved to a different parent folder.
*
* @param id
* @param moveInfo
*/
onMoved: Events.Event<(id: string, moveInfo: OnMovedMoveInfoType) => void>;
}
}
/**
* Namespace: browser.browserAction
* Generated from Mozilla sources. Do not manually edit!
*
* Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.
* Permissions: "manifest:browser_action"
*
* Comments found in source JSON schema files:
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
export declare namespace BrowserAction {
/**
* Specifies to which tab or window the value should be set, or from which one it should be retrieved. If no tab nor window is specified, the global value is set or retrieved.
*/
interface Details {
/**
* When setting a value, it will be specific to the specified tab, and will automatically reset when the tab navigates. When getting, specifies the tab to get the value from; if there is no tab-specific value, the window one will be inherited.
* Optional.
*/
tabId?: number;
/**
* When setting a value, it will be specific to the specified window. When getting, specifies the window to get the value from; if there is no window-specific value, the global one will be inherited.
* Optional.
*/
windowId?: number;
}
type ColorArray = [number, number, number, number];
/**
* Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element).
*/
interface ImageDataType {}
/**
* 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>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.
*/
type ColorValue = string | ColorArray | null;
/**
* Information sent when a browser action is clicked.
*/
interface OnClickData {
/**
* An array of keyboard modifiers that were held while the menu item was clicked.
*/
modifiers: OnClickDataModifiersItemEnum[];
/**
* An integer value of button by which menu item was clicked.
* Optional.
*/
button?: number;
}
interface SetTitleDetailsType extends Details {
/**
* The string the browser action should display when moused over.
*/
title: string | null;
}
interface SetIconDetailsType extends Details {
/**
* Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'
* Optional.
*/
imageData?: ImageDataType | { [s: string]: ImageDataType };
/**
* Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
* Optional.
*/
path?: string | { [s: string]: string };
}
interface SetPopupDetailsType extends Details {
/**
* The html file to show in a popup. If set to the empty string (''), no popup is shown.
*/
popup: string | null;
}
interface SetBadgeTextDetailsType extends Details {
/**
* Any number of characters can be passed, but only about four can fit in the space.
*/
text: string | null;
}
interface SetBadgeBackgroundColorDetailsType extends Details {
color: ColorValue;
}
interface SetBadgeTextColorDetailsType extends Details {
color: ColorValue;
}
type OnClickDataModifiersItemEnum =
| "Shift"
| "Alt"
| "Command"
| "Ctrl"
| "MacCtrl";
interface Static {
/**
* Sets the title of the browser action. This shows up in the tooltip.
*
* @param details
* @returns Promise<void>
*/
setTitle(details: SetTitleDetailsType): Promise<void>;
/**
* Gets the title of the browser action.
*
* @param details
* @returns Promise<string>
*/
getTitle(details: Details): Promise<string>;
/**
* 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, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.
*
* @param details
* @returns Promise<void>
*/
setIcon(details: SetIconDetailsType): Promise<void>;
/**
* Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
*
* @param details
* @returns Promise<void>
*/
setPopup(details: SetPopupDetailsType): Promise<void>;
/**
* Gets the html document set as the popup for this browser action.
*
* @param details
* @returns Promise<string>
*/
getPopup(details: Details): Promise<string>;
/**
* Sets the badge text for the browser action. The badge is displayed on top of the icon.
*
* @param details
* @returns Promise<void>
*/
setBadgeText(details: SetBadgeTextDetailsType): Promise<void>;
/**
* Gets the badge text of the browser action. If no tab nor window is specified is specified, the global badge text is returned.
*
* @param details
* @returns Promise<string>
*/
getBadgeText(details: Details): Promise<string>;
/**
* Sets the background color for the badge.
*
* @param details
* @returns Promise<void>
*/
setBadgeBackgroundColor(
details: SetBadgeBackgroundColorDetailsType
): Promise<void>;
/**
* Gets the background color of the browser action badge.
*
* @param details
* @returns Promise<ColorArray>
*/
getBadgeBackgroundColor(details: Details): Promise<ColorArray>;
/**
* Sets the text color for the badge.
*
* @param details
*/
setBadgeTextColor(details: SetBadgeTextColorDetailsType): void;
/**
* Gets the text color of the browser action badge.
*
* @param details
*/
getBadgeTextColor(details: Details): void;
/**
* Enables the browser action for a tab. By default, browser actions are enabled.
*
* @param tabId Optional. The id of the tab for which you want to modify the browser action.
* @returns Promise<void>
*/
enable(tabId?: number): Promise<void>;
/**
* Disables the browser action for a tab.
*
* @param tabId Optional. The id of the tab for which you want to modify the browser action.
* @returns Promise<void>
*/
disable(tabId?: number): Promise<void>;
/**
* Checks whether the browser action is enabled.
*
* @param details
* @returns Promise<boolean>
*/
isEnabled(details: Details): Promise<boolean>;
/**
* Opens the extension popup window in the active window.
*
* @returns Promise<void>
*/
openPopup(): Promise<void>;
/**
* Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.
*
* @param tab
* @param info Optional.
*/
onClicked: Events.Event<
(tab: Tabs.Tab, info: OnClickData | undefined) => void
>;
}
}
/**
* Namespace: browser.browserSettings
* Generated from Mozilla sources. Do not manually edit!
*
* Use the <code>browser.browserSettings</code> API to control global settings of the browser.
* Permissions: "browserSettings"
*
* Comments found in source JSON schema files:
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
export declare namespace BrowserSettings {
/**
* How images should be animated in the browser.
*/
type ImageAnimationBehavior = "normal" | "none" | "once";
/**
* After which mouse event context menus should popup.
*/
type ContextMenuMouseEvent = "mouseup" | "mousedown";
interface Static {
/**
* Allows or disallows pop-up windows from opening in response to user events.
*/
allowPopupsForUserEvents: Types.Setting;
/**
* Enables or disables the browser cache.
*/
cacheEnabled: Types.Setting;
/**
* This boolean setting controls whether the selected tab can be closed with a double click.
*/
closeTabsByDoubleClick: Types.Setting;
/**
* Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, which has possible values of <code>mouseup</code> and <code>mousedown</code>.
*/
contextMenuShowEvent: Types.Setting;
/**
* This boolean setting controls whether the FTP protocol is enabled.
*/
ftpProtocolEnabled: Types.Setting;
/**
* Returns the value of the overridden home page. Read-only.
*/
homepageOverride: Types.Setting;
/**
* Controls the behaviour of image animation in the browser. This setting's value is of type ImageAnimationBehavior, defaulting to <code>normal</code>.
*/
imageAnimationBehavior: Types.Setting;
/**
* Returns the value of the overridden new tab page. Read-only.
*/
newTabPageOverride: Types.Setting;
/**
* Controls where new tabs are opened. `afterCurrent` will open all new tabs next to the current tab, `relatedAfterCurrent` will open only related tabs next to the current tab, and `atEnd` will open all tabs at the end of the tab strip. The default is `relatedAfterCurrent`.
*/
newTabPosition: Types.Setting;
/**
* This boolean setting controls whether bookmarks are opened in the current tab or in a new tab.
*/
openBookmarksInNewTabs: Types.Setting;
/**
* This boolean setting controls whether search results are opened in the current tab or in a new tab.
*/
openSearchResultsInNewTabs: Types.Setting;
/**
* This boolean setting controls whether urlbar results are opened in the current tab or in a new tab.
*/
openUrlbarResultsInNewTabs: Types.Setting;
/**
* Disables webAPI notifications.
*/
webNotificationsDisabled: Types.Setting;
/**
* This setting controls whether the user-chosen colors override the page's colors.
*/
overrideDocumentColors: Types.Setting;
/**
* This setting controls whether the document's fonts are used.
*/
useDocumentFonts: Types.Setting;
/**
* This boolean setting controls whether zoom is applied to the full page or to text only.
*/
zoomFullPage: Types.Setting;
/**
* This boolean setting controls whether zoom is applied on a per-site basis or to the current tab only. If privacy.resistFingerprinting is true, this setting has no effect and zoom is applied to the current tab only.
*/
zoomSiteSpecific: Types.Setting;
}
}
/**
* Namespace: browser.browsingData
* Generated from Mozilla sources. Do not manually edit!
*
* Use the <code>chrome.browsingData</code> API to remove browsing data from a user's local profile.
* Permissions: "browsingData"
*
* Comments found in source JSON schema files:
* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
export declare namespace BrowsingData {
/**
* Options that determine exactly what data will be removed.
*/
interface RemovalOptions {
/**
* Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the <code>getTime</code> method of the JavaScript <code>Date</code> object). If absent, defaults to 0 (which would remove all browsing data).
* Optional.
*/
since?: ExtensionTypes.DateType;
/**
* Only remove data associated with these hostnames (only applies to cookies and localStorage).
* Optional.
*/
hostnames?: string[];
/**
* An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you <em>really</em> want to remove application data before adding 'protectedWeb' or 'extensions'.
* Optional.
*/
originTypes?: RemovalOptionsOriginTypesType;
}
/**
* A set of data types. Missing data types are interpreted as <code>false</code>.
*/
interface DataTypeSet {
/**
* The browser's cache. Note: when removing data, this clears the <em>entire</em> cache: it is not limited to the range you specify.
* Optional.
*/
cache?: boolean;
/**
* The browser's cookies.
* Optional.
*/
cookies?: boolean;
/**
* The browser's download list.
* Optional.
*/
downloads?: boolean;
/**
* The browser's stored form data.
* Optional.
*/
formData?: boolean;
/**
* The browser's history.
* Optional.
*/
history?: boolean;
/**
* Websites' IndexedDB data.
* Optional.
*/
indexedDB?: boolean;
/**
* Websites' local storage data.
* Optional.
*/
localStorage?: boolean;
/**
* Server-bound certificates.
* Optional.
*/
serverBoundCertificates?: boolean;
/**
* Stored passwords.
* Optional.
*/
passwords?: boolean;
/**
* Plugins' data.
* Optional.
*/
pluginData?: boolean;
/**
* Service Workers.
* Optional.
*/
serviceWorkers?: boolean;
}
interface SettingsCallbackResultType {