chrome-types 0.1.258 → 0.1.260
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_all.d.ts +128 -43
- package/index.d.ts +128 -43
- package/package.json +2 -2
package/_all.d.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
// Generated on
|
|
18
|
-
// Built at
|
|
17
|
+
// Generated on Tue Feb 06 2024 22:28:50 GMT+0000 (Coordinated Universal Time)
|
|
18
|
+
// Built at f1c1b2fcda4cbf2e21dd3d1d4234eeedae74cb9a
|
|
19
19
|
|
|
20
20
|
// Includes all types, including MV2 + Platform Apps APIs.
|
|
21
21
|
|
|
@@ -213,7 +213,7 @@ declare namespace chrome {
|
|
|
213
213
|
export interface OpenPopupOptions {
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
|
-
* The
|
|
216
|
+
* The ID of the window to open the action popup in. Defaults to the currently-active window if unspecified.
|
|
217
217
|
*/
|
|
218
218
|
windowId?: number;
|
|
219
219
|
}
|
|
@@ -588,7 +588,7 @@ declare namespace chrome {
|
|
|
588
588
|
/**
|
|
589
589
|
* Enables the action for a tab. By default, actions are enabled.
|
|
590
590
|
*
|
|
591
|
-
* @param tabId The
|
|
591
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
592
592
|
*/
|
|
593
593
|
export function enable(
|
|
594
594
|
|
|
@@ -598,7 +598,7 @@ declare namespace chrome {
|
|
|
598
598
|
/**
|
|
599
599
|
* Enables the action for a tab. By default, actions are enabled.
|
|
600
600
|
*
|
|
601
|
-
* @param tabId The
|
|
601
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
602
602
|
*/
|
|
603
603
|
export function enable(
|
|
604
604
|
|
|
@@ -610,7 +610,7 @@ declare namespace chrome {
|
|
|
610
610
|
/**
|
|
611
611
|
* Disables the action for a tab.
|
|
612
612
|
*
|
|
613
|
-
* @param tabId The
|
|
613
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
614
614
|
*/
|
|
615
615
|
export function disable(
|
|
616
616
|
|
|
@@ -620,7 +620,7 @@ declare namespace chrome {
|
|
|
620
620
|
/**
|
|
621
621
|
* Disables the action for a tab.
|
|
622
622
|
*
|
|
623
|
-
* @param tabId The
|
|
623
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
624
624
|
*/
|
|
625
625
|
export function disable(
|
|
626
626
|
|
|
@@ -632,7 +632,7 @@ declare namespace chrome {
|
|
|
632
632
|
/**
|
|
633
633
|
* Indicates whether the extension action is enabled for a tab (or globally if no `tabId` is provided). Actions enabled using only {@link declarativeContent} always return false.
|
|
634
634
|
*
|
|
635
|
-
* @param tabId The
|
|
635
|
+
* @param tabId The ID of the tab for which you want check enabled status.
|
|
636
636
|
* @since Chrome 110
|
|
637
637
|
*/
|
|
638
638
|
export function isEnabled(
|
|
@@ -643,7 +643,7 @@ declare namespace chrome {
|
|
|
643
643
|
/**
|
|
644
644
|
* Indicates whether the extension action is enabled for a tab (or globally if no `tabId` is provided). Actions enabled using only {@link declarativeContent} always return false.
|
|
645
645
|
*
|
|
646
|
-
* @param tabId The
|
|
646
|
+
* @param tabId The ID of the tab for which you want check enabled status.
|
|
647
647
|
* @since Chrome 110
|
|
648
648
|
*/
|
|
649
649
|
export function isEnabled(
|
|
@@ -6597,6 +6597,75 @@ declare namespace chrome {
|
|
|
6597
6597
|
checked?: boolean;
|
|
6598
6598
|
}
|
|
6599
6599
|
|
|
6600
|
+
/**
|
|
6601
|
+
* Properties of the new context menu item.
|
|
6602
|
+
*
|
|
6603
|
+
* @since Pending
|
|
6604
|
+
*/
|
|
6605
|
+
export interface CreateProperties {
|
|
6606
|
+
|
|
6607
|
+
/**
|
|
6608
|
+
* The type of menu item. Defaults to `normal`.
|
|
6609
|
+
*/
|
|
6610
|
+
type?: ItemType;
|
|
6611
|
+
|
|
6612
|
+
/**
|
|
6613
|
+
* The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.
|
|
6614
|
+
*/
|
|
6615
|
+
id?: string;
|
|
6616
|
+
|
|
6617
|
+
/**
|
|
6618
|
+
* The text to display in the item; this is _required_ unless `type` is `separator`. When the context is `selection`, use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
|
|
6619
|
+
*/
|
|
6620
|
+
title?: string;
|
|
6621
|
+
|
|
6622
|
+
/**
|
|
6623
|
+
* The initial state of a checkbox or radio button: `true` for selected, `false` for unselected. Only one radio button can be selected at a time in a given group.
|
|
6624
|
+
*/
|
|
6625
|
+
checked?: boolean;
|
|
6626
|
+
|
|
6627
|
+
/**
|
|
6628
|
+
* List of contexts this menu item will appear in. Defaults to `['page']`.
|
|
6629
|
+
*/
|
|
6630
|
+
contexts?: [ContextType, ...ContextType[]];
|
|
6631
|
+
|
|
6632
|
+
/**
|
|
6633
|
+
* Whether the item is visible in the menu.
|
|
6634
|
+
*/
|
|
6635
|
+
visible?: boolean;
|
|
6636
|
+
|
|
6637
|
+
/**
|
|
6638
|
+
* A function that is called back when the menu item is clicked. This is not available inside of a service worker; instead, they should register a listener for {@link contextMenus.onClicked}.
|
|
6639
|
+
*
|
|
6640
|
+
* @param info Information about the item clicked and the context where the click happened.
|
|
6641
|
+
* @param tab The details of the tab where the click took place. This parameter is not present for platform apps.
|
|
6642
|
+
*/
|
|
6643
|
+
onclick?: (
|
|
6644
|
+
info: OnClickData,
|
|
6645
|
+
tab: tabs.Tab,
|
|
6646
|
+
) => void;
|
|
6647
|
+
|
|
6648
|
+
/**
|
|
6649
|
+
* The ID of a parent menu item; this makes the item a child of a previously added item.
|
|
6650
|
+
*/
|
|
6651
|
+
parentId?: number | string;
|
|
6652
|
+
|
|
6653
|
+
/**
|
|
6654
|
+
* Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see [Match Patterns](https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns).
|
|
6655
|
+
*/
|
|
6656
|
+
documentUrlPatterns?: string[];
|
|
6657
|
+
|
|
6658
|
+
/**
|
|
6659
|
+
* Similar to `documentUrlPatterns`, filters based on the `src` attribute of `img`, `audio`, and `video` tags and the `href` attribute of `a` tags.
|
|
6660
|
+
*/
|
|
6661
|
+
targetUrlPatterns?: string[];
|
|
6662
|
+
|
|
6663
|
+
/**
|
|
6664
|
+
* Whether this context menu item is enabled or disabled. Defaults to `true`.
|
|
6665
|
+
*/
|
|
6666
|
+
enabled?: boolean;
|
|
6667
|
+
}
|
|
6668
|
+
|
|
6600
6669
|
/**
|
|
6601
6670
|
* The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored.
|
|
6602
6671
|
*/
|
|
@@ -6618,31 +6687,30 @@ declare namespace chrome {
|
|
|
6618
6687
|
*/
|
|
6619
6688
|
export function create(
|
|
6620
6689
|
|
|
6621
|
-
createProperties:
|
|
6690
|
+
createProperties: CreateProperties,
|
|
6622
6691
|
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
*/
|
|
6626
|
-
type?: ItemType,
|
|
6692
|
+
callback?: () => void,
|
|
6693
|
+
): number | string;
|
|
6627
6694
|
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6695
|
+
/**
|
|
6696
|
+
* Updates a previously created context menu item.
|
|
6697
|
+
*
|
|
6698
|
+
* @chrome-returns-extra since Pending
|
|
6699
|
+
* @param id The ID of the item to update.
|
|
6700
|
+
* @param updateProperties The properties to update. Accepts the same values as the {@link contextMenus.create} function.
|
|
6701
|
+
*/
|
|
6702
|
+
export function update(
|
|
6703
|
+
|
|
6704
|
+
id: number | string,
|
|
6705
|
+
|
|
6706
|
+
updateProperties: {
|
|
6707
|
+
|
|
6708
|
+
type?: ItemType,
|
|
6632
6709
|
|
|
6633
|
-
/**
|
|
6634
|
-
* The text to display in the item; this is _required_ unless `type` is `separator`. When the context is `selection`, use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
|
|
6635
|
-
*/
|
|
6636
6710
|
title?: string,
|
|
6637
6711
|
|
|
6638
|
-
/**
|
|
6639
|
-
* The initial state of a checkbox or radio button: `true` for selected, `false` for unselected. Only one radio button can be selected at a time in a given group.
|
|
6640
|
-
*/
|
|
6641
6712
|
checked?: boolean,
|
|
6642
6713
|
|
|
6643
|
-
/**
|
|
6644
|
-
* List of contexts this menu item will appear in. Defaults to `['page']`.
|
|
6645
|
-
*/
|
|
6646
6714
|
contexts?: [ContextType, ...ContextType[]],
|
|
6647
6715
|
|
|
6648
6716
|
/**
|
|
@@ -6653,39 +6721,31 @@ declare namespace chrome {
|
|
|
6653
6721
|
visible?: boolean,
|
|
6654
6722
|
|
|
6655
6723
|
/**
|
|
6656
|
-
* A function that is called back when the menu item is clicked. This is not available inside of a service worker; instead, they should register a listener for {@link contextMenus.onClicked}.
|
|
6657
|
-
*
|
|
6658
|
-
* @param info Information about the item clicked and the context where the click happened.
|
|
6659
6724
|
* @param tab The details of the tab where the click took place. This parameter is not present for platform apps.
|
|
6660
6725
|
*/
|
|
6661
6726
|
onclick?: (
|
|
6727
|
+
/**
|
|
6728
|
+
* @since Chrome 44
|
|
6729
|
+
*/
|
|
6662
6730
|
info: OnClickData,
|
|
6731
|
+
/**
|
|
6732
|
+
* @since Chrome 44
|
|
6733
|
+
*/
|
|
6663
6734
|
tab: tabs.Tab,
|
|
6664
6735
|
) => void,
|
|
6665
6736
|
|
|
6666
6737
|
/**
|
|
6667
|
-
* The ID of
|
|
6738
|
+
* The ID of the item to be made this item's parent. Note: You cannot set an item to become a child of its own descendant.
|
|
6668
6739
|
*/
|
|
6669
6740
|
parentId?: number | string,
|
|
6670
6741
|
|
|
6671
|
-
/**
|
|
6672
|
-
* Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see [Match Patterns](https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns).
|
|
6673
|
-
*/
|
|
6674
6742
|
documentUrlPatterns?: string[],
|
|
6675
6743
|
|
|
6676
|
-
/**
|
|
6677
|
-
* Similar to `documentUrlPatterns`, filters based on the `src` attribute of `img`, `audio`, and `video` tags and the `href` attribute of `a` tags.
|
|
6678
|
-
*/
|
|
6679
6744
|
targetUrlPatterns?: string[],
|
|
6680
6745
|
|
|
6681
|
-
/**
|
|
6682
|
-
* Whether this context menu item is enabled or disabled. Defaults to `true`.
|
|
6683
|
-
*/
|
|
6684
6746
|
enabled?: boolean,
|
|
6685
6747
|
},
|
|
6686
|
-
|
|
6687
|
-
callback?: () => void,
|
|
6688
|
-
): number | string;
|
|
6748
|
+
): Promise<void>;
|
|
6689
6749
|
|
|
6690
6750
|
/**
|
|
6691
6751
|
* Updates a previously created context menu item.
|
|
@@ -6744,6 +6804,17 @@ declare namespace chrome {
|
|
|
6744
6804
|
callback?: () => void,
|
|
6745
6805
|
): void;
|
|
6746
6806
|
|
|
6807
|
+
/**
|
|
6808
|
+
* Removes a context menu item.
|
|
6809
|
+
*
|
|
6810
|
+
* @chrome-returns-extra since Pending
|
|
6811
|
+
* @param menuItemId The ID of the context menu item to remove.
|
|
6812
|
+
*/
|
|
6813
|
+
export function remove(
|
|
6814
|
+
|
|
6815
|
+
menuItemId: number | string,
|
|
6816
|
+
): Promise<void>;
|
|
6817
|
+
|
|
6747
6818
|
/**
|
|
6748
6819
|
* Removes a context menu item.
|
|
6749
6820
|
*
|
|
@@ -6757,6 +6828,13 @@ declare namespace chrome {
|
|
|
6757
6828
|
callback?: () => void,
|
|
6758
6829
|
): void;
|
|
6759
6830
|
|
|
6831
|
+
/**
|
|
6832
|
+
* Removes all context menu items added by this extension.
|
|
6833
|
+
*
|
|
6834
|
+
* @chrome-returns-extra since Pending
|
|
6835
|
+
*/
|
|
6836
|
+
export function removeAll(): Promise<void>;
|
|
6837
|
+
|
|
6760
6838
|
/**
|
|
6761
6839
|
* Removes all context menu items added by this extension.
|
|
6762
6840
|
*
|
|
@@ -11814,6 +11892,13 @@ declare namespace chrome {
|
|
|
11814
11892
|
* Matches if the port of the URL is contained in any of the specified port lists. For example `[80, 443, [1000, 1200]]` matches all requests on port 80, 443 and in the range 1000-1200.
|
|
11815
11893
|
*/
|
|
11816
11894
|
ports?: (number | number[])[];
|
|
11895
|
+
|
|
11896
|
+
/**
|
|
11897
|
+
* Matches if the host part of the URL is an IP address and is contained in any of the CIDR blocks specified in the array.
|
|
11898
|
+
*
|
|
11899
|
+
* @since Pending
|
|
11900
|
+
*/
|
|
11901
|
+
cidrBlocks?: string[];
|
|
11817
11902
|
}
|
|
11818
11903
|
}
|
|
11819
11904
|
|
package/index.d.ts
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
// Generated on
|
|
18
|
-
// Built at
|
|
17
|
+
// Generated on Tue Feb 06 2024 22:28:45 GMT+0000 (Coordinated Universal Time)
|
|
18
|
+
// Built at f1c1b2fcda4cbf2e21dd3d1d4234eeedae74cb9a
|
|
19
19
|
|
|
20
20
|
// Includes MV3+ APIs only.
|
|
21
21
|
|
|
@@ -271,7 +271,7 @@ declare namespace chrome {
|
|
|
271
271
|
export interface OpenPopupOptions {
|
|
272
272
|
|
|
273
273
|
/**
|
|
274
|
-
* The
|
|
274
|
+
* The ID of the window to open the action popup in. Defaults to the currently-active window if unspecified.
|
|
275
275
|
*/
|
|
276
276
|
windowId?: number;
|
|
277
277
|
}
|
|
@@ -646,7 +646,7 @@ declare namespace chrome {
|
|
|
646
646
|
/**
|
|
647
647
|
* Enables the action for a tab. By default, actions are enabled.
|
|
648
648
|
*
|
|
649
|
-
* @param tabId The
|
|
649
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
650
650
|
*/
|
|
651
651
|
export function enable(
|
|
652
652
|
|
|
@@ -656,7 +656,7 @@ declare namespace chrome {
|
|
|
656
656
|
/**
|
|
657
657
|
* Enables the action for a tab. By default, actions are enabled.
|
|
658
658
|
*
|
|
659
|
-
* @param tabId The
|
|
659
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
660
660
|
*/
|
|
661
661
|
export function enable(
|
|
662
662
|
|
|
@@ -668,7 +668,7 @@ declare namespace chrome {
|
|
|
668
668
|
/**
|
|
669
669
|
* Disables the action for a tab.
|
|
670
670
|
*
|
|
671
|
-
* @param tabId The
|
|
671
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
672
672
|
*/
|
|
673
673
|
export function disable(
|
|
674
674
|
|
|
@@ -678,7 +678,7 @@ declare namespace chrome {
|
|
|
678
678
|
/**
|
|
679
679
|
* Disables the action for a tab.
|
|
680
680
|
*
|
|
681
|
-
* @param tabId The
|
|
681
|
+
* @param tabId The ID of the tab for which you want to modify the action.
|
|
682
682
|
*/
|
|
683
683
|
export function disable(
|
|
684
684
|
|
|
@@ -690,7 +690,7 @@ declare namespace chrome {
|
|
|
690
690
|
/**
|
|
691
691
|
* Indicates whether the extension action is enabled for a tab (or globally if no `tabId` is provided). Actions enabled using only {@link declarativeContent} always return false.
|
|
692
692
|
*
|
|
693
|
-
* @param tabId The
|
|
693
|
+
* @param tabId The ID of the tab for which you want check enabled status.
|
|
694
694
|
* @since Chrome 110
|
|
695
695
|
*/
|
|
696
696
|
export function isEnabled(
|
|
@@ -701,7 +701,7 @@ declare namespace chrome {
|
|
|
701
701
|
/**
|
|
702
702
|
* Indicates whether the extension action is enabled for a tab (or globally if no `tabId` is provided). Actions enabled using only {@link declarativeContent} always return false.
|
|
703
703
|
*
|
|
704
|
-
* @param tabId The
|
|
704
|
+
* @param tabId The ID of the tab for which you want check enabled status.
|
|
705
705
|
* @since Chrome 110
|
|
706
706
|
*/
|
|
707
707
|
export function isEnabled(
|
|
@@ -3343,6 +3343,75 @@ declare namespace chrome {
|
|
|
3343
3343
|
checked?: boolean;
|
|
3344
3344
|
}
|
|
3345
3345
|
|
|
3346
|
+
/**
|
|
3347
|
+
* Properties of the new context menu item.
|
|
3348
|
+
*
|
|
3349
|
+
* @since Pending
|
|
3350
|
+
*/
|
|
3351
|
+
export interface CreateProperties {
|
|
3352
|
+
|
|
3353
|
+
/**
|
|
3354
|
+
* The type of menu item. Defaults to `normal`.
|
|
3355
|
+
*/
|
|
3356
|
+
type?: ItemType;
|
|
3357
|
+
|
|
3358
|
+
/**
|
|
3359
|
+
* The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.
|
|
3360
|
+
*/
|
|
3361
|
+
id?: string;
|
|
3362
|
+
|
|
3363
|
+
/**
|
|
3364
|
+
* The text to display in the item; this is _required_ unless `type` is `separator`. When the context is `selection`, use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
|
|
3365
|
+
*/
|
|
3366
|
+
title?: string;
|
|
3367
|
+
|
|
3368
|
+
/**
|
|
3369
|
+
* The initial state of a checkbox or radio button: `true` for selected, `false` for unselected. Only one radio button can be selected at a time in a given group.
|
|
3370
|
+
*/
|
|
3371
|
+
checked?: boolean;
|
|
3372
|
+
|
|
3373
|
+
/**
|
|
3374
|
+
* List of contexts this menu item will appear in. Defaults to `['page']`.
|
|
3375
|
+
*/
|
|
3376
|
+
contexts?: [ContextType, ...ContextType[]];
|
|
3377
|
+
|
|
3378
|
+
/**
|
|
3379
|
+
* Whether the item is visible in the menu.
|
|
3380
|
+
*/
|
|
3381
|
+
visible?: boolean;
|
|
3382
|
+
|
|
3383
|
+
/**
|
|
3384
|
+
* A function that is called back when the menu item is clicked. This is not available inside of a service worker; instead, they should register a listener for {@link contextMenus.onClicked}.
|
|
3385
|
+
*
|
|
3386
|
+
* @param info Information about the item clicked and the context where the click happened.
|
|
3387
|
+
* @param tab The details of the tab where the click took place. This parameter is not present for platform apps.
|
|
3388
|
+
*/
|
|
3389
|
+
onclick?: (
|
|
3390
|
+
info: OnClickData,
|
|
3391
|
+
tab: tabs.Tab,
|
|
3392
|
+
) => void;
|
|
3393
|
+
|
|
3394
|
+
/**
|
|
3395
|
+
* The ID of a parent menu item; this makes the item a child of a previously added item.
|
|
3396
|
+
*/
|
|
3397
|
+
parentId?: number | string;
|
|
3398
|
+
|
|
3399
|
+
/**
|
|
3400
|
+
* Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see [Match Patterns](https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns).
|
|
3401
|
+
*/
|
|
3402
|
+
documentUrlPatterns?: string[];
|
|
3403
|
+
|
|
3404
|
+
/**
|
|
3405
|
+
* Similar to `documentUrlPatterns`, filters based on the `src` attribute of `img`, `audio`, and `video` tags and the `href` attribute of `a` tags.
|
|
3406
|
+
*/
|
|
3407
|
+
targetUrlPatterns?: string[];
|
|
3408
|
+
|
|
3409
|
+
/**
|
|
3410
|
+
* Whether this context menu item is enabled or disabled. Defaults to `true`.
|
|
3411
|
+
*/
|
|
3412
|
+
enabled?: boolean;
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3346
3415
|
/**
|
|
3347
3416
|
* The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored.
|
|
3348
3417
|
*/
|
|
@@ -3364,31 +3433,30 @@ declare namespace chrome {
|
|
|
3364
3433
|
*/
|
|
3365
3434
|
export function create(
|
|
3366
3435
|
|
|
3367
|
-
createProperties:
|
|
3436
|
+
createProperties: CreateProperties,
|
|
3368
3437
|
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
*/
|
|
3372
|
-
type?: ItemType,
|
|
3438
|
+
callback?: () => void,
|
|
3439
|
+
): number | string;
|
|
3373
3440
|
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3441
|
+
/**
|
|
3442
|
+
* Updates a previously created context menu item.
|
|
3443
|
+
*
|
|
3444
|
+
* @chrome-returns-extra since Pending
|
|
3445
|
+
* @param id The ID of the item to update.
|
|
3446
|
+
* @param updateProperties The properties to update. Accepts the same values as the {@link contextMenus.create} function.
|
|
3447
|
+
*/
|
|
3448
|
+
export function update(
|
|
3449
|
+
|
|
3450
|
+
id: number | string,
|
|
3451
|
+
|
|
3452
|
+
updateProperties: {
|
|
3453
|
+
|
|
3454
|
+
type?: ItemType,
|
|
3378
3455
|
|
|
3379
|
-
/**
|
|
3380
|
-
* The text to display in the item; this is _required_ unless `type` is `separator`. When the context is `selection`, use `%s` within the string to show the selected text. For example, if this parameter's value is "Translate '%s' to Pig Latin" and the user selects the word "cool", the context menu item for the selection is "Translate 'cool' to Pig Latin".
|
|
3381
|
-
*/
|
|
3382
3456
|
title?: string,
|
|
3383
3457
|
|
|
3384
|
-
/**
|
|
3385
|
-
* The initial state of a checkbox or radio button: `true` for selected, `false` for unselected. Only one radio button can be selected at a time in a given group.
|
|
3386
|
-
*/
|
|
3387
3458
|
checked?: boolean,
|
|
3388
3459
|
|
|
3389
|
-
/**
|
|
3390
|
-
* List of contexts this menu item will appear in. Defaults to `['page']`.
|
|
3391
|
-
*/
|
|
3392
3460
|
contexts?: [ContextType, ...ContextType[]],
|
|
3393
3461
|
|
|
3394
3462
|
/**
|
|
@@ -3399,39 +3467,31 @@ declare namespace chrome {
|
|
|
3399
3467
|
visible?: boolean,
|
|
3400
3468
|
|
|
3401
3469
|
/**
|
|
3402
|
-
* A function that is called back when the menu item is clicked. This is not available inside of a service worker; instead, they should register a listener for {@link contextMenus.onClicked}.
|
|
3403
|
-
*
|
|
3404
|
-
* @param info Information about the item clicked and the context where the click happened.
|
|
3405
3470
|
* @param tab The details of the tab where the click took place. This parameter is not present for platform apps.
|
|
3406
3471
|
*/
|
|
3407
3472
|
onclick?: (
|
|
3473
|
+
/**
|
|
3474
|
+
* @since Chrome 44
|
|
3475
|
+
*/
|
|
3408
3476
|
info: OnClickData,
|
|
3477
|
+
/**
|
|
3478
|
+
* @since Chrome 44
|
|
3479
|
+
*/
|
|
3409
3480
|
tab: tabs.Tab,
|
|
3410
3481
|
) => void,
|
|
3411
3482
|
|
|
3412
3483
|
/**
|
|
3413
|
-
* The ID of
|
|
3484
|
+
* The ID of the item to be made this item's parent. Note: You cannot set an item to become a child of its own descendant.
|
|
3414
3485
|
*/
|
|
3415
3486
|
parentId?: number | string,
|
|
3416
3487
|
|
|
3417
|
-
/**
|
|
3418
|
-
* Restricts the item to apply only to documents or frames whose URL matches one of the given patterns. For details on pattern formats, see [Match Patterns](https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns).
|
|
3419
|
-
*/
|
|
3420
3488
|
documentUrlPatterns?: string[],
|
|
3421
3489
|
|
|
3422
|
-
/**
|
|
3423
|
-
* Similar to `documentUrlPatterns`, filters based on the `src` attribute of `img`, `audio`, and `video` tags and the `href` attribute of `a` tags.
|
|
3424
|
-
*/
|
|
3425
3490
|
targetUrlPatterns?: string[],
|
|
3426
3491
|
|
|
3427
|
-
/**
|
|
3428
|
-
* Whether this context menu item is enabled or disabled. Defaults to `true`.
|
|
3429
|
-
*/
|
|
3430
3492
|
enabled?: boolean,
|
|
3431
3493
|
},
|
|
3432
|
-
|
|
3433
|
-
callback?: () => void,
|
|
3434
|
-
): number | string;
|
|
3494
|
+
): Promise<void>;
|
|
3435
3495
|
|
|
3436
3496
|
/**
|
|
3437
3497
|
* Updates a previously created context menu item.
|
|
@@ -3490,6 +3550,17 @@ declare namespace chrome {
|
|
|
3490
3550
|
callback?: () => void,
|
|
3491
3551
|
): void;
|
|
3492
3552
|
|
|
3553
|
+
/**
|
|
3554
|
+
* Removes a context menu item.
|
|
3555
|
+
*
|
|
3556
|
+
* @chrome-returns-extra since Pending
|
|
3557
|
+
* @param menuItemId The ID of the context menu item to remove.
|
|
3558
|
+
*/
|
|
3559
|
+
export function remove(
|
|
3560
|
+
|
|
3561
|
+
menuItemId: number | string,
|
|
3562
|
+
): Promise<void>;
|
|
3563
|
+
|
|
3493
3564
|
/**
|
|
3494
3565
|
* Removes a context menu item.
|
|
3495
3566
|
*
|
|
@@ -3503,6 +3574,13 @@ declare namespace chrome {
|
|
|
3503
3574
|
callback?: () => void,
|
|
3504
3575
|
): void;
|
|
3505
3576
|
|
|
3577
|
+
/**
|
|
3578
|
+
* Removes all context menu items added by this extension.
|
|
3579
|
+
*
|
|
3580
|
+
* @chrome-returns-extra since Pending
|
|
3581
|
+
*/
|
|
3582
|
+
export function removeAll(): Promise<void>;
|
|
3583
|
+
|
|
3506
3584
|
/**
|
|
3507
3585
|
* Removes all context menu items added by this extension.
|
|
3508
3586
|
*
|
|
@@ -7944,6 +8022,13 @@ declare namespace chrome {
|
|
|
7944
8022
|
* Matches if the port of the URL is contained in any of the specified port lists. For example `[80, 443, [1000, 1200]]` matches all requests on port 80, 443 and in the range 1000-1200.
|
|
7945
8023
|
*/
|
|
7946
8024
|
ports?: (number | number[])[];
|
|
8025
|
+
|
|
8026
|
+
/**
|
|
8027
|
+
* Matches if the host part of the URL is an IP address and is contained in any of the CIDR blocks specified in the array.
|
|
8028
|
+
*
|
|
8029
|
+
* @since Pending
|
|
8030
|
+
*/
|
|
8031
|
+
cidrBlocks?: string[];
|
|
7947
8032
|
}
|
|
7948
8033
|
}
|
|
7949
8034
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"name": "chrome-types",
|
|
7
7
|
"config": {
|
|
8
|
-
"build-hash": "
|
|
8
|
+
"build-hash": "b8a137e15f9ca6f2"
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"url": "https://github.com/GoogleChrome/chrome-types/issues"
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/GoogleChrome/chrome-types",
|
|
19
|
-
"version": "0.1.
|
|
19
|
+
"version": "0.1.260"
|
|
20
20
|
}
|