@types/chrome 0.1.24 → 0.1.25
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.
- chrome/README.md +1 -1
- chrome/index.d.ts +259 -173
- chrome/package.json +2 -2
chrome/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 27 Oct 2025 18:40:39 GMT
|
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
|
13
13
|
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
|
@@ -12247,16 +12247,16 @@ declare namespace chrome {
|
|
|
12247
12247
|
*/
|
|
12248
12248
|
value: T;
|
|
12249
12249
|
/** Where to set the setting (default: regular). */
|
|
12250
|
-
scope?: ChromeSettingScope;
|
|
12250
|
+
scope?: ChromeSettingScope | undefined;
|
|
12251
12251
|
}
|
|
12252
12252
|
|
|
12253
12253
|
/** Which setting to consider. */
|
|
12254
12254
|
export interface ChromeSettingGetDetails {
|
|
12255
12255
|
/** Whether to return the value that applies to the incognito session (default false). */
|
|
12256
|
-
incognito?: boolean;
|
|
12256
|
+
incognito?: boolean | undefined;
|
|
12257
12257
|
}
|
|
12258
12258
|
|
|
12259
|
-
/** Details of the currently effective value */
|
|
12259
|
+
/** Details of the currently effective value. */
|
|
12260
12260
|
export interface ChromeSettingGetResult<T> {
|
|
12261
12261
|
/** The level of control of the setting. */
|
|
12262
12262
|
levelOfControl: LevelOfControl;
|
|
@@ -12264,7 +12264,7 @@ declare namespace chrome {
|
|
|
12264
12264
|
value: T;
|
|
12265
12265
|
/**
|
|
12266
12266
|
* Whether the effective value is specific to the incognito session.
|
|
12267
|
-
* This property will only be present if the incognito property in the details parameter of get() was true.
|
|
12267
|
+
* This property will only be present if the `incognito` property in the `details` parameter of `get()` was true.
|
|
12268
12268
|
*/
|
|
12269
12269
|
incognitoSpecific?: boolean;
|
|
12270
12270
|
}
|
|
@@ -12272,17 +12272,14 @@ declare namespace chrome {
|
|
|
12272
12272
|
/** Which setting to clear. */
|
|
12273
12273
|
export interface ChromeSettingClearDetails {
|
|
12274
12274
|
/** Where to clear the setting (default: regular). */
|
|
12275
|
-
scope?: ChromeSettingScope;
|
|
12275
|
+
scope?: ChromeSettingScope | undefined;
|
|
12276
12276
|
}
|
|
12277
12277
|
|
|
12278
12278
|
/** Details of the currently effective value. */
|
|
12279
12279
|
export interface ChromeSettingOnChangeDetails<T> {
|
|
12280
|
-
/**
|
|
12281
|
-
* Whether the effective value is specific to the incognito session. T
|
|
12282
|
-
* his property will only be present if the incognito property in the details parameter of get() was true.
|
|
12283
|
-
*/
|
|
12280
|
+
/** Whether the value that has changed is specific to the incognito session. This property will only be present if the user has enabled the extension in incognito mode. */
|
|
12284
12281
|
incognitoSpecific?: boolean;
|
|
12285
|
-
/** The value of the setting. */
|
|
12282
|
+
/** The value of the setting after the change. */
|
|
12286
12283
|
value: T;
|
|
12287
12284
|
/** The level of control of the setting. */
|
|
12288
12285
|
levelOfControl: LevelOfControl;
|
|
@@ -12295,27 +12292,30 @@ declare namespace chrome {
|
|
|
12295
12292
|
export interface ChromeSetting<T> {
|
|
12296
12293
|
/**
|
|
12297
12294
|
* Sets the value of a setting.
|
|
12295
|
+
*
|
|
12298
12296
|
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12299
12297
|
*/
|
|
12300
|
-
set(details: ChromeSettingSetDetails<T>, callback: () => void): void;
|
|
12301
12298
|
set(details: ChromeSettingSetDetails<T>): Promise<void>;
|
|
12299
|
+
set(details: ChromeSettingSetDetails<T>, callback: () => void): void;
|
|
12302
12300
|
|
|
12303
12301
|
/**
|
|
12304
12302
|
* Gets the value of a setting.
|
|
12303
|
+
*
|
|
12305
12304
|
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12306
12305
|
*/
|
|
12307
|
-
get(details: ChromeSettingGetDetails, callback: (details: ChromeSettingGetResult<T>) => void): void;
|
|
12308
12306
|
get(details: ChromeSettingGetDetails): Promise<ChromeSettingGetResult<T>>;
|
|
12307
|
+
get(details: ChromeSettingGetDetails, callback: (details: ChromeSettingGetResult<T>) => void): void;
|
|
12309
12308
|
|
|
12310
12309
|
/**
|
|
12311
12310
|
* Clears the setting, restoring any default value.
|
|
12311
|
+
*
|
|
12312
12312
|
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12313
12313
|
*/
|
|
12314
|
-
clear(details: ChromeSettingClearDetails, callback: () => void): void;
|
|
12315
12314
|
clear(details: ChromeSettingClearDetails): Promise<void>;
|
|
12315
|
+
clear(details: ChromeSettingClearDetails, callback: () => void): void;
|
|
12316
12316
|
|
|
12317
12317
|
/** Fired after the setting changes. */
|
|
12318
|
-
onChange:
|
|
12318
|
+
onChange: events.Event<(details: ChromeSettingOnChangeDetails<T>) => void>;
|
|
12319
12319
|
}
|
|
12320
12320
|
}
|
|
12321
12321
|
|
|
@@ -12330,85 +12330,134 @@ declare namespace chrome {
|
|
|
12330
12330
|
* @since Chrome 43
|
|
12331
12331
|
*/
|
|
12332
12332
|
export namespace vpnProvider {
|
|
12333
|
-
export interface
|
|
12333
|
+
export interface Parameters {
|
|
12334
12334
|
/** IP address for the VPN interface in CIDR notation. IPv4 is currently the only supported mode. */
|
|
12335
12335
|
address: string;
|
|
12336
|
-
/**
|
|
12336
|
+
/** Broadcast address for the VPN interface. (default: deduced from IP address and mask) */
|
|
12337
12337
|
broadcastAddress?: string | undefined;
|
|
12338
|
-
/**
|
|
12338
|
+
/** MTU setting for the VPN interface. (default: 1500 bytes) */
|
|
12339
12339
|
mtu?: string | undefined;
|
|
12340
|
-
/**
|
|
12341
|
-
* Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined.
|
|
12342
|
-
*/
|
|
12340
|
+
/** Exclude network traffic to the list of IP blocks in CIDR notation from the tunnel. This can be used to bypass traffic to and from the VPN server. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */
|
|
12343
12341
|
exclusionList: string[];
|
|
12344
|
-
/**
|
|
12345
|
-
* Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined.
|
|
12346
|
-
*/
|
|
12342
|
+
/** Include network traffic to the list of IP blocks in CIDR notation to the tunnel. This parameter can be used to set up a split tunnel. By default no traffic is directed to the tunnel. Adding the entry "0.0.0.0/0" to this list gets all the user traffic redirected to the tunnel. When many rules match a destination, the rule with the longest matching prefix wins. Entries that correspond to the same CIDR block are treated as duplicates. Such duplicates in the collated (exclusionList + inclusionList) list are eliminated and the exact duplicate entry that will be eliminated is undefined. */
|
|
12347
12343
|
inclusionList: string[];
|
|
12348
|
-
/**
|
|
12344
|
+
/** A list of search domains. (default: no search domain) */
|
|
12349
12345
|
domainSearch?: string[] | undefined;
|
|
12350
12346
|
/** A list of IPs for the DNS servers. */
|
|
12351
|
-
|
|
12347
|
+
dnsServers: string[];
|
|
12348
|
+
/**
|
|
12349
|
+
* Whether or not the VPN extension implements auto-reconnection.
|
|
12350
|
+
*
|
|
12351
|
+
* If true, the `linkDown`, `linkUp`, `linkChanged`, `suspend`, and `resume` platform messages will be used to signal the respective events. If false, the system will forcibly disconnect the VPN if the network topology changes, and the user will need to reconnect manually. (default: false)
|
|
12352
|
+
*
|
|
12353
|
+
* This property is new in Chrome 51; it will generate an exception in earlier versions. try/catch can be used to conditionally enable the feature based on browser support.
|
|
12354
|
+
* @since Chrome 51
|
|
12355
|
+
*/
|
|
12356
|
+
reconnect?: string | undefined;
|
|
12352
12357
|
}
|
|
12353
12358
|
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
{}
|
|
12359
|
+
/** @deprecated Use {@link Parameters} instead */
|
|
12360
|
+
interface VpnSessionParameters extends Parameters {}
|
|
12357
12361
|
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12362
|
+
/** The enum is used by the platform to notify the client of the VPN session status. */
|
|
12363
|
+
export enum PlatformMessage {
|
|
12364
|
+
/** Indicates that the VPN configuration connected. */
|
|
12365
|
+
CONNECTED = "connected",
|
|
12366
|
+
/** Indicates that the VPN configuration disconnected. */
|
|
12367
|
+
DISCONNECTED = "disconnected",
|
|
12368
|
+
/** Indicates that an error occurred in VPN connection, for example a timeout. A description of the error is given as the error argument to onPlatformMessage. */
|
|
12369
|
+
ERROR = "error",
|
|
12370
|
+
/** Indicates that the default physical network connection is down. */
|
|
12371
|
+
LINK_DOWN = "linkDown",
|
|
12372
|
+
/** Indicates that the default physical network connection is back up. */
|
|
12373
|
+
LINK_UP = "linkUp",
|
|
12374
|
+
/** Indicates that the default physical network connection changed, e.g. wifi->mobile. */
|
|
12375
|
+
LINK_CHANGED = "linkChanged",
|
|
12376
|
+
/** Indicates that the OS is preparing to suspend, so the VPN should drop its connection. The extension is not guaranteed to receive this event prior to suspending. */
|
|
12377
|
+
SUSPEND = "suspend",
|
|
12378
|
+
/** Indicates that the OS has resumed and the user has logged back in, so the VPN should try to reconnect. */
|
|
12379
|
+
RESUME = "resume",
|
|
12380
|
+
}
|
|
12361
12381
|
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12382
|
+
/** The enum is used by the platform to indicate the event that triggered {@link onUIEvent}. */
|
|
12383
|
+
export enum UIEvent {
|
|
12384
|
+
/** Requests that the VPN client show the add configuration dialog box to the user. */
|
|
12385
|
+
SHOW_ADD_DIALOG = "showAddDialog",
|
|
12386
|
+
/** Requests that the VPN client show the configuration settings dialog box to the user. */
|
|
12387
|
+
SHOW_CONFIGURE_DIALOG = "showConfigureDialog",
|
|
12388
|
+
}
|
|
12365
12389
|
|
|
12366
|
-
|
|
12390
|
+
/** The enum is used by the VPN client to inform the platform of its current state. This helps provide meaningful messages to the user. */
|
|
12391
|
+
export enum VpnConnectionState {
|
|
12392
|
+
/** Specifies that VPN connection was successful. */
|
|
12393
|
+
CONNECTED = "connected",
|
|
12394
|
+
/** Specifies that VPN connection has failed. */
|
|
12395
|
+
FAILURE = "failure",
|
|
12396
|
+
}
|
|
12367
12397
|
|
|
12368
12398
|
/**
|
|
12369
12399
|
* Creates a new VPN configuration that persists across multiple login sessions of the user.
|
|
12400
|
+
*
|
|
12401
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12370
12402
|
* @param name The name of the VPN configuration.
|
|
12371
|
-
* @param callback Called when the configuration is created or if there is an error.
|
|
12372
|
-
* Parameter id: A unique ID for the created configuration, empty string on failure.
|
|
12373
12403
|
*/
|
|
12404
|
+
export function createConfig(name: string): Promise<string>;
|
|
12374
12405
|
export function createConfig(name: string, callback: (id: string) => void): void;
|
|
12406
|
+
|
|
12375
12407
|
/**
|
|
12376
12408
|
* Destroys a VPN configuration created by the extension.
|
|
12409
|
+
*
|
|
12410
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12377
12411
|
* @param id ID of the VPN configuration to destroy.
|
|
12378
|
-
* @param callback Optional. Called when the configuration is destroyed or if there is an error.
|
|
12379
12412
|
*/
|
|
12380
|
-
export function destroyConfig(id: string
|
|
12413
|
+
export function destroyConfig(id: string): Promise<void>;
|
|
12414
|
+
export function destroyConfig(id: string, callback: () => void): void;
|
|
12415
|
+
|
|
12381
12416
|
/**
|
|
12382
|
-
* Sets the parameters for the VPN session. This should be called immediately after "connected" is received from the platform. This will succeed only when the VPN session is owned by the extension.
|
|
12417
|
+
* Sets the parameters for the VPN session. This should be called immediately after `"connected"` is received from the platform. This will succeed only when the VPN session is owned by the extension.
|
|
12418
|
+
*
|
|
12419
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12383
12420
|
* @param parameters The parameters for the VPN session.
|
|
12384
|
-
* @param callback Called when the parameters are set or if there is an error.
|
|
12385
12421
|
*/
|
|
12386
|
-
export function setParameters(parameters:
|
|
12422
|
+
export function setParameters(parameters: Parameters): Promise<void>;
|
|
12423
|
+
export function setParameters(parameters: Parameters, callback: () => void): void;
|
|
12424
|
+
|
|
12387
12425
|
/**
|
|
12388
12426
|
* Sends an IP packet through the tunnel created for the VPN session. This will succeed only when the VPN session is owned by the extension.
|
|
12427
|
+
*
|
|
12428
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12389
12429
|
* @param data The IP packet to be sent to the platform.
|
|
12390
|
-
* @param callback Optional. Called when the packet is sent or if there is an error.
|
|
12391
12430
|
*/
|
|
12392
|
-
export function sendPacket(data: ArrayBuffer
|
|
12431
|
+
export function sendPacket(data: ArrayBuffer): Promise<void>;
|
|
12432
|
+
export function sendPacket(data: ArrayBuffer, callback: () => void): void;
|
|
12433
|
+
|
|
12393
12434
|
/**
|
|
12394
12435
|
* Notifies the VPN session state to the platform. This will succeed only when the VPN session is owned by the extension.
|
|
12436
|
+
*
|
|
12437
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
|
|
12395
12438
|
* @param state The VPN session state of the VPN client.
|
|
12396
|
-
* connected: VPN connection was successful.
|
|
12397
|
-
* failure: VPN connection failed.
|
|
12398
|
-
* @param callback Optional. Called when the notification is complete or if there is an error.
|
|
12399
12439
|
*/
|
|
12400
|
-
export function notifyConnectionStateChanged(state:
|
|
12440
|
+
export function notifyConnectionStateChanged(state: `${VpnConnectionState}`): Promise<void>;
|
|
12441
|
+
export function notifyConnectionStateChanged(state: `${VpnConnectionState}`, callback: () => void): void;
|
|
12401
12442
|
|
|
12402
12443
|
/** Triggered when a message is received from the platform for a VPN configuration owned by the extension. */
|
|
12403
|
-
export
|
|
12444
|
+
export const onPlatformMessage: events.Event<
|
|
12445
|
+
(id: string, message: `${PlatformMessage}`, error: string) => void
|
|
12446
|
+
>;
|
|
12447
|
+
|
|
12404
12448
|
/** Triggered when an IP packet is received via the tunnel for the VPN session owned by the extension. */
|
|
12405
|
-
export
|
|
12449
|
+
export const onPacketReceived: events.Event<(data: ArrayBuffer) => void>;
|
|
12450
|
+
|
|
12406
12451
|
/** Triggered when a configuration created by the extension is removed by the platform. */
|
|
12407
|
-
export
|
|
12408
|
-
|
|
12409
|
-
|
|
12452
|
+
export const onConfigRemoved: events.Event<(id: string) => void>;
|
|
12453
|
+
|
|
12454
|
+
// /** Triggered when a configuration is created by the platform for the extension. */
|
|
12455
|
+
export const onConfigCreated: events.Event<
|
|
12456
|
+
(id: string, name: string, data: { [key: string]: unknown }) => void
|
|
12457
|
+
>;
|
|
12458
|
+
|
|
12410
12459
|
/** Triggered when there is a UI event for the extension. UI events are signals from the platform that indicate to the app that a UI dialog needs to be shown to the user. */
|
|
12411
|
-
export
|
|
12460
|
+
export const onUIEvent: events.Event<(event: `${UIEvent}`, id?: string) => void>;
|
|
12412
12461
|
}
|
|
12413
12462
|
|
|
12414
12463
|
////////////////////
|
|
@@ -12572,33 +12621,84 @@ declare namespace chrome {
|
|
|
12572
12621
|
* Permissions: "webNavigation"
|
|
12573
12622
|
*/
|
|
12574
12623
|
export namespace webNavigation {
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12579
|
-
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12624
|
+
/** @since Chrome 44 */
|
|
12625
|
+
export enum TransitionQualifier {
|
|
12626
|
+
CLIENT_REDIRECT = "client_redirect",
|
|
12627
|
+
SERVER_REDIRECT = "server_redirect",
|
|
12628
|
+
FORWARD_BACK = "forward_back",
|
|
12629
|
+
FROM_ADDRESS_BAR = "from_address_bar",
|
|
12630
|
+
}
|
|
12631
|
+
|
|
12632
|
+
/**
|
|
12633
|
+
* Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the history API except with `"start_page"` in place of `"auto_toplevel"` (for backwards compatibility).
|
|
12634
|
+
* @since Chrome 44
|
|
12635
|
+
*/
|
|
12636
|
+
export enum TransitionType {
|
|
12637
|
+
LINK = "link",
|
|
12638
|
+
TYPED = "typed",
|
|
12639
|
+
AUTO_BOOKMARK = "auto_bookmark",
|
|
12640
|
+
AUTO_SUBFRAME = "auto_subframe",
|
|
12641
|
+
MANUAL_SUBFRAME = "manual_subframe",
|
|
12642
|
+
GENERATED = "generated",
|
|
12643
|
+
START_PAGE = "start_page",
|
|
12644
|
+
FORM_SUBMIT = "form_submit",
|
|
12645
|
+
RELOAD = "reload",
|
|
12646
|
+
KEYWORD = "keyword",
|
|
12647
|
+
KEYWORD_GENERATED = "keyword_generated",
|
|
12586
12648
|
}
|
|
12587
12649
|
|
|
12650
|
+
export type GetFrameDetails =
|
|
12651
|
+
& ({
|
|
12652
|
+
/**
|
|
12653
|
+
* The ID of the process that runs the renderer for this tab.
|
|
12654
|
+
* @deprecated since Chrome 49. Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored.
|
|
12655
|
+
*/
|
|
12656
|
+
processId?: number | undefined;
|
|
12657
|
+
})
|
|
12658
|
+
& (
|
|
12659
|
+
{
|
|
12660
|
+
/** The ID of the tab in which the frame is. */
|
|
12661
|
+
tabId?: number | undefined;
|
|
12662
|
+
/** The ID of the frame in the given tab. */
|
|
12663
|
+
frameId?: number | undefined;
|
|
12664
|
+
/**
|
|
12665
|
+
* The UUID of the document. If the frameId and/or tabId are provided they will be validated to match the document found by provided document ID.
|
|
12666
|
+
* @since Chrome 106
|
|
12667
|
+
*/
|
|
12668
|
+
documentId: string;
|
|
12669
|
+
} | {
|
|
12670
|
+
/** The ID of the tab in which the frame is. */
|
|
12671
|
+
tabId: number;
|
|
12672
|
+
/** The ID of the frame in the given tab. */
|
|
12673
|
+
frameId: number;
|
|
12674
|
+
/**
|
|
12675
|
+
* The UUID of the document. If the frameId and/or tabId are provided they will be validated to match the document found by provided document ID.
|
|
12676
|
+
* @since Chrome 106
|
|
12677
|
+
*/
|
|
12678
|
+
documentId?: string | undefined;
|
|
12679
|
+
}
|
|
12680
|
+
);
|
|
12681
|
+
|
|
12588
12682
|
export interface GetFrameResultDetails {
|
|
12589
12683
|
/** The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists. */
|
|
12590
12684
|
url: string;
|
|
12591
12685
|
/** A UUID of the document loaded. */
|
|
12592
12686
|
documentId: string;
|
|
12593
|
-
/**
|
|
12687
|
+
/**
|
|
12688
|
+
* The lifecycle the document is in.
|
|
12689
|
+
* @since Chrome 106
|
|
12690
|
+
*/
|
|
12594
12691
|
documentLifecycle: extensionTypes.DocumentLifecycle;
|
|
12595
12692
|
/** True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired. */
|
|
12596
12693
|
errorOccurred: boolean;
|
|
12597
12694
|
/** The type of frame the navigation occurred in. */
|
|
12598
12695
|
frameType: extensionTypes.FrameType;
|
|
12599
|
-
/**
|
|
12696
|
+
/**
|
|
12697
|
+
* A UUID of the parent document owning this frame. This is not set if there is no parent.
|
|
12698
|
+
* @since Chrome 106
|
|
12699
|
+
*/
|
|
12600
12700
|
parentDocumentId?: string | undefined;
|
|
12601
|
-
/** ID of
|
|
12701
|
+
/** The ID of the parent frame, or `-1` if this is the main frame. */
|
|
12602
12702
|
parentFrameId: number;
|
|
12603
12703
|
}
|
|
12604
12704
|
|
|
@@ -12607,83 +12707,86 @@ declare namespace chrome {
|
|
|
12607
12707
|
tabId: number;
|
|
12608
12708
|
}
|
|
12609
12709
|
|
|
12710
|
+
/** A list of frames in the given tab, null if the specified tab ID is invalid. */
|
|
12610
12711
|
export interface GetAllFrameResultDetails extends GetFrameResultDetails {
|
|
12611
|
-
/** The ID of the process runs the renderer for this
|
|
12712
|
+
/** The ID of the process that runs the renderer for this frame. */
|
|
12612
12713
|
processId: number;
|
|
12613
12714
|
/** The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe. */
|
|
12614
12715
|
frameId: number;
|
|
12615
12716
|
}
|
|
12616
12717
|
|
|
12617
|
-
export interface
|
|
12618
|
-
/** The ID of the tab in which the navigation is about to occur. */
|
|
12619
|
-
tabId: number;
|
|
12620
|
-
/** The time when the browser was about to start the navigation, in milliseconds since the epoch. */
|
|
12621
|
-
timeStamp: number;
|
|
12622
|
-
}
|
|
12623
|
-
|
|
12624
|
-
export interface WebNavigationUrlCallbackDetails extends WebNavigationCallbackDetails {
|
|
12625
|
-
url: string;
|
|
12626
|
-
}
|
|
12627
|
-
|
|
12628
|
-
export interface WebNavigationReplacementCallbackDetails extends WebNavigationCallbackDetails {
|
|
12718
|
+
export interface WebNavigationReplacementCallbackDetails {
|
|
12629
12719
|
/** The ID of the tab that was replaced. */
|
|
12630
12720
|
replacedTabId: number;
|
|
12721
|
+
/** The ID of the tab that replaced the old tab. */
|
|
12722
|
+
tabId: number;
|
|
12723
|
+
/** The time when the replacement happened, in milliseconds since the epoch. */
|
|
12724
|
+
timeStamp: number;
|
|
12631
12725
|
}
|
|
12632
12726
|
|
|
12633
|
-
export interface
|
|
12634
|
-
/**
|
|
12727
|
+
export interface WebNavigationBaseCallbackDetails {
|
|
12728
|
+
/** The lifecycle the document is in. */
|
|
12729
|
+
documentLifecycle: extensionTypes.DocumentLifecycle;
|
|
12730
|
+
/** 0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab. */
|
|
12635
12731
|
frameId: number;
|
|
12636
12732
|
/** The type of frame the navigation occurred in. */
|
|
12637
12733
|
frameType: extensionTypes.FrameType;
|
|
12638
|
-
/** A UUID of the document loaded. (This is not set for onBeforeNavigate callbacks.) */
|
|
12639
|
-
documentId?: string | undefined;
|
|
12640
|
-
/** The lifecycle the document is in. */
|
|
12641
|
-
documentLifecycle: extensionTypes.DocumentLifecycle;
|
|
12642
12734
|
/** A UUID of the parent document owning this frame. This is not set if there is no parent. */
|
|
12643
|
-
parentDocumentId?: string
|
|
12735
|
+
parentDocumentId?: string;
|
|
12736
|
+
/** The ID of the parent frame, or `-1` if this is the main frame. */
|
|
12737
|
+
parentFrameId: number;
|
|
12738
|
+
/** The ID of the process that runs the renderer for this frame. */
|
|
12739
|
+
processId: number;
|
|
12740
|
+
/** The ID of the tab in which the navigation occurs. */
|
|
12741
|
+
tabId: number;
|
|
12742
|
+
/** The time when the browser was about to start the navigation, in milliseconds since the epoch */
|
|
12743
|
+
timeStamp: number;
|
|
12744
|
+
url: string;
|
|
12745
|
+
}
|
|
12746
|
+
|
|
12747
|
+
export interface WebNavigationFramedCallbackDetails extends WebNavigationBaseCallbackDetails {
|
|
12644
12748
|
/**
|
|
12645
|
-
*
|
|
12646
|
-
* @since Chrome
|
|
12749
|
+
* A UUID of the document loaded.
|
|
12750
|
+
* @since Chrome 106
|
|
12647
12751
|
*/
|
|
12648
|
-
|
|
12752
|
+
documentId: string;
|
|
12649
12753
|
}
|
|
12650
12754
|
|
|
12651
|
-
export interface WebNavigationFramedErrorCallbackDetails extends
|
|
12755
|
+
export interface WebNavigationFramedErrorCallbackDetails extends WebNavigationBaseCallbackDetails {
|
|
12756
|
+
/**
|
|
12757
|
+
* A UUID of the document loaded.
|
|
12758
|
+
* @since Chrome 106
|
|
12759
|
+
*/
|
|
12760
|
+
documentId: string;
|
|
12652
12761
|
/** The error description. */
|
|
12653
12762
|
error: string;
|
|
12654
12763
|
}
|
|
12655
12764
|
|
|
12656
|
-
export interface WebNavigationSourceCallbackDetails
|
|
12657
|
-
/** The ID of the tab in which the navigation is triggered. */
|
|
12658
|
-
sourceTabId: number;
|
|
12659
|
-
/**
|
|
12660
|
-
* The ID of the process runs the renderer for the source tab.
|
|
12661
|
-
* @since Chrome 22
|
|
12662
|
-
*/
|
|
12663
|
-
sourceProcessId: number;
|
|
12765
|
+
export interface WebNavigationSourceCallbackDetails {
|
|
12664
12766
|
/** The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame. */
|
|
12665
12767
|
sourceFrameId: number;
|
|
12768
|
+
/** The ID of the process that runs the renderer for the source frame. */
|
|
12769
|
+
sourceProcessId: number;
|
|
12770
|
+
/** The ID of the tab in which the navigation is triggered. */
|
|
12771
|
+
sourceTabId: number;
|
|
12772
|
+
/** The ID of the tab in which the url is opened */
|
|
12773
|
+
tabId: number;
|
|
12774
|
+
/** The time when the browser was about to create a new view, in milliseconds since the epoch. */
|
|
12775
|
+
timeStamp: number;
|
|
12776
|
+
/** The URL to be opened in the new window. */
|
|
12777
|
+
url: string;
|
|
12666
12778
|
}
|
|
12667
12779
|
|
|
12668
|
-
export interface
|
|
12669
|
-
/**
|
|
12670
|
-
* ID of frame that wraps the frame. Set to -1 of no parent frame exists.
|
|
12671
|
-
* @since Chrome 24
|
|
12672
|
-
*/
|
|
12673
|
-
parentFrameId: number;
|
|
12674
|
-
}
|
|
12675
|
-
|
|
12676
|
-
export interface WebNavigationTransitionCallbackDetails extends WebNavigationFramedCallbackDetails {
|
|
12780
|
+
export interface WebNavigationTransitionCallbackDetails extends WebNavigationBaseCallbackDetails {
|
|
12677
12781
|
/**
|
|
12678
|
-
*
|
|
12679
|
-
*
|
|
12680
|
-
*/
|
|
12681
|
-
transitionType: string;
|
|
12682
|
-
/**
|
|
12683
|
-
* A list of transition qualifiers.
|
|
12684
|
-
* Each element one of: "client_redirect", "server_redirect", "forward_back", or "from_address_bar"
|
|
12782
|
+
* A UUID of the document loaded.
|
|
12783
|
+
* @since Chrome 106
|
|
12685
12784
|
*/
|
|
12686
|
-
|
|
12785
|
+
documentId: string;
|
|
12786
|
+
/** Cause of the navigation. */
|
|
12787
|
+
transitionType: `${TransitionType}`;
|
|
12788
|
+
/** A list of transition qualifiers.*/
|
|
12789
|
+
transitionQualifiers: `${TransitionQualifier}`[];
|
|
12687
12790
|
}
|
|
12688
12791
|
|
|
12689
12792
|
export interface WebNavigationEventFilter {
|
|
@@ -12691,89 +12794,72 @@ declare namespace chrome {
|
|
|
12691
12794
|
url: chrome.events.UrlFilter[];
|
|
12692
12795
|
}
|
|
12693
12796
|
|
|
12694
|
-
|
|
12695
|
-
extends chrome.events.Event<
|
|
12797
|
+
interface WebNavigationEvent<T extends (...args: any) => void>
|
|
12798
|
+
extends Omit<chrome.events.Event<T>, "addListener">
|
|
12696
12799
|
{
|
|
12697
|
-
addListener(callback:
|
|
12800
|
+
addListener(callback: T, filters?: WebNavigationEventFilter): void;
|
|
12698
12801
|
}
|
|
12699
12802
|
|
|
12700
|
-
export interface WebNavigationFramedEvent extends WebNavigationEvent<WebNavigationFramedCallbackDetails> {}
|
|
12701
|
-
|
|
12702
|
-
export interface WebNavigationFramedErrorEvent
|
|
12703
|
-
extends WebNavigationEvent<WebNavigationFramedErrorCallbackDetails>
|
|
12704
|
-
{}
|
|
12705
|
-
|
|
12706
|
-
export interface WebNavigationSourceEvent extends WebNavigationEvent<WebNavigationSourceCallbackDetails> {}
|
|
12707
|
-
|
|
12708
|
-
export interface WebNavigationParentedEvent extends WebNavigationEvent<WebNavigationParentedCallbackDetails> {}
|
|
12709
|
-
|
|
12710
|
-
export interface WebNavigationTransitionalEvent
|
|
12711
|
-
extends WebNavigationEvent<WebNavigationTransitionCallbackDetails>
|
|
12712
|
-
{}
|
|
12713
|
-
|
|
12714
|
-
export interface WebNavigationReplacementEvent
|
|
12715
|
-
extends WebNavigationEvent<WebNavigationReplacementCallbackDetails>
|
|
12716
|
-
{}
|
|
12717
|
-
|
|
12718
12803
|
/**
|
|
12719
12804
|
* Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
|
|
12805
|
+
*
|
|
12806
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 93.
|
|
12720
12807
|
* @param details Information about the frame to retrieve information about.
|
|
12721
|
-
* @param callback
|
|
12722
|
-
* Optional parameter details: Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.
|
|
12723
12808
|
*/
|
|
12809
|
+
export function getFrame(
|
|
12810
|
+
details: GetFrameDetails,
|
|
12811
|
+
): Promise<GetFrameResultDetails | null>;
|
|
12724
12812
|
export function getFrame(
|
|
12725
12813
|
details: GetFrameDetails,
|
|
12726
12814
|
callback: (details: GetFrameResultDetails | null) => void,
|
|
12727
12815
|
): void;
|
|
12728
|
-
/**
|
|
12729
|
-
* Retrieves information about the given frame. A frame refers to an <iframe> or a <frame> of a web page and is identified by a tab ID and a frame ID.
|
|
12730
|
-
* @param details Information about the frame to retrieve information about.
|
|
12731
|
-
* @return The getFrame method provides its result via callback or returned as a Promise (MV3 only).
|
|
12732
|
-
*/
|
|
12733
|
-
export function getFrame(details: GetFrameDetails): Promise<GetFrameResultDetails | null>;
|
|
12734
12816
|
|
|
12735
12817
|
/**
|
|
12736
12818
|
* Retrieves information about all frames of a given tab.
|
|
12819
|
+
*
|
|
12820
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 93.
|
|
12737
12821
|
* @param details Information about the tab to retrieve all frames from.
|
|
12738
|
-
* @param callback
|
|
12739
|
-
* Optional parameter details: A list of frames in the given tab, null if the specified tab ID is invalid.
|
|
12740
12822
|
*/
|
|
12741
12823
|
export function getAllFrames(
|
|
12742
12824
|
details: GetAllFrameDetails,
|
|
12743
|
-
|
|
12744
|
-
): void;
|
|
12745
|
-
/**
|
|
12746
|
-
* Retrieves information about all frames of a given tab.
|
|
12747
|
-
* @param details Information about the tab to retrieve all frames from.
|
|
12748
|
-
* @return The getAllFrames method provides its result via callback or returned as a Promise (MV3 only).
|
|
12749
|
-
*/
|
|
12825
|
+
): Promise<GetAllFrameResultDetails[] | null>;
|
|
12750
12826
|
export function getAllFrames(
|
|
12751
12827
|
details: GetAllFrameDetails,
|
|
12752
|
-
|
|
12828
|
+
callback: (details: GetAllFrameResultDetails[] | null) => void,
|
|
12829
|
+
): void;
|
|
12830
|
+
|
|
12753
12831
|
/** Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL. */
|
|
12754
|
-
export
|
|
12832
|
+
export const onReferenceFragmentUpdated: WebNavigationEvent<
|
|
12833
|
+
(details: WebNavigationTransitionCallbackDetails) => void
|
|
12834
|
+
>;
|
|
12835
|
+
|
|
12755
12836
|
/** Fired when a document, including the resources it refers to, is completely loaded and initialized. */
|
|
12756
|
-
export
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12837
|
+
export const onCompleted: WebNavigationEvent<(details: WebNavigationFramedCallbackDetails) => void>;
|
|
12838
|
+
|
|
12839
|
+
// /** Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL. */
|
|
12840
|
+
export const onHistoryStateUpdated: WebNavigationEvent<
|
|
12841
|
+
(details: WebNavigationTransitionCallbackDetails) => void
|
|
12842
|
+
>;
|
|
12843
|
+
|
|
12762
12844
|
/** Fired when a new window, or a new tab in an existing window, is created to host a navigation. */
|
|
12763
|
-
export
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
export
|
|
12845
|
+
export const onCreatedNavigationTarget: WebNavigationEvent<
|
|
12846
|
+
(details: WebNavigationSourceCallbackDetails) => void
|
|
12847
|
+
>;
|
|
12848
|
+
|
|
12849
|
+
/** Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab*/
|
|
12850
|
+
export const onTabReplaced: events.Event<(details: WebNavigationReplacementCallbackDetails) => void>;
|
|
12851
|
+
|
|
12769
12852
|
/** Fired when a navigation is about to occur. */
|
|
12770
|
-
export
|
|
12853
|
+
export const onBeforeNavigate: WebNavigationEvent<(details: WebNavigationBaseCallbackDetails) => void>;
|
|
12854
|
+
|
|
12771
12855
|
/** Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document. */
|
|
12772
|
-
export
|
|
12856
|
+
export const onCommitted: WebNavigationEvent<(details: WebNavigationTransitionCallbackDetails) => void>;
|
|
12857
|
+
|
|
12773
12858
|
/** Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading. */
|
|
12774
|
-
export
|
|
12859
|
+
export const onDOMContentLoaded: WebNavigationEvent<(details: WebNavigationFramedCallbackDetails) => void>;
|
|
12860
|
+
|
|
12775
12861
|
/** Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation. */
|
|
12776
|
-
export
|
|
12862
|
+
export const onErrorOccurred: WebNavigationEvent<(details: WebNavigationFramedErrorCallbackDetails) => void>;
|
|
12777
12863
|
}
|
|
12778
12864
|
|
|
12779
12865
|
////////////////////
|
chrome/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/chrome",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "TypeScript definitions for chrome",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
|
6
6
|
"license": "MIT",
|
|
@@ -94,6 +94,6 @@
|
|
|
94
94
|
"@types/har-format": "*"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {},
|
|
97
|
-
"typesPublisherContentHash": "
|
|
97
|
+
"typesPublisherContentHash": "d216a6c8c00a765cff5c13cda2f955a491576cb4cf67da012fc054017600a879",
|
|
98
98
|
"typeScriptVersion": "5.2"
|
|
99
99
|
}
|