@wxt-dev/browser 0.0.324 → 0.0.325
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/package.json +2 -2
- package/src/gen/index.d.ts +366 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wxt-dev/browser",
|
|
3
3
|
"description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.325",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.mjs",
|
|
7
7
|
"types": "src/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"src"
|
|
20
20
|
],
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/chrome": "0.0.
|
|
22
|
+
"@types/chrome": "0.0.325",
|
|
23
23
|
"fs-extra": "^11.3.0",
|
|
24
24
|
"nano-spawn": "^0.2.0",
|
|
25
25
|
"tsx": "4.19.4",
|
package/src/gen/index.d.ts
CHANGED
|
@@ -1385,6 +1385,246 @@ export namespace Browser {
|
|
|
1385
1385
|
export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
|
|
1386
1386
|
}
|
|
1387
1387
|
|
|
1388
|
+
////////////////////
|
|
1389
|
+
// Certificate Provider
|
|
1390
|
+
////////////////////
|
|
1391
|
+
/**
|
|
1392
|
+
* Use this API to expose certificates to the platform which can use these certificates for TLS authentications.
|
|
1393
|
+
*
|
|
1394
|
+
* Manifest: "certificateProvider"
|
|
1395
|
+
* @platform ChromeOS only
|
|
1396
|
+
* @since Chrome 46
|
|
1397
|
+
*/
|
|
1398
|
+
export namespace certificateProvider {
|
|
1399
|
+
/** Types of supported cryptographic signature algorithms. */
|
|
1400
|
+
export enum Algorithm {
|
|
1401
|
+
/**
|
|
1402
|
+
* Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the MD5-SHA-1 hashing. The extension must not prepend a DigestInfo prefix but only add PKCS#1 padding.
|
|
1403
|
+
* @deprecated This algorithm is deprecated and will never be requested by Chrome as of version 109.
|
|
1404
|
+
*/
|
|
1405
|
+
RSASSA_PKCS1_V1_5_MD5_SHA1 = "RSASSA_PKCS1_v1_5_MD5_SHA1",
|
|
1406
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-1 hash function. */
|
|
1407
|
+
RSASSA_PKCS1_V1_5_SHA1 = "RSASSA_PKCS1_v1_5_SHA1",
|
|
1408
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-256 hashing function. */
|
|
1409
|
+
RSASSA_PKCS1_V1_5_SHA256 = "RSASSA_PKCS1_v1_5_SHA256",
|
|
1410
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-384 hashing function. */
|
|
1411
|
+
RSASSA_PKCS1_V1_5_SHA384 = "RSASSA_PKCS1_v1_5_SHA384",
|
|
1412
|
+
/** Specifies the RSASSA PKCS#1 v1.5 signature algorithm with the SHA-512 hashing function. */
|
|
1413
|
+
RSASSA_PKCS1_V1_5_SHA512 = "RSASSA_PKCS1_v1_5_SHA512",
|
|
1414
|
+
/** Specifies the RSASSA PSS signature algorithm with the SHA-256 hashing function, MGF1 mask generation function and the salt of the same size as the hash. */
|
|
1415
|
+
RSASSA_PSS_SHA256 = "RSASSA_PSS_SHA256",
|
|
1416
|
+
/** Specifies the RSASSA PSS signature algorithm with the SHA-384 hashing function, MGF1 mask generation function and the salt of the same size as the hash. */
|
|
1417
|
+
RSASSA_PSS_SHA384 = "RSASSA_PSS_SHA384",
|
|
1418
|
+
/** Specifies the RSASSA PSS signature algorithm with the SHA-512 hashing function, MGF1 mask generation function and the salt of the same size as the hash. */
|
|
1419
|
+
RSASSA_PSS_SHA512 = "RSASSA_PSS_SHA512",
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
export interface CertificateInfo {
|
|
1423
|
+
/** Must be the DER encoding of a X.509 certificate. Currently, only certificates of RSA keys are supported. */
|
|
1424
|
+
certificate: ArrayBuffer;
|
|
1425
|
+
/** Must be set to all hashes supported for this certificate. This extension will only be asked for signatures of digests calculated with one of these hash algorithms. This should be in order of decreasing hash preference. */
|
|
1426
|
+
supportedHashes: `${Hash}`[];
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/** @since Chrome 86 */
|
|
1430
|
+
export interface CertificatesUpdateRequest {
|
|
1431
|
+
/** Request identifier to be passed to {@link setCertificates}. */
|
|
1432
|
+
certificatesRequestId: number;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/** @since Chrome 86 */
|
|
1436
|
+
export interface ClientCertificateInfo {
|
|
1437
|
+
/**
|
|
1438
|
+
* The array must contain the DER encoding of the X.509 client certificate as its first element.
|
|
1439
|
+
*
|
|
1440
|
+
* This must include exactly one certificate.
|
|
1441
|
+
*/
|
|
1442
|
+
certificateChain: ArrayBuffer[];
|
|
1443
|
+
/** All algorithms supported for this certificate. The extension will only be asked for signatures using one of these algorithms. */
|
|
1444
|
+
supportedAlgorithms: `${Algorithm}`[];
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
/**
|
|
1448
|
+
* Types of errors that the extension can report.
|
|
1449
|
+
* @since Chrome 86
|
|
1450
|
+
*/
|
|
1451
|
+
export enum Error {
|
|
1452
|
+
GENERAL_ERROR = "GENERAL_ERROR",
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/** @deprecated Replaced by {@link Algorithm}.*/
|
|
1456
|
+
export enum Hash {
|
|
1457
|
+
/** Specifies the MD5 and SHA1 hashing algorithms. */
|
|
1458
|
+
MD5_SHA1 = "MD5_SHA1",
|
|
1459
|
+
/** Specifies the SHA1 hashing algorithm. */
|
|
1460
|
+
SHA1 = "SHA1",
|
|
1461
|
+
/** Specifies the SHA256 hashing algorithm. */
|
|
1462
|
+
SHA256 = "SHA256",
|
|
1463
|
+
/** Specifies the SHA384 hashing algorithm. */
|
|
1464
|
+
SHA384 = "SHA384",
|
|
1465
|
+
/** Specifies the SHA512 hashing algorithm. */
|
|
1466
|
+
SHA512 = "SHA512",
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* The types of errors that can be presented to the user through the requestPin function.
|
|
1471
|
+
* @since Chrome 57
|
|
1472
|
+
*/
|
|
1473
|
+
export enum PinRequestErrorType {
|
|
1474
|
+
/** Specifies the PIN is invalid. */
|
|
1475
|
+
INVALID_PIN = "INVALID_PIN",
|
|
1476
|
+
/** Specifies the PUK is invalid. */
|
|
1477
|
+
INVALID_PUK = "INVALID_PUK",
|
|
1478
|
+
/** Specifies the maximum attempt number has been exceeded. */
|
|
1479
|
+
MAX_ATTEMPTS_EXCEEDED = "MAX_ATTEMPTS_EXCEEDED",
|
|
1480
|
+
/** Specifies that the error cannot be represented by the above types. */
|
|
1481
|
+
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
/**
|
|
1485
|
+
* The type of code being requested by the extension with requestPin function.
|
|
1486
|
+
* @since Chrome 57
|
|
1487
|
+
*/
|
|
1488
|
+
export enum PinRequestType {
|
|
1489
|
+
/** Specifies the requested code is a PIN. */
|
|
1490
|
+
PIN = "PIN",
|
|
1491
|
+
/** Specifies the requested code is a PUK. */
|
|
1492
|
+
PUK = "PUK",
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/** @since Chrome 57 */
|
|
1496
|
+
export interface PinResponseDetails {
|
|
1497
|
+
/** The code provided by the user. Empty if user closed the dialog or some other error occurred. */
|
|
1498
|
+
userInput?: string | undefined;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
/** @since Chrome 86 */
|
|
1502
|
+
export interface ReportSignatureDetails {
|
|
1503
|
+
/** Error that occurred while generating the signature, if any. */
|
|
1504
|
+
error?: `${Error}` | undefined;
|
|
1505
|
+
/** Request identifier that was received via the {@link onSignatureRequested} event. */
|
|
1506
|
+
signRequestId: number;
|
|
1507
|
+
/** The signature, if successfully generated. */
|
|
1508
|
+
signature?: ArrayBuffer | undefined;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
/** @since Chrome 57 */
|
|
1512
|
+
export interface RequestPinDetails {
|
|
1513
|
+
/** The number of attempts left. This is provided so that any UI can present this information to the user. Chrome is not expected to enforce this, instead stopPinRequest should be called by the extension with errorType = MAX_ATTEMPTS_EXCEEDED when the number of pin requests is exceeded. */
|
|
1514
|
+
attemptsLeft?: number | undefined;
|
|
1515
|
+
/** The error template displayed to the user. This should be set if the previous request failed, to notify the user of the failure reason. */
|
|
1516
|
+
errorType?: `${PinRequestErrorType}` | undefined;
|
|
1517
|
+
/** The type of code requested. Default is PIN. */
|
|
1518
|
+
requestType?: `${PinRequestType}` | undefined;
|
|
1519
|
+
/** The ID given by Chrome in SignRequest. */
|
|
1520
|
+
signRequestId: number;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
/** @since Chrome 86 */
|
|
1524
|
+
export interface SetCertificatesDetails {
|
|
1525
|
+
/** When called in response to {@link onCertificatesUpdateRequested}, should contain the received `certificatesRequestId` value. Otherwise, should be unset. */
|
|
1526
|
+
certificatesRequestId?: number | undefined;
|
|
1527
|
+
/** List of currently available client certificates. */
|
|
1528
|
+
clientCertificates: ClientCertificateInfo[];
|
|
1529
|
+
/** Error that occurred while extracting the certificates, if any. This error will be surfaced to the user when appropriate. */
|
|
1530
|
+
error?: `${Error}` | undefined;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
/** @since Chrome 86 */
|
|
1534
|
+
export interface SignatureRequest {
|
|
1535
|
+
/** Signature algorithm to be used. */
|
|
1536
|
+
algorithm: `${Algorithm}`;
|
|
1537
|
+
/** The DER encoding of a X.509 certificate. The extension must sign `input` using the associated private key. */
|
|
1538
|
+
certificate: ArrayBuffer;
|
|
1539
|
+
/** Data to be signed. Note that the data is not hashed. */
|
|
1540
|
+
input: ArrayBuffer;
|
|
1541
|
+
/** Request identifier to be passed to {@link reportSignature}. */
|
|
1542
|
+
signRequestId: number;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
export interface SignRequest {
|
|
1546
|
+
/** The DER encoding of a X.509 certificate. The extension must sign `digest` using the associated private key. */
|
|
1547
|
+
certificate: ArrayBuffer;
|
|
1548
|
+
/** The digest that must be signed. */
|
|
1549
|
+
digest: ArrayBuffer;
|
|
1550
|
+
/** Refers to the hash algorithm that was used to create `digest`. */
|
|
1551
|
+
hash: `${Hash}`;
|
|
1552
|
+
/**
|
|
1553
|
+
* The unique ID to be used by the extension should it need to call a method that requires it, e.g. requestPin.
|
|
1554
|
+
* @since Chrome 57
|
|
1555
|
+
*/
|
|
1556
|
+
signRequestId: number;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
/** @since Chrome 57 */
|
|
1560
|
+
export interface StopPinRequestDetails {
|
|
1561
|
+
/** The error template. If present it is displayed to user. Intended to contain the reason for stopping the flow if it was caused by an error, e.g. MAX\_ATTEMPTS\_EXCEEDED. */
|
|
1562
|
+
errorType?: `${PinRequestErrorType}` | undefined;
|
|
1563
|
+
/** The ID given by Chrome in SignRequest. */
|
|
1564
|
+
signRequestId: number;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
/**
|
|
1568
|
+
* Should be called as a response to {@link onSignatureRequested}.
|
|
1569
|
+
*
|
|
1570
|
+
* The extension must eventually call this function for every {@link onSignatureRequested} event; the API implementation will stop waiting for this call after some time and respond with a timeout error when this function is called.
|
|
1571
|
+
*
|
|
1572
|
+
* Can return its result via Promise since Chrome 96.
|
|
1573
|
+
* @since Chrome 86
|
|
1574
|
+
*/
|
|
1575
|
+
export function reportSignature(details: ReportSignatureDetails): Promise<void>;
|
|
1576
|
+
export function reportSignature(details: ReportSignatureDetails, callback: () => void): void;
|
|
1577
|
+
|
|
1578
|
+
/**
|
|
1579
|
+
* Requests the PIN from the user. Only one ongoing request at a time is allowed. The requests issued while another flow is ongoing are rejected. It's the extension's responsibility to try again later if another flow is in progress.
|
|
1580
|
+
*
|
|
1581
|
+
* Can return its result via Promise since Chrome 96.
|
|
1582
|
+
* @param details Contains the details about the requested dialog.
|
|
1583
|
+
* @since Chrome 57
|
|
1584
|
+
*/
|
|
1585
|
+
export function requestPin(details: RequestPinDetails): Promise<PinResponseDetails | undefined>;
|
|
1586
|
+
export function requestPin(
|
|
1587
|
+
details: RequestPinDetails,
|
|
1588
|
+
callback: (details?: PinResponseDetails | undefined) => void,
|
|
1589
|
+
): void;
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Sets a list of certificates to use in the browser.
|
|
1593
|
+
*
|
|
1594
|
+
* The extension should call this function after initialization and on every change in the set of currently available certificates. The extension should also call this function in response to {@link onCertificatesUpdateRequested} every time this event is received.
|
|
1595
|
+
*
|
|
1596
|
+
* Can return its result via Promise since Chrome 96.
|
|
1597
|
+
* @param details The certificates to set. Invalid certificates will be ignored.
|
|
1598
|
+
* @since Chrome 86
|
|
1599
|
+
*/
|
|
1600
|
+
export function setCertificates(details: SetCertificatesDetails): Promise<void>;
|
|
1601
|
+
export function setCertificates(details: SetCertificatesDetails, callback: () => void): void;
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* Stops the pin request started by the {@link requestPin} function.
|
|
1605
|
+
*
|
|
1606
|
+
* Can return its result via Promise since Chrome 96.
|
|
1607
|
+
* @param details Contains the details about the reason for stopping the request flow.
|
|
1608
|
+
* @since Chrome 57
|
|
1609
|
+
*/
|
|
1610
|
+
export function stopPinRequest(details: StopPinRequestDetails): Promise<void>;
|
|
1611
|
+
export function stopPinRequest(details: StopPinRequestDetails, callback: () => void): void;
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* This event fires if the certificates set via {@link setCertificates} are insufficient or the browser requests updated information. The extension must call {@link setCertificates} with the updated list of certificates and the received `certificatesRequestId`.
|
|
1615
|
+
* @since Chrome 86
|
|
1616
|
+
*/
|
|
1617
|
+
export const onCertificatesUpdateRequested: events.Event<(request: CertificatesUpdateRequest) => void>;
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* This event fires every time the browser needs to sign a message using a certificate provided by this extension via {@link setCertificates}.
|
|
1621
|
+
*
|
|
1622
|
+
* The extension must sign the input data from `request` using the appropriate algorithm and private key and return it by calling {@link reportSignature} with the received `signRequestId`.
|
|
1623
|
+
* @since Chrome 86
|
|
1624
|
+
*/
|
|
1625
|
+
export const onSignatureRequested: events.Event<(request: SignatureRequest) => void>;
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1388
1628
|
////////////////////
|
|
1389
1629
|
// Commands
|
|
1390
1630
|
////////////////////
|
|
@@ -12882,6 +13122,123 @@ export namespace Browser {
|
|
|
12882
13122
|
export function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: ArrayBuffer) => void): void;
|
|
12883
13123
|
}
|
|
12884
13124
|
|
|
13125
|
+
////////////////////
|
|
13126
|
+
// Web Authentication Proxy
|
|
13127
|
+
////////////////////
|
|
13128
|
+
/**
|
|
13129
|
+
* The `Browser.webAuthenticationProxy` API lets remote desktop software running on a remote host intercept Web Authentication API (WebAuthn) requests in order to handle them on a local client.
|
|
13130
|
+
*
|
|
13131
|
+
* Permissions: "webAuthenticationProxy"
|
|
13132
|
+
* @since Chrome 115, MV3
|
|
13133
|
+
*/
|
|
13134
|
+
export namespace webAuthenticationProxy {
|
|
13135
|
+
export interface CreateRequest {
|
|
13136
|
+
/** The `PublicKeyCredentialCreationOptions` passed to `navigator.credentials.create()`, serialized as a JSON string. The serialization format is compatible with [`PublicKeyCredential.parseCreationOptionsFromJSON()`](https://w3c.github.io/webauthn/#sctn-parseCreationOptionsFromJSON). */
|
|
13137
|
+
requestDetailsJson: string;
|
|
13138
|
+
/** An opaque identifier for the request. */
|
|
13139
|
+
requestId: number;
|
|
13140
|
+
}
|
|
13141
|
+
|
|
13142
|
+
export interface CreateResponseDetails {
|
|
13143
|
+
/** The `DOMException` yielded by the remote request, if any. */
|
|
13144
|
+
error?: DOMExceptionDetails | undefined;
|
|
13145
|
+
/** The `requestId` of the `CreateRequest`. */
|
|
13146
|
+
requestId: number;
|
|
13147
|
+
/** The `PublicKeyCredential`, yielded by the remote request, if any, serialized as a JSON string by calling [`PublicKeyCredential.toJSON()`](https://w3c.github.io/webauthn/#dom-publickeycredential-tojson). */
|
|
13148
|
+
responseJson?: string | undefined;
|
|
13149
|
+
}
|
|
13150
|
+
|
|
13151
|
+
export interface DOMExceptionDetails {
|
|
13152
|
+
name: string;
|
|
13153
|
+
message: string;
|
|
13154
|
+
}
|
|
13155
|
+
|
|
13156
|
+
export interface GetRequest {
|
|
13157
|
+
/** The `PublicKeyCredentialRequestOptions` passed to `navigator.credentials.get()`, serialized as a JSON string. The serialization format is compatible with [`PublicKeyCredential.parseRequestOptionsFromJSON()`](https://w3c.github.io/webauthn/#sctn-parseRequestOptionsFromJSON). */
|
|
13158
|
+
requestDetailsJson: string;
|
|
13159
|
+
/** An opaque identifier for the request. */
|
|
13160
|
+
requestId: number;
|
|
13161
|
+
}
|
|
13162
|
+
|
|
13163
|
+
export interface GetResponseDetails {
|
|
13164
|
+
/** The `DOMException` yielded by the remote request, if any. */
|
|
13165
|
+
error?: DOMExceptionDetails | undefined;
|
|
13166
|
+
/** The `requestId` of the `CreateRequest`. */
|
|
13167
|
+
requestId: number;
|
|
13168
|
+
/** The `PublicKeyCredential`, yielded by the remote request, if any, serialized as a JSON string by calling [`PublicKeyCredential.toJSON()`](https://w3c.github.io/webauthn/#dom-publickeycredential-tojson). */
|
|
13169
|
+
responseJson?: string | undefined;
|
|
13170
|
+
}
|
|
13171
|
+
|
|
13172
|
+
export interface IsUvpaaRequest {
|
|
13173
|
+
/** An opaque identifier for the request. */
|
|
13174
|
+
requestId: number;
|
|
13175
|
+
}
|
|
13176
|
+
|
|
13177
|
+
export interface IsUvpaaResponseDetails {
|
|
13178
|
+
isUvpaa: boolean;
|
|
13179
|
+
requestId: number;
|
|
13180
|
+
}
|
|
13181
|
+
|
|
13182
|
+
/**
|
|
13183
|
+
* Makes this extension the active Web Authentication API request proxy.
|
|
13184
|
+
*
|
|
13185
|
+
* Remote desktop extensions typically call this method after detecting attachment of a remote session to this host. Once this method returns without error, regular processing of WebAuthn requests is suspended, and events from this extension API are raised.
|
|
13186
|
+
*
|
|
13187
|
+
* This method fails with an error if a different extension is already attached.
|
|
13188
|
+
*
|
|
13189
|
+
* The attached extension must call `detach()` once the remote desktop session has ended in order to resume regular WebAuthn request processing. Extensions automatically become detached if they are unloaded.
|
|
13190
|
+
*
|
|
13191
|
+
* Refer to the `onRemoteSessionStateChange` event for signaling a change of remote session attachment from a native application to to the (possibly suspended) extension.
|
|
13192
|
+
*/
|
|
13193
|
+
export function attach(): Promise<string | undefined>;
|
|
13194
|
+
export function attach(callback: (error?: string | undefined) => void): void;
|
|
13195
|
+
|
|
13196
|
+
/** Reports the result of a `navigator.credentials.create()` call. The extension must call this for every `onCreateRequest` event it has received, unless the request was canceled (in which case, an `onRequestCanceled` event is fired). */
|
|
13197
|
+
export function completeCreateRequest(details: CreateResponseDetails): Promise<void>;
|
|
13198
|
+
export function completeCreateRequest(details: CreateResponseDetails, callback: () => void): void;
|
|
13199
|
+
|
|
13200
|
+
/** Reports the result of a `navigator.credentials.get()` call. The extension must call this for every `onGetRequest` event it has received, unless the request was canceled (in which case, an `onRequestCanceled` event is fired). */
|
|
13201
|
+
export function completeGetRequest(details: GetResponseDetails): Promise<void>;
|
|
13202
|
+
export function completeGetRequest(details: GetResponseDetails, callback: () => void): void;
|
|
13203
|
+
|
|
13204
|
+
/** Reports the result of a `PublicKeyCredential.isUserVerifyingPlatformAuthenticator()` call. The extension must call this for every `onIsUvpaaRequest` event it has received. */
|
|
13205
|
+
export function completeIsUvpaaRequest(details: IsUvpaaResponseDetails): Promise<void>;
|
|
13206
|
+
export function completeIsUvpaaRequest(details: IsUvpaaResponseDetails, callback: () => void): void;
|
|
13207
|
+
|
|
13208
|
+
/**
|
|
13209
|
+
* Removes this extension from being the active Web Authentication API request proxy.
|
|
13210
|
+
*
|
|
13211
|
+
* This method is typically called when the extension detects that a remote desktop session was terminated. Once this method returns, the extension ceases to be the active Web Authentication API request proxy.
|
|
13212
|
+
*
|
|
13213
|
+
* Refer to the `onRemoteSessionStateChange` event for signaling a change of remote session attachment from a native application to to the (possibly suspended) extension.
|
|
13214
|
+
*/
|
|
13215
|
+
export function detach(): Promise<string | undefined>;
|
|
13216
|
+
export function detach(callback: (error?: string | undefined) => void): void;
|
|
13217
|
+
|
|
13218
|
+
/** Fires when a WebAuthn `navigator.credentials.create()` call occurs. The extension must supply a response by calling `completeCreateRequest()` with the `requestId` from `requestInfo`. */
|
|
13219
|
+
export const onCreateRequest: events.Event<(requestInfo: CreateRequest) => void>;
|
|
13220
|
+
|
|
13221
|
+
/** Fires when a WebAuthn `navigator.credentials.get()` call occurs. The extension must supply a response by calling `completeGetRequest()` with the `requestId` from `requestInfo` */
|
|
13222
|
+
export const onGetRequest: events.Event<(requestInfo: GetRequest) => void>;
|
|
13223
|
+
|
|
13224
|
+
/** Fires when a `PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable()` call occurs. The extension must supply a response by calling `completeIsUvpaaRequest()` with the `requestId` from `requestInfo` */
|
|
13225
|
+
export const onIsUvpaaRequest: events.Event<(requestInfo: IsUvpaaRequest) => void>;
|
|
13226
|
+
|
|
13227
|
+
/**
|
|
13228
|
+
* A native application associated with this extension can cause this event to be fired by writing to a file with a name equal to the extension's ID in a directory named `WebAuthenticationProxyRemoteSessionStateChange` inside the [default user data directory](https://chromium.googlesource.com/chromium/src/+/main/docs/user_data_dir.md#default-location)
|
|
13229
|
+
*
|
|
13230
|
+
* The contents of the file should be empty. I.e., it is not necessary to change the contents of the file in order to trigger this event.
|
|
13231
|
+
*
|
|
13232
|
+
* The native host application may use this event mechanism to signal a possible remote session state change (i.e. from detached to attached, or vice versa) while the extension service worker is possibly suspended. In the handler for this event, the extension can call the `attach()` or `detach()` API methods accordingly.
|
|
13233
|
+
*
|
|
13234
|
+
* The event listener must be registered synchronously at load time.
|
|
13235
|
+
*/
|
|
13236
|
+
export const onRemoteSessionStateChange: events.Event<() => void>;
|
|
13237
|
+
|
|
13238
|
+
/** Fires when a `onCreateRequest` or `onGetRequest` event is canceled (because the WebAuthn request was aborted by the caller, or because it timed out). When receiving this event, the extension should cancel processing of the corresponding request on the client side. Extensions cannot complete a request once it has been canceled. */
|
|
13239
|
+
export const onRequestCanceled: events.Event<(requestId: number) => void>;
|
|
13240
|
+
}
|
|
13241
|
+
|
|
12885
13242
|
////////////////////
|
|
12886
13243
|
// Web Navigation
|
|
12887
13244
|
////////////////////
|
|
@@ -13934,7 +14291,7 @@ export namespace Browser {
|
|
|
13934
14291
|
tabId: number;
|
|
13935
14292
|
|
|
13936
14293
|
/** The resource type of the request. */
|
|
13937
|
-
type: ResourceType
|
|
14294
|
+
type: `${ResourceType}`;
|
|
13938
14295
|
|
|
13939
14296
|
/** The URL of the request. */
|
|
13940
14297
|
url: string;
|
|
@@ -13976,7 +14333,7 @@ export namespace Browser {
|
|
|
13976
14333
|
responseHeaders?: ModifyHeaderInfo[] | undefined;
|
|
13977
14334
|
|
|
13978
14335
|
/** The type of action to perform. */
|
|
13979
|
-
type: RuleActionType
|
|
14336
|
+
type: `${RuleActionType}`;
|
|
13980
14337
|
}
|
|
13981
14338
|
|
|
13982
14339
|
export interface RuleCondition {
|
|
@@ -13984,7 +14341,7 @@ export namespace Browser {
|
|
|
13984
14341
|
* Specifies whether the network request is first-party or third-party to the domain from which it originated.
|
|
13985
14342
|
* If omitted, all requests are accepted.
|
|
13986
14343
|
*/
|
|
13987
|
-
domainType?: DomainType | undefined;
|
|
14344
|
+
domainType?: `${DomainType}` | undefined;
|
|
13988
14345
|
|
|
13989
14346
|
/**
|
|
13990
14347
|
* @deprecated since Chrome 101. Use initiatorDomains instead.
|
|
@@ -14071,7 +14428,7 @@ export namespace Browser {
|
|
|
14071
14428
|
* Only one of requestMethods and excludedRequestMethods should be specified.
|
|
14072
14429
|
* If neither of them is specified, all request methods are matched.
|
|
14073
14430
|
*/
|
|
14074
|
-
excludedRequestMethods?: RequestMethod[] | undefined;
|
|
14431
|
+
excludedRequestMethods?: `${RequestMethod}`[] | undefined;
|
|
14075
14432
|
|
|
14076
14433
|
/**
|
|
14077
14434
|
* List of resource types which the rule won't match.
|
|
@@ -14079,7 +14436,7 @@ export namespace Browser {
|
|
|
14079
14436
|
* and {@link Browser.declarativeNetRequest.RuleCondition.excludedResourceTypes} should be specified.
|
|
14080
14437
|
* If neither of them is specified, all resource types except "main_frame" are blocked.
|
|
14081
14438
|
*/
|
|
14082
|
-
excludedResourceTypes?: ResourceType[] | undefined;
|
|
14439
|
+
excludedResourceTypes?: `${ResourceType}`[] | undefined;
|
|
14083
14440
|
|
|
14084
14441
|
/**
|
|
14085
14442
|
* List of {@link Browser.tabs.Tab.id} which the rule should not match.
|
|
@@ -14110,7 +14467,7 @@ export namespace Browser {
|
|
|
14110
14467
|
* Note: Specifying a {@link Browser.declarativeNetRequest.RuleCondition.requestMethods} rule condition will also exclude non-HTTP(s) requests,
|
|
14111
14468
|
* whereas specifying {@link Browser.declarativeNetRequest.RuleCondition.excludedRequestMethods} will not.
|
|
14112
14469
|
*/
|
|
14113
|
-
requestMethods?: RequestMethod[];
|
|
14470
|
+
requestMethods?: `${RequestMethod}`[] | undefined;
|
|
14114
14471
|
|
|
14115
14472
|
/**
|
|
14116
14473
|
* List of {@link Browser.tabs.Tab.id} which the rule should not match.
|
|
@@ -14152,7 +14509,7 @@ export namespace Browser {
|
|
|
14152
14509
|
*
|
|
14153
14510
|
* Note: this must be specified for allowAllRequests rules and may only include the sub_frame and main_frame resource types.
|
|
14154
14511
|
*/
|
|
14155
|
-
resourceTypes?: ResourceType[] | undefined;
|
|
14512
|
+
resourceTypes?: `${ResourceType}`[] | undefined;
|
|
14156
14513
|
|
|
14157
14514
|
/**
|
|
14158
14515
|
* Rule does not match if the request matches any response header condition in this list (if specified). If both `excludedResponseHeaders` and `responseHeaders` are specified, then the `excludedResponseHeaders` property takes precedence.
|
|
@@ -14222,7 +14579,7 @@ export namespace Browser {
|
|
|
14222
14579
|
header: string;
|
|
14223
14580
|
|
|
14224
14581
|
/** The operation to be performed on a header. */
|
|
14225
|
-
operation: HeaderOperation
|
|
14582
|
+
operation: `${HeaderOperation}`;
|
|
14226
14583
|
|
|
14227
14584
|
/** The new value for the header.
|
|
14228
14585
|
* Must be specified for append and set operations.
|
|
@@ -14304,7 +14661,7 @@ export namespace Browser {
|
|
|
14304
14661
|
/** Specifies the reason why the regular expression is not supported.
|
|
14305
14662
|
* Only provided if isSupported is false.
|
|
14306
14663
|
*/
|
|
14307
|
-
reason?: UnsupportedRegexReason | undefined;
|
|
14664
|
+
reason?: `${UnsupportedRegexReason}` | undefined;
|
|
14308
14665
|
}
|
|
14309
14666
|
|
|
14310
14667
|
export interface TabActionCountUpdate {
|