chrome-types 0.1.73 → 0.1.77
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 +201 -13
- package/index.d.ts +154 -10
- 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 Wed Dec 29 2021 22:27:56 GMT+0000 (Coordinated Universal Time)
|
|
18
|
+
// Built at df76446c6f2a16cdb754fe1bc45fa179dc79b7da
|
|
19
19
|
|
|
20
20
|
// Includes all types, including MV2 + Platform Apps APIs.
|
|
21
21
|
|
|
@@ -12487,6 +12487,33 @@ declare namespace chrome {
|
|
|
12487
12487
|
sendResponse: () => void,
|
|
12488
12488
|
) => void>;
|
|
12489
12489
|
|
|
12490
|
+
/**
|
|
12491
|
+
* Sends a single request to other listeners within the extension. Similar to {@link runtime.connect}, but only sends a single request with an optional response. The {@link extension.onRequest} event is fired in each page of the extension.
|
|
12492
|
+
*
|
|
12493
|
+
* @chrome-returns-extra since Pending
|
|
12494
|
+
* @param extensionId The extension ID of the extension you want to connect to. If omitted, default is your own extension.
|
|
12495
|
+
* @deprecated Please use {@link runtime.sendMessage}.
|
|
12496
|
+
* @chrome-max-manifest MV2
|
|
12497
|
+
*/
|
|
12498
|
+
export function sendRequest(
|
|
12499
|
+
|
|
12500
|
+
extensionId: string,
|
|
12501
|
+
|
|
12502
|
+
request: any,
|
|
12503
|
+
): Promise<any>;
|
|
12504
|
+
|
|
12505
|
+
/**
|
|
12506
|
+
* Sends a single request to other listeners within the extension. Similar to {@link runtime.connect}, but only sends a single request with an optional response. The {@link extension.onRequest} event is fired in each page of the extension.
|
|
12507
|
+
*
|
|
12508
|
+
* @chrome-returns-extra since Pending
|
|
12509
|
+
* @deprecated Please use {@link runtime.sendMessage}.
|
|
12510
|
+
* @chrome-max-manifest MV2
|
|
12511
|
+
*/
|
|
12512
|
+
export function sendRequest(
|
|
12513
|
+
|
|
12514
|
+
request: any,
|
|
12515
|
+
): Promise<any>;
|
|
12516
|
+
|
|
12490
12517
|
/**
|
|
12491
12518
|
* Sends a single request to other listeners within the extension. Similar to {@link runtime.connect}, but only sends a single request with an optional response. The {@link extension.onRequest} event is fired in each page of the extension.
|
|
12492
12519
|
*
|
|
@@ -12502,8 +12529,9 @@ declare namespace chrome {
|
|
|
12502
12529
|
|
|
12503
12530
|
/**
|
|
12504
12531
|
* @param response The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
12532
|
+
* @since Pending
|
|
12505
12533
|
*/
|
|
12506
|
-
|
|
12534
|
+
callback?: (
|
|
12507
12535
|
response: any,
|
|
12508
12536
|
) => void,
|
|
12509
12537
|
): void;
|
|
@@ -12520,8 +12548,9 @@ declare namespace chrome {
|
|
|
12520
12548
|
|
|
12521
12549
|
/**
|
|
12522
12550
|
* @param response The JSON response object sent by the handler of the request. If an error occurs while connecting to the extension, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
12551
|
+
* @since Pending
|
|
12523
12552
|
*/
|
|
12524
|
-
|
|
12553
|
+
callback?: (
|
|
12525
12554
|
response: any,
|
|
12526
12555
|
) => void,
|
|
12527
12556
|
): void;
|
|
@@ -12589,6 +12618,13 @@ declare namespace chrome {
|
|
|
12589
12618
|
windowId?: number,
|
|
12590
12619
|
): Window[];
|
|
12591
12620
|
|
|
12621
|
+
/**
|
|
12622
|
+
* Retrieves the state of the extension's access to Incognito-mode. This corresponds to the user-controlled per-extension 'Allowed in Incognito' setting accessible via the chrome://extensions page.
|
|
12623
|
+
*
|
|
12624
|
+
* @chrome-returns-extra since Pending
|
|
12625
|
+
*/
|
|
12626
|
+
export function isAllowedIncognitoAccess(): Promise<boolean>;
|
|
12627
|
+
|
|
12592
12628
|
/**
|
|
12593
12629
|
* Retrieves the state of the extension's access to Incognito-mode. This corresponds to the user-controlled per-extension 'Allowed in Incognito' setting accessible via the chrome://extensions page.
|
|
12594
12630
|
*/
|
|
@@ -12597,11 +12633,18 @@ declare namespace chrome {
|
|
|
12597
12633
|
/**
|
|
12598
12634
|
* @param isAllowedAccess True if the extension has access to Incognito mode, false otherwise.
|
|
12599
12635
|
*/
|
|
12600
|
-
callback
|
|
12636
|
+
callback?: (
|
|
12601
12637
|
isAllowedAccess: boolean,
|
|
12602
12638
|
) => void,
|
|
12603
12639
|
): void;
|
|
12604
12640
|
|
|
12641
|
+
/**
|
|
12642
|
+
* Retrieves the state of the extension's access to the 'file://' scheme. This corresponds to the user-controlled per-extension 'Allow access to File URLs' setting accessible via the chrome://extensions page.
|
|
12643
|
+
*
|
|
12644
|
+
* @chrome-returns-extra since Pending
|
|
12645
|
+
*/
|
|
12646
|
+
export function isAllowedFileSchemeAccess(): Promise<boolean>;
|
|
12647
|
+
|
|
12605
12648
|
/**
|
|
12606
12649
|
* Retrieves the state of the extension's access to the 'file://' scheme. This corresponds to the user-controlled per-extension 'Allow access to File URLs' setting accessible via the chrome://extensions page.
|
|
12607
12650
|
*/
|
|
@@ -12610,7 +12653,7 @@ declare namespace chrome {
|
|
|
12610
12653
|
/**
|
|
12611
12654
|
* @param isAllowedAccess True if the extension can access the 'file://' scheme, false otherwise.
|
|
12612
12655
|
*/
|
|
12613
|
-
callback
|
|
12656
|
+
callback?: (
|
|
12614
12657
|
isAllowedAccess: boolean,
|
|
12615
12658
|
) => void,
|
|
12616
12659
|
): void;
|
|
@@ -22443,6 +22486,14 @@ declare namespace chrome {
|
|
|
22443
22486
|
reason: OnRestartRequiredReason,
|
|
22444
22487
|
) => void>;
|
|
22445
22488
|
|
|
22489
|
+
/**
|
|
22490
|
+
* Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.
|
|
22491
|
+
*
|
|
22492
|
+
* @chrome-returns-extra since Pending
|
|
22493
|
+
* @chrome-disallow-service-workers
|
|
22494
|
+
*/
|
|
22495
|
+
export function getBackgroundPage(): Promise<Window | undefined>;
|
|
22496
|
+
|
|
22446
22497
|
/**
|
|
22447
22498
|
* Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.
|
|
22448
22499
|
*
|
|
@@ -22453,11 +22504,22 @@ declare namespace chrome {
|
|
|
22453
22504
|
/**
|
|
22454
22505
|
* @param backgroundPage The JavaScript 'window' object for the background page.
|
|
22455
22506
|
*/
|
|
22456
|
-
callback
|
|
22507
|
+
callback?: (
|
|
22457
22508
|
backgroundPage?: Window,
|
|
22458
22509
|
) => void,
|
|
22459
22510
|
): void;
|
|
22460
22511
|
|
|
22512
|
+
/**
|
|
22513
|
+
* Open your Extension's options page, if possible.
|
|
22514
|
+
*
|
|
22515
|
+
* The precise behavior may depend on your manifest's `[options_ui](https://developer.chrome.com/docs/extensions/optionsV2)` or `[options_page](https://developer.chrome.com/docs/extensions/options)` key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.
|
|
22516
|
+
*
|
|
22517
|
+
* If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set {@link lastError}.
|
|
22518
|
+
*
|
|
22519
|
+
* @chrome-returns-extra since Pending
|
|
22520
|
+
*/
|
|
22521
|
+
export function openOptionsPage(): Promise<void>;
|
|
22522
|
+
|
|
22461
22523
|
/**
|
|
22462
22524
|
* Open your Extension's options page, if possible.
|
|
22463
22525
|
*
|
|
@@ -22488,6 +22550,17 @@ declare namespace chrome {
|
|
|
22488
22550
|
path: string,
|
|
22489
22551
|
): string;
|
|
22490
22552
|
|
|
22553
|
+
/**
|
|
22554
|
+
* Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
|
|
22555
|
+
*
|
|
22556
|
+
* @chrome-returns-extra since Pending
|
|
22557
|
+
* @param url URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
|
|
22558
|
+
*/
|
|
22559
|
+
export function setUninstallURL(
|
|
22560
|
+
|
|
22561
|
+
url: string,
|
|
22562
|
+
): Promise<void>;
|
|
22563
|
+
|
|
22491
22564
|
/**
|
|
22492
22565
|
* Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
|
|
22493
22566
|
*
|
|
@@ -22539,6 +22612,18 @@ declare namespace chrome {
|
|
|
22539
22612
|
*/
|
|
22540
22613
|
export function restart(): void;
|
|
22541
22614
|
|
|
22615
|
+
/**
|
|
22616
|
+
* Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
|
|
22617
|
+
*
|
|
22618
|
+
* @chrome-returns-extra since Pending
|
|
22619
|
+
* @param seconds Time to wait in seconds before rebooting the device, or -1 to cancel a scheduled reboot.
|
|
22620
|
+
* @since Chrome 53
|
|
22621
|
+
*/
|
|
22622
|
+
export function restartAfterDelay(
|
|
22623
|
+
|
|
22624
|
+
seconds: number,
|
|
22625
|
+
): Promise<void>;
|
|
22626
|
+
|
|
22542
22627
|
/**
|
|
22543
22628
|
* Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
|
|
22544
22629
|
*
|
|
@@ -22589,6 +22674,47 @@ declare namespace chrome {
|
|
|
22589
22674
|
application: string,
|
|
22590
22675
|
): Port;
|
|
22591
22676
|
|
|
22677
|
+
/**
|
|
22678
|
+
* Sends a single message to event listeners within your extension/app or a different extension/app. Similar to {@link runtime.connect} but only sends a single message, with an optional response. If sending to your extension, the {@link runtime.onMessage} event will be fired in every frame of your extension (except for the sender's frame), or {@link runtime.onMessageExternal}, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use {@link tabs.sendMessage}.
|
|
22679
|
+
*
|
|
22680
|
+
* @chrome-returns-extra since Pending
|
|
22681
|
+
* @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for [web messaging](https://developer.chrome.com/docs/extensions/manifest/externally_connectable).
|
|
22682
|
+
* @param message The message to send. This message should be a JSON-ifiable object.
|
|
22683
|
+
*/
|
|
22684
|
+
export function sendMessage(
|
|
22685
|
+
|
|
22686
|
+
extensionId: string,
|
|
22687
|
+
|
|
22688
|
+
message: any,
|
|
22689
|
+
|
|
22690
|
+
options?: {
|
|
22691
|
+
|
|
22692
|
+
/**
|
|
22693
|
+
* Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event.
|
|
22694
|
+
*/
|
|
22695
|
+
includeTlsChannelId?: boolean,
|
|
22696
|
+
},
|
|
22697
|
+
): Promise<any>;
|
|
22698
|
+
|
|
22699
|
+
/**
|
|
22700
|
+
* Sends a single message to event listeners within your extension/app or a different extension/app. Similar to {@link runtime.connect} but only sends a single message, with an optional response. If sending to your extension, the {@link runtime.onMessage} event will be fired in every frame of your extension (except for the sender's frame), or {@link runtime.onMessageExternal}, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use {@link tabs.sendMessage}.
|
|
22701
|
+
*
|
|
22702
|
+
* @chrome-returns-extra since Pending
|
|
22703
|
+
* @param message The message to send. This message should be a JSON-ifiable object.
|
|
22704
|
+
*/
|
|
22705
|
+
export function sendMessage(
|
|
22706
|
+
|
|
22707
|
+
message: any,
|
|
22708
|
+
|
|
22709
|
+
options?: {
|
|
22710
|
+
|
|
22711
|
+
/**
|
|
22712
|
+
* Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event.
|
|
22713
|
+
*/
|
|
22714
|
+
includeTlsChannelId?: boolean,
|
|
22715
|
+
},
|
|
22716
|
+
): Promise<any>;
|
|
22717
|
+
|
|
22592
22718
|
/**
|
|
22593
22719
|
* Sends a single message to event listeners within your extension/app or a different extension/app. Similar to {@link runtime.connect} but only sends a single message, with an optional response. If sending to your extension, the {@link runtime.onMessage} event will be fired in every frame of your extension (except for the sender's frame), or {@link runtime.onMessageExternal}, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use {@link tabs.sendMessage}.
|
|
22594
22720
|
*
|
|
@@ -22611,8 +22737,9 @@ declare namespace chrome {
|
|
|
22611
22737
|
|
|
22612
22738
|
/**
|
|
22613
22739
|
* @param response The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
22740
|
+
* @since Pending
|
|
22614
22741
|
*/
|
|
22615
|
-
|
|
22742
|
+
callback?: (
|
|
22616
22743
|
response: any,
|
|
22617
22744
|
) => void,
|
|
22618
22745
|
): void;
|
|
@@ -22636,12 +22763,28 @@ declare namespace chrome {
|
|
|
22636
22763
|
|
|
22637
22764
|
/**
|
|
22638
22765
|
* @param response The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
22766
|
+
* @since Pending
|
|
22639
22767
|
*/
|
|
22640
|
-
|
|
22768
|
+
callback?: (
|
|
22641
22769
|
response: any,
|
|
22642
22770
|
) => void,
|
|
22643
22771
|
): void;
|
|
22644
22772
|
|
|
22773
|
+
/**
|
|
22774
|
+
* Send a single message to a native application.
|
|
22775
|
+
*
|
|
22776
|
+
* @chrome-returns-extra since Pending
|
|
22777
|
+
* @param application The name of the native messaging host.
|
|
22778
|
+
* @param message The message that will be passed to the native messaging host.
|
|
22779
|
+
* @chrome-permission nativeMessaging
|
|
22780
|
+
*/
|
|
22781
|
+
export function sendNativeMessage(
|
|
22782
|
+
|
|
22783
|
+
application: string,
|
|
22784
|
+
|
|
22785
|
+
message: {[name: string]: any},
|
|
22786
|
+
): Promise<any>;
|
|
22787
|
+
|
|
22645
22788
|
/**
|
|
22646
22789
|
* Send a single message to a native application.
|
|
22647
22790
|
*
|
|
@@ -22657,12 +22800,20 @@ declare namespace chrome {
|
|
|
22657
22800
|
|
|
22658
22801
|
/**
|
|
22659
22802
|
* @param response The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
22803
|
+
* @since Pending
|
|
22660
22804
|
*/
|
|
22661
|
-
|
|
22805
|
+
callback?: (
|
|
22662
22806
|
response: any,
|
|
22663
22807
|
) => void,
|
|
22664
22808
|
): void;
|
|
22665
22809
|
|
|
22810
|
+
/**
|
|
22811
|
+
* Returns information about the current platform.
|
|
22812
|
+
*
|
|
22813
|
+
* @chrome-returns-extra since Pending
|
|
22814
|
+
*/
|
|
22815
|
+
export function getPlatformInfo(): Promise<PlatformInfo>;
|
|
22816
|
+
|
|
22666
22817
|
/**
|
|
22667
22818
|
* Returns information about the current platform.
|
|
22668
22819
|
*
|
|
@@ -22670,7 +22821,7 @@ declare namespace chrome {
|
|
|
22670
22821
|
*/
|
|
22671
22822
|
export function getPlatformInfo(
|
|
22672
22823
|
|
|
22673
|
-
callback
|
|
22824
|
+
callback?: (
|
|
22674
22825
|
platformInfo: PlatformInfo,
|
|
22675
22826
|
) => void,
|
|
22676
22827
|
): void;
|
|
@@ -27940,6 +28091,20 @@ declare namespace chrome {
|
|
|
27940
28091
|
},
|
|
27941
28092
|
): runtime.Port;
|
|
27942
28093
|
|
|
28094
|
+
/**
|
|
28095
|
+
* 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 {@link extension.onRequest} event is fired in each content script running in the specified tab for the current extension.
|
|
28096
|
+
*
|
|
28097
|
+
* @chrome-returns-extra since Pending
|
|
28098
|
+
* @deprecated Please use {@link runtime.sendMessage}.
|
|
28099
|
+
* @chrome-max-manifest MV2
|
|
28100
|
+
*/
|
|
28101
|
+
export function sendRequest(
|
|
28102
|
+
|
|
28103
|
+
tabId: number,
|
|
28104
|
+
|
|
28105
|
+
request: any,
|
|
28106
|
+
): Promise<any>;
|
|
28107
|
+
|
|
27943
28108
|
/**
|
|
27944
28109
|
* 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 {@link extension.onRequest} event is fired in each content script running in the specified tab for the current extension.
|
|
27945
28110
|
*
|
|
@@ -27954,12 +28119,34 @@ declare namespace chrome {
|
|
|
27954
28119
|
|
|
27955
28120
|
/**
|
|
27956
28121
|
* @param response The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback is called with no arguments and {@link runtime.lastError} is set to the error message.
|
|
28122
|
+
* @since Pending
|
|
27957
28123
|
*/
|
|
27958
|
-
|
|
28124
|
+
callback?: (
|
|
27959
28125
|
response: any,
|
|
27960
28126
|
) => void,
|
|
27961
28127
|
): void;
|
|
27962
28128
|
|
|
28129
|
+
/**
|
|
28130
|
+
* Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The {@link runtime.onMessage} event is fired in each content script running in the specified tab for the current extension.
|
|
28131
|
+
*
|
|
28132
|
+
* @chrome-returns-extra since Pending
|
|
28133
|
+
* @param message The message to send. This message should be a JSON-ifiable object.
|
|
28134
|
+
*/
|
|
28135
|
+
export function sendMessage(
|
|
28136
|
+
|
|
28137
|
+
tabId: number,
|
|
28138
|
+
|
|
28139
|
+
message: any,
|
|
28140
|
+
|
|
28141
|
+
options?: {
|
|
28142
|
+
|
|
28143
|
+
/**
|
|
28144
|
+
* Send a message to a specific [frame](https://developer.chrome.com/docs/extensions/reference/webNavigation/#frame_ids) identified by `frameId` instead of all frames in the tab.
|
|
28145
|
+
*/
|
|
28146
|
+
frameId?: number,
|
|
28147
|
+
},
|
|
28148
|
+
): Promise<any>;
|
|
28149
|
+
|
|
27963
28150
|
/**
|
|
27964
28151
|
* Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The {@link runtime.onMessage} event is fired in each content script running in the specified tab for the current extension.
|
|
27965
28152
|
*
|
|
@@ -27981,8 +28168,9 @@ declare namespace chrome {
|
|
|
27981
28168
|
|
|
27982
28169
|
/**
|
|
27983
28170
|
* @param response The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback is called with no arguments and {@link runtime.lastError} is set to the error message.
|
|
28171
|
+
* @since Pending
|
|
27984
28172
|
*/
|
|
27985
|
-
|
|
28173
|
+
callback?: (
|
|
27986
28174
|
response: any,
|
|
27987
28175
|
) => void,
|
|
27988
28176
|
): void;
|
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 Wed Dec 29 2021 22:27:51 GMT+0000 (Coordinated Universal Time)
|
|
18
|
+
// Built at df76446c6f2a16cdb754fe1bc45fa179dc79b7da
|
|
19
19
|
|
|
20
20
|
// Includes MV3+ APIs only.
|
|
21
21
|
|
|
@@ -8455,6 +8455,13 @@ declare namespace chrome {
|
|
|
8455
8455
|
*/
|
|
8456
8456
|
export function getBackgroundPage(): Window | undefined;
|
|
8457
8457
|
|
|
8458
|
+
/**
|
|
8459
|
+
* Retrieves the state of the extension's access to Incognito-mode. This corresponds to the user-controlled per-extension 'Allowed in Incognito' setting accessible via the chrome://extensions page.
|
|
8460
|
+
*
|
|
8461
|
+
* @chrome-returns-extra since Pending
|
|
8462
|
+
*/
|
|
8463
|
+
export function isAllowedIncognitoAccess(): Promise<boolean>;
|
|
8464
|
+
|
|
8458
8465
|
/**
|
|
8459
8466
|
* Retrieves the state of the extension's access to Incognito-mode. This corresponds to the user-controlled per-extension 'Allowed in Incognito' setting accessible via the chrome://extensions page.
|
|
8460
8467
|
*/
|
|
@@ -8463,11 +8470,18 @@ declare namespace chrome {
|
|
|
8463
8470
|
/**
|
|
8464
8471
|
* @param isAllowedAccess True if the extension has access to Incognito mode, false otherwise.
|
|
8465
8472
|
*/
|
|
8466
|
-
callback
|
|
8473
|
+
callback?: (
|
|
8467
8474
|
isAllowedAccess: boolean,
|
|
8468
8475
|
) => void,
|
|
8469
8476
|
): void;
|
|
8470
8477
|
|
|
8478
|
+
/**
|
|
8479
|
+
* Retrieves the state of the extension's access to the 'file://' scheme. This corresponds to the user-controlled per-extension 'Allow access to File URLs' setting accessible via the chrome://extensions page.
|
|
8480
|
+
*
|
|
8481
|
+
* @chrome-returns-extra since Pending
|
|
8482
|
+
*/
|
|
8483
|
+
export function isAllowedFileSchemeAccess(): Promise<boolean>;
|
|
8484
|
+
|
|
8471
8485
|
/**
|
|
8472
8486
|
* Retrieves the state of the extension's access to the 'file://' scheme. This corresponds to the user-controlled per-extension 'Allow access to File URLs' setting accessible via the chrome://extensions page.
|
|
8473
8487
|
*/
|
|
@@ -8476,7 +8490,7 @@ declare namespace chrome {
|
|
|
8476
8490
|
/**
|
|
8477
8491
|
* @param isAllowedAccess True if the extension can access the 'file://' scheme, false otherwise.
|
|
8478
8492
|
*/
|
|
8479
|
-
callback
|
|
8493
|
+
callback?: (
|
|
8480
8494
|
isAllowedAccess: boolean,
|
|
8481
8495
|
) => void,
|
|
8482
8496
|
): void;
|
|
@@ -15354,6 +15368,14 @@ declare namespace chrome {
|
|
|
15354
15368
|
reason: OnRestartRequiredReason,
|
|
15355
15369
|
) => void>;
|
|
15356
15370
|
|
|
15371
|
+
/**
|
|
15372
|
+
* Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.
|
|
15373
|
+
*
|
|
15374
|
+
* @chrome-returns-extra since Pending
|
|
15375
|
+
* @chrome-disallow-service-workers
|
|
15376
|
+
*/
|
|
15377
|
+
export function getBackgroundPage(): Promise<Window | undefined>;
|
|
15378
|
+
|
|
15357
15379
|
/**
|
|
15358
15380
|
* Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.
|
|
15359
15381
|
*
|
|
@@ -15364,11 +15386,22 @@ declare namespace chrome {
|
|
|
15364
15386
|
/**
|
|
15365
15387
|
* @param backgroundPage The JavaScript 'window' object for the background page.
|
|
15366
15388
|
*/
|
|
15367
|
-
callback
|
|
15389
|
+
callback?: (
|
|
15368
15390
|
backgroundPage?: Window,
|
|
15369
15391
|
) => void,
|
|
15370
15392
|
): void;
|
|
15371
15393
|
|
|
15394
|
+
/**
|
|
15395
|
+
* Open your Extension's options page, if possible.
|
|
15396
|
+
*
|
|
15397
|
+
* The precise behavior may depend on your manifest's `[options_ui](https://developer.chrome.com/docs/extensions/optionsV2)` or `[options_page](https://developer.chrome.com/docs/extensions/options)` key, or what Chrome happens to support at the time. For example, the page may be opened in a new tab, within chrome://extensions, within an App, or it may just focus an open options page. It will never cause the caller page to reload.
|
|
15398
|
+
*
|
|
15399
|
+
* If your Extension does not declare an options page, or Chrome failed to create one for some other reason, the callback will set {@link lastError}.
|
|
15400
|
+
*
|
|
15401
|
+
* @chrome-returns-extra since Pending
|
|
15402
|
+
*/
|
|
15403
|
+
export function openOptionsPage(): Promise<void>;
|
|
15404
|
+
|
|
15372
15405
|
/**
|
|
15373
15406
|
* Open your Extension's options page, if possible.
|
|
15374
15407
|
*
|
|
@@ -15399,6 +15432,17 @@ declare namespace chrome {
|
|
|
15399
15432
|
path: string,
|
|
15400
15433
|
): string;
|
|
15401
15434
|
|
|
15435
|
+
/**
|
|
15436
|
+
* Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
|
|
15437
|
+
*
|
|
15438
|
+
* @chrome-returns-extra since Pending
|
|
15439
|
+
* @param url URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation.
|
|
15440
|
+
*/
|
|
15441
|
+
export function setUninstallURL(
|
|
15442
|
+
|
|
15443
|
+
url: string,
|
|
15444
|
+
): Promise<void>;
|
|
15445
|
+
|
|
15402
15446
|
/**
|
|
15403
15447
|
* Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.
|
|
15404
15448
|
*
|
|
@@ -15450,6 +15494,18 @@ declare namespace chrome {
|
|
|
15450
15494
|
*/
|
|
15451
15495
|
export function restart(): void;
|
|
15452
15496
|
|
|
15497
|
+
/**
|
|
15498
|
+
* Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
|
|
15499
|
+
*
|
|
15500
|
+
* @chrome-returns-extra since Pending
|
|
15501
|
+
* @param seconds Time to wait in seconds before rebooting the device, or -1 to cancel a scheduled reboot.
|
|
15502
|
+
* @since Chrome 53
|
|
15503
|
+
*/
|
|
15504
|
+
export function restartAfterDelay(
|
|
15505
|
+
|
|
15506
|
+
seconds: number,
|
|
15507
|
+
): Promise<void>;
|
|
15508
|
+
|
|
15453
15509
|
/**
|
|
15454
15510
|
* Restart the ChromeOS device when the app runs in kiosk mode after the given seconds. If called again before the time ends, the reboot will be delayed. If called with a value of -1, the reboot will be cancelled. It's a no-op in non-kiosk mode. It's only allowed to be called repeatedly by the first extension to invoke this API.
|
|
15455
15511
|
*
|
|
@@ -15500,6 +15556,47 @@ declare namespace chrome {
|
|
|
15500
15556
|
application: string,
|
|
15501
15557
|
): Port;
|
|
15502
15558
|
|
|
15559
|
+
/**
|
|
15560
|
+
* Sends a single message to event listeners within your extension/app or a different extension/app. Similar to {@link runtime.connect} but only sends a single message, with an optional response. If sending to your extension, the {@link runtime.onMessage} event will be fired in every frame of your extension (except for the sender's frame), or {@link runtime.onMessageExternal}, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use {@link tabs.sendMessage}.
|
|
15561
|
+
*
|
|
15562
|
+
* @chrome-returns-extra since Pending
|
|
15563
|
+
* @param extensionId The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for [web messaging](https://developer.chrome.com/docs/extensions/manifest/externally_connectable).
|
|
15564
|
+
* @param message The message to send. This message should be a JSON-ifiable object.
|
|
15565
|
+
*/
|
|
15566
|
+
export function sendMessage(
|
|
15567
|
+
|
|
15568
|
+
extensionId: string,
|
|
15569
|
+
|
|
15570
|
+
message: any,
|
|
15571
|
+
|
|
15572
|
+
options?: {
|
|
15573
|
+
|
|
15574
|
+
/**
|
|
15575
|
+
* Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event.
|
|
15576
|
+
*/
|
|
15577
|
+
includeTlsChannelId?: boolean,
|
|
15578
|
+
},
|
|
15579
|
+
): Promise<any>;
|
|
15580
|
+
|
|
15581
|
+
/**
|
|
15582
|
+
* Sends a single message to event listeners within your extension/app or a different extension/app. Similar to {@link runtime.connect} but only sends a single message, with an optional response. If sending to your extension, the {@link runtime.onMessage} event will be fired in every frame of your extension (except for the sender's frame), or {@link runtime.onMessageExternal}, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use {@link tabs.sendMessage}.
|
|
15583
|
+
*
|
|
15584
|
+
* @chrome-returns-extra since Pending
|
|
15585
|
+
* @param message The message to send. This message should be a JSON-ifiable object.
|
|
15586
|
+
*/
|
|
15587
|
+
export function sendMessage(
|
|
15588
|
+
|
|
15589
|
+
message: any,
|
|
15590
|
+
|
|
15591
|
+
options?: {
|
|
15592
|
+
|
|
15593
|
+
/**
|
|
15594
|
+
* Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event.
|
|
15595
|
+
*/
|
|
15596
|
+
includeTlsChannelId?: boolean,
|
|
15597
|
+
},
|
|
15598
|
+
): Promise<any>;
|
|
15599
|
+
|
|
15503
15600
|
/**
|
|
15504
15601
|
* Sends a single message to event listeners within your extension/app or a different extension/app. Similar to {@link runtime.connect} but only sends a single message, with an optional response. If sending to your extension, the {@link runtime.onMessage} event will be fired in every frame of your extension (except for the sender's frame), or {@link runtime.onMessageExternal}, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use {@link tabs.sendMessage}.
|
|
15505
15602
|
*
|
|
@@ -15522,8 +15619,9 @@ declare namespace chrome {
|
|
|
15522
15619
|
|
|
15523
15620
|
/**
|
|
15524
15621
|
* @param response The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
15622
|
+
* @since Pending
|
|
15525
15623
|
*/
|
|
15526
|
-
|
|
15624
|
+
callback?: (
|
|
15527
15625
|
response: any,
|
|
15528
15626
|
) => void,
|
|
15529
15627
|
): void;
|
|
@@ -15547,12 +15645,28 @@ declare namespace chrome {
|
|
|
15547
15645
|
|
|
15548
15646
|
/**
|
|
15549
15647
|
* @param response The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
15648
|
+
* @since Pending
|
|
15550
15649
|
*/
|
|
15551
|
-
|
|
15650
|
+
callback?: (
|
|
15552
15651
|
response: any,
|
|
15553
15652
|
) => void,
|
|
15554
15653
|
): void;
|
|
15555
15654
|
|
|
15655
|
+
/**
|
|
15656
|
+
* Send a single message to a native application.
|
|
15657
|
+
*
|
|
15658
|
+
* @chrome-returns-extra since Pending
|
|
15659
|
+
* @param application The name of the native messaging host.
|
|
15660
|
+
* @param message The message that will be passed to the native messaging host.
|
|
15661
|
+
* @chrome-permission nativeMessaging
|
|
15662
|
+
*/
|
|
15663
|
+
export function sendNativeMessage(
|
|
15664
|
+
|
|
15665
|
+
application: string,
|
|
15666
|
+
|
|
15667
|
+
message: {[name: string]: any},
|
|
15668
|
+
): Promise<any>;
|
|
15669
|
+
|
|
15556
15670
|
/**
|
|
15557
15671
|
* Send a single message to a native application.
|
|
15558
15672
|
*
|
|
@@ -15568,12 +15682,20 @@ declare namespace chrome {
|
|
|
15568
15682
|
|
|
15569
15683
|
/**
|
|
15570
15684
|
* @param response The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and {@link runtime.lastError} will be set to the error message.
|
|
15685
|
+
* @since Pending
|
|
15571
15686
|
*/
|
|
15572
|
-
|
|
15687
|
+
callback?: (
|
|
15573
15688
|
response: any,
|
|
15574
15689
|
) => void,
|
|
15575
15690
|
): void;
|
|
15576
15691
|
|
|
15692
|
+
/**
|
|
15693
|
+
* Returns information about the current platform.
|
|
15694
|
+
*
|
|
15695
|
+
* @chrome-returns-extra since Pending
|
|
15696
|
+
*/
|
|
15697
|
+
export function getPlatformInfo(): Promise<PlatformInfo>;
|
|
15698
|
+
|
|
15577
15699
|
/**
|
|
15578
15700
|
* Returns information about the current platform.
|
|
15579
15701
|
*
|
|
@@ -15581,7 +15703,7 @@ declare namespace chrome {
|
|
|
15581
15703
|
*/
|
|
15582
15704
|
export function getPlatformInfo(
|
|
15583
15705
|
|
|
15584
|
-
callback
|
|
15706
|
+
callback?: (
|
|
15585
15707
|
platformInfo: PlatformInfo,
|
|
15586
15708
|
) => void,
|
|
15587
15709
|
): void;
|
|
@@ -18334,6 +18456,27 @@ declare namespace chrome {
|
|
|
18334
18456
|
},
|
|
18335
18457
|
): runtime.Port;
|
|
18336
18458
|
|
|
18459
|
+
/**
|
|
18460
|
+
* Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The {@link runtime.onMessage} event is fired in each content script running in the specified tab for the current extension.
|
|
18461
|
+
*
|
|
18462
|
+
* @chrome-returns-extra since Pending
|
|
18463
|
+
* @param message The message to send. This message should be a JSON-ifiable object.
|
|
18464
|
+
*/
|
|
18465
|
+
export function sendMessage(
|
|
18466
|
+
|
|
18467
|
+
tabId: number,
|
|
18468
|
+
|
|
18469
|
+
message: any,
|
|
18470
|
+
|
|
18471
|
+
options?: {
|
|
18472
|
+
|
|
18473
|
+
/**
|
|
18474
|
+
* Send a message to a specific [frame](https://developer.chrome.com/docs/extensions/reference/webNavigation/#frame_ids) identified by `frameId` instead of all frames in the tab.
|
|
18475
|
+
*/
|
|
18476
|
+
frameId?: number,
|
|
18477
|
+
},
|
|
18478
|
+
): Promise<any>;
|
|
18479
|
+
|
|
18337
18480
|
/**
|
|
18338
18481
|
* Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The {@link runtime.onMessage} event is fired in each content script running in the specified tab for the current extension.
|
|
18339
18482
|
*
|
|
@@ -18355,8 +18498,9 @@ declare namespace chrome {
|
|
|
18355
18498
|
|
|
18356
18499
|
/**
|
|
18357
18500
|
* @param response The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback is called with no arguments and {@link runtime.lastError} is set to the error message.
|
|
18501
|
+
* @since Pending
|
|
18358
18502
|
*/
|
|
18359
|
-
|
|
18503
|
+
callback?: (
|
|
18360
18504
|
response: any,
|
|
18361
18505
|
) => void,
|
|
18362
18506
|
): void;
|
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": "d8fa02cc593612ae"
|
|
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.77"
|
|
20
20
|
}
|