@wxt-dev/browser 0.1.39 → 0.1.40
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 +110 -74
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.1.
|
|
4
|
+
"version": "0.1.40",
|
|
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.1.
|
|
22
|
+
"@types/chrome": "0.1.40",
|
|
23
23
|
"@types/node": "^20.0.0",
|
|
24
24
|
"nano-spawn": "^2.0.0",
|
|
25
25
|
"typescript": "^5.9.3",
|
package/src/gen/index.d.ts
CHANGED
|
@@ -9266,36 +9266,37 @@ export namespace Browser {
|
|
|
9266
9266
|
|
|
9267
9267
|
export interface ManifestBase {
|
|
9268
9268
|
// Required
|
|
9269
|
+
/** An integer specifying the version of the manifest file format that your extension uses. */
|
|
9269
9270
|
manifest_version: number;
|
|
9271
|
+
/** A string that identifies the extension in the Chrome Web Store, the install dialog, and the user's Chrome Extensions page (`chrome://extensions`). The maximum length is 75 characters. */
|
|
9270
9272
|
name: string;
|
|
9273
|
+
/** A string that identifies the extension's version number. */
|
|
9271
9274
|
version: string;
|
|
9272
9275
|
|
|
9273
9276
|
// Recommended
|
|
9277
|
+
/** A string that defines the default language of an extension that supports multiple locales. Examples include "en" and "pt_BR". This key is required in localized extensions, and must not be used in extensions that aren't localized. */
|
|
9274
9278
|
default_locale?: string | undefined;
|
|
9279
|
+
/** A string that describes the extension on both the Chrome Web Store and the user's extension management page. The maximum length is 132 characters. */
|
|
9275
9280
|
description?: string | undefined;
|
|
9281
|
+
/** One or more icons that represent your extension. */
|
|
9276
9282
|
icons?: ManifestIcons | undefined;
|
|
9277
9283
|
|
|
9278
9284
|
// Optional
|
|
9279
|
-
author
|
|
9280
|
-
|
|
9281
|
-
|
|
9282
|
-
background_page?: string | undefined;
|
|
9285
|
+
/** @deprecated As of February 2024, the `author` key is no longer supported by Chrome or the Chrome Web Store. If present, it's silently ignored. */
|
|
9286
|
+
author?: { email: string } | undefined;
|
|
9287
|
+
/** Defines overrides for selected Chrome settings. */
|
|
9283
9288
|
chrome_settings_overrides?: {
|
|
9284
9289
|
homepage?: string | undefined;
|
|
9285
9290
|
search_provider?: SearchProvider | undefined;
|
|
9286
9291
|
startup_pages?: string[] | undefined;
|
|
9287
9292
|
} | undefined;
|
|
9288
|
-
|
|
9289
|
-
bookmarks_ui?: {
|
|
9290
|
-
remove_bookmark_shortcut?: boolean | undefined;
|
|
9291
|
-
remove_button?: boolean | undefined;
|
|
9292
|
-
} | undefined;
|
|
9293
|
-
} | undefined;
|
|
9293
|
+
/** Defines overrides for default Chrome pages. */
|
|
9294
9294
|
chrome_url_overrides?: {
|
|
9295
9295
|
bookmarks?: string | undefined;
|
|
9296
9296
|
history?: string | undefined;
|
|
9297
9297
|
newtab?: string | undefined;
|
|
9298
9298
|
} | undefined;
|
|
9299
|
+
/** Defines keyboard shortcuts within the extension. */
|
|
9299
9300
|
commands?: {
|
|
9300
9301
|
[name: string]: {
|
|
9301
9302
|
suggested_key?: {
|
|
@@ -9313,38 +9314,30 @@ export namespace Browser {
|
|
|
9313
9314
|
matches?: string[] | undefined;
|
|
9314
9315
|
permissions?: string[] | undefined;
|
|
9315
9316
|
} | undefined;
|
|
9316
|
-
content_scripts?:
|
|
9317
|
-
| Array<{
|
|
9318
|
-
matches?: string[] | undefined;
|
|
9319
|
-
exclude_matches?: string[] | undefined;
|
|
9320
|
-
css?: string[] | undefined;
|
|
9321
|
-
js?: string[] | undefined;
|
|
9322
|
-
run_at?: string | undefined;
|
|
9323
|
-
all_frames?: boolean | undefined;
|
|
9324
|
-
match_about_blank?: boolean | undefined;
|
|
9325
|
-
include_globs?: string[] | undefined;
|
|
9326
|
-
exclude_globs?: string[] | undefined;
|
|
9327
|
-
}>
|
|
9328
|
-
| undefined;
|
|
9329
9317
|
converted_from_user_script?: boolean | undefined;
|
|
9318
|
+
/** Specifies a value for the Cross-Origin-Embedder-Policy HTTP header, which configures embedding of cross-origin resources in an extension page. */
|
|
9319
|
+
cross_origin_embedder_policy?: { value: string } | undefined;
|
|
9320
|
+
/** Specifies a value for the Cross-Origin-Opener-Policy HTTP header, which lets you ensure that a top-level extension page doesn't share a browsing context group with cross-origin documents. */
|
|
9321
|
+
cross_origin_opener_policy?: { value: string } | undefined;
|
|
9330
9322
|
current_locale?: string | undefined;
|
|
9323
|
+
/** Defines static rules for the declarativeNetRequest API, which allows blocking and modifying of network requests. */
|
|
9324
|
+
declarative_net_request?: { rule_resources?: declarativeNetRequest.Ruleset[] } | undefined;
|
|
9325
|
+
/** Defines pages that use the DevTools APIs. */
|
|
9331
9326
|
devtools_page?: string | undefined;
|
|
9332
9327
|
event_rules?:
|
|
9333
9328
|
| Array<{
|
|
9334
9329
|
event?: string | undefined;
|
|
9335
|
-
actions?:
|
|
9336
|
-
| Array<{
|
|
9337
|
-
type: string;
|
|
9338
|
-
}>
|
|
9339
|
-
| undefined;
|
|
9330
|
+
actions?: Array<{ type: string }> | undefined;
|
|
9340
9331
|
conditions?: Browser.declarativeContent.PageStateMatcherProperties[] | undefined;
|
|
9341
9332
|
}>
|
|
9342
9333
|
| undefined;
|
|
9334
|
+
/** Specifies what other pages and extensions can connect to your extensions. */
|
|
9343
9335
|
externally_connectable?: {
|
|
9344
9336
|
ids?: string[] | undefined;
|
|
9345
9337
|
matches?: string[] | undefined;
|
|
9346
9338
|
accepts_tls_channel_id?: boolean | undefined;
|
|
9347
9339
|
} | undefined;
|
|
9340
|
+
/** Provides access to the fileBrowserHandler API, which lets extensions access the ChromeOS file browser. */
|
|
9348
9341
|
file_browser_handlers?:
|
|
9349
9342
|
| Array<{
|
|
9350
9343
|
id?: string | undefined;
|
|
@@ -9352,35 +9345,44 @@ export namespace Browser {
|
|
|
9352
9345
|
file_filters?: string[] | undefined;
|
|
9353
9346
|
}>
|
|
9354
9347
|
| undefined;
|
|
9348
|
+
/** Allows access to the fileSystemProvider API, which lets extensions create file systems that ChromeOS can use. */
|
|
9355
9349
|
file_system_provider_capabilities?: {
|
|
9350
|
+
/** Whether configuring via onConfigureRequested is supported. By default: false. */
|
|
9356
9351
|
configurable?: boolean | undefined;
|
|
9352
|
+
/** Whether setting watchers and notifying about changes is supported. By default: false. */
|
|
9357
9353
|
watchable?: boolean | undefined;
|
|
9354
|
+
/** Whether multiple (more than one) mounted file systems are supported. By default: false. */
|
|
9358
9355
|
multiple_mounts?: boolean | undefined;
|
|
9359
|
-
|
|
9356
|
+
/** Files app uses above information in order to render related UI elements appropriately. For example, if `configurable` is set to true, then a menu item for configuring volumes will be rendered. Similarly, if `multiple_mounts` is set to true, then Files app will allow to add more than one mount points from the UI. If `watchable` is false, then a refresh button will be rendered. Note, that if possible you should add support for watchers, so changes on the file system can be reflected immediately and automatically. */
|
|
9357
|
+
source: "file" | "device" | "network";
|
|
9360
9358
|
} | undefined;
|
|
9359
|
+
/** string specifying a URL for the extension's homepage. If this is undefined, the homepage defaults to the extension's Chrome Web Store page. This field is particularly useful if you host the extension on your own site. */
|
|
9361
9360
|
homepage_url?: string | undefined;
|
|
9361
|
+
/** Allows resources to be imported into the extension. */
|
|
9362
9362
|
import?:
|
|
9363
9363
|
| Array<{
|
|
9364
9364
|
id: string;
|
|
9365
9365
|
minimum_version?: string | undefined;
|
|
9366
9366
|
}>
|
|
9367
9367
|
| undefined;
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
incognito?:
|
|
9368
|
+
/** Allows resources to be exported from the extension. */
|
|
9369
|
+
export?: { allowlist?: string[] | undefined } | undefined;
|
|
9370
|
+
/** Defines how the extension behaves in incognito mode. */
|
|
9371
|
+
incognito?: "spanning" | "split" | "not_allowed" | undefined;
|
|
9372
|
+
/** Allows the use of the Input Method Editor API. */
|
|
9372
9373
|
input_components?:
|
|
9373
9374
|
| Array<{
|
|
9374
|
-
name
|
|
9375
|
-
type?: string | undefined;
|
|
9375
|
+
name: string;
|
|
9376
9376
|
id?: string | undefined;
|
|
9377
|
-
description?: string | undefined;
|
|
9378
9377
|
language?: string[] | string | undefined;
|
|
9379
|
-
layouts?: string[] | undefined;
|
|
9380
|
-
|
|
9378
|
+
layouts?: string[] | string | undefined;
|
|
9379
|
+
input_view?: string | undefined;
|
|
9380
|
+
options_page?: string | undefined;
|
|
9381
9381
|
}>
|
|
9382
9382
|
| undefined;
|
|
9383
|
+
/** Specifies your extension's ID for various development use cases. */
|
|
9383
9384
|
key?: string | undefined;
|
|
9385
|
+
/** Defines the oldest Chrome version that can install your extension. The value must be a substring of an existing Chrome browser version string, such as "107" or "107.0.5304.87". Users with versions of Chrome older than the minimum version see a "Not compatible" warning in the Chrome Web Store, and are unable to install your extension. If you add this to an existing extension, users whose Chrome version is older won't receive automatic updates to your extension. This includes business users in ephemeral mode. */
|
|
9384
9386
|
minimum_chrome_version?: string | undefined;
|
|
9385
9387
|
nacl_modules?:
|
|
9386
9388
|
| Array<{
|
|
@@ -9388,53 +9390,39 @@ export namespace Browser {
|
|
|
9388
9390
|
mime_type: string;
|
|
9389
9391
|
}>
|
|
9390
9392
|
| undefined;
|
|
9393
|
+
/** Allows the use of an OAuth 2.0 security ID. The value of this key must be an object with "client_id" and "scopes" properties. */
|
|
9391
9394
|
oauth2?: {
|
|
9392
9395
|
client_id: string;
|
|
9393
9396
|
scopes?: string[] | undefined;
|
|
9394
9397
|
} | undefined;
|
|
9395
9398
|
offline_enabled?: boolean | undefined;
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
+
/** Allows the extension to register a keyword in Chrome's address bar. */
|
|
9400
|
+
omnibox?: { keyword: string } | undefined;
|
|
9401
|
+
/** Specifies a path to an options.html file for the extension to use as an options page. */
|
|
9399
9402
|
options_page?: string | undefined;
|
|
9403
|
+
/** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */
|
|
9400
9404
|
options_ui?: {
|
|
9401
|
-
page
|
|
9402
|
-
|
|
9403
|
-
|
|
9405
|
+
/** Path to the options page, relative to the extension's root. */
|
|
9406
|
+
page: string;
|
|
9407
|
+
/** Specify as `false` to declare an embedded options page. If `true`, the extension's options page will be opened in a new tab rather than embedded in `chrome://extensions`. */
|
|
9408
|
+
open_in_tab: boolean;
|
|
9404
9409
|
} | undefined;
|
|
9405
|
-
|
|
9406
|
-
| Array<{
|
|
9407
|
-
nacl_arch?: string | undefined;
|
|
9408
|
-
sub_package_path: string;
|
|
9409
|
-
}>
|
|
9410
|
-
| undefined;
|
|
9411
|
-
plugins?:
|
|
9412
|
-
| Array<{
|
|
9413
|
-
path: string;
|
|
9414
|
-
}>
|
|
9415
|
-
| undefined;
|
|
9410
|
+
/** Lists technologies required to use the extension. */
|
|
9416
9411
|
requirements?: {
|
|
9417
|
-
"3D"?: {
|
|
9418
|
-
|
|
9419
|
-
} | undefined;
|
|
9420
|
-
plugins?: {
|
|
9421
|
-
npapi?: boolean | undefined;
|
|
9422
|
-
} | undefined;
|
|
9412
|
+
"3D"?: { features?: string[] | undefined } | undefined;
|
|
9413
|
+
/** @deprecated NPAPI Plugin support for extensions has been discontinued as of Chrome version 45 */
|
|
9414
|
+
plugins?: { npapi?: boolean | undefined } | undefined;
|
|
9423
9415
|
} | undefined;
|
|
9416
|
+
/** Defines a set of extension pages that don't have access to extension APIs or direct access to non-sandboxed pages. */
|
|
9424
9417
|
sandbox?: {
|
|
9425
9418
|
pages: string[];
|
|
9426
9419
|
content_security_policy?: string | undefined;
|
|
9427
9420
|
} | undefined;
|
|
9421
|
+
/** A string containing a shortened version of the extension's name to be used when character space is limited. The maximum length is 12 characters. If this is undefined, a truncated version of the "name" key displays instead. */
|
|
9428
9422
|
short_name?: string | undefined;
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
dictionary_format?: string | undefined;
|
|
9433
|
-
dictionary_path?: string | undefined;
|
|
9434
|
-
} | undefined;
|
|
9435
|
-
storage?: {
|
|
9436
|
-
managed_schema: string;
|
|
9437
|
-
} | undefined;
|
|
9423
|
+
/** Declares a JSON schema for the managed storage area. */
|
|
9424
|
+
storage?: { managed_schema: string } | undefined;
|
|
9425
|
+
/** Registers the extension as a text to speech engine. */
|
|
9438
9426
|
tts_engine?: {
|
|
9439
9427
|
voices: Array<{
|
|
9440
9428
|
voice_name: string;
|
|
@@ -9443,13 +9431,14 @@ export namespace Browser {
|
|
|
9443
9431
|
event_types?: string[] | undefined;
|
|
9444
9432
|
}>;
|
|
9445
9433
|
} | undefined;
|
|
9434
|
+
/** A string containing the URL of the extension's updates page. Use this key if you're hosting your extension outside the Chrome Web Store. */
|
|
9446
9435
|
update_url?: string | undefined;
|
|
9436
|
+
/** A string describing the extension's version. Examples include "1.0 beta" and "build rc2". If this is unspecified, the "version" value displays on the extension management page instead. */
|
|
9447
9437
|
version_name?: string | undefined;
|
|
9448
9438
|
[key: string]: any;
|
|
9449
9439
|
}
|
|
9450
9440
|
|
|
9451
9441
|
export interface ManifestV2 extends ManifestBase {
|
|
9452
|
-
// Required
|
|
9453
9442
|
manifest_version: 2;
|
|
9454
9443
|
|
|
9455
9444
|
// Pick one (or none)
|
|
@@ -9464,24 +9453,50 @@ export namespace Browser {
|
|
|
9464
9453
|
persistent?: boolean | undefined;
|
|
9465
9454
|
}
|
|
9466
9455
|
| undefined;
|
|
9456
|
+
/** Specifies JavaScript or CSS files to be used when the user opens certain web pages. */
|
|
9457
|
+
content_scripts?:
|
|
9458
|
+
| Array<{
|
|
9459
|
+
matches?: string[] | undefined;
|
|
9460
|
+
exclude_matches?: string[] | undefined;
|
|
9461
|
+
css?: string[] | undefined;
|
|
9462
|
+
js?: string[] | undefined;
|
|
9463
|
+
run_at?: string | undefined;
|
|
9464
|
+
all_frames?: boolean | undefined;
|
|
9465
|
+
match_about_blank?: boolean | undefined;
|
|
9466
|
+
include_globs?: string[] | undefined;
|
|
9467
|
+
exclude_globs?: string[] | undefined;
|
|
9468
|
+
}>
|
|
9469
|
+
| undefined;
|
|
9470
|
+
/** Defines restrictions on the scripts, styles, and other resources an extension can use. */
|
|
9467
9471
|
content_security_policy?: string | undefined;
|
|
9472
|
+
/** Declares optional permissions for your extension. */
|
|
9468
9473
|
optional_permissions?: (ManifestOptionalPermission | string)[] | undefined;
|
|
9474
|
+
/** Enables use of particular extension APIs. */
|
|
9469
9475
|
permissions?: (ManifestPermission | string)[] | undefined;
|
|
9476
|
+
platforms?:
|
|
9477
|
+
| Array<{
|
|
9478
|
+
nacl_arch?: string | undefined;
|
|
9479
|
+
sub_package_path: string;
|
|
9480
|
+
}>
|
|
9481
|
+
| undefined;
|
|
9482
|
+
/** Defines files within the extension that can be accessed by web pages or other extensions. */
|
|
9470
9483
|
web_accessible_resources?: string[] | undefined;
|
|
9471
9484
|
}
|
|
9472
9485
|
|
|
9473
9486
|
export interface ManifestV3 extends ManifestBase {
|
|
9474
|
-
// Required
|
|
9475
9487
|
manifest_version: 3;
|
|
9476
9488
|
|
|
9477
9489
|
// Optional
|
|
9490
|
+
/** Defines the appearance and behavior of the extension's icon in the Google Toolbar. */
|
|
9478
9491
|
action?: ManifestAction | undefined;
|
|
9492
|
+
/** Specifies the JavaScript file containing the extension's service worker, which acts as an event handler. */
|
|
9479
9493
|
background?:
|
|
9480
9494
|
| {
|
|
9481
9495
|
service_worker: string;
|
|
9482
|
-
type?: "module";
|
|
9496
|
+
type?: "module";
|
|
9483
9497
|
}
|
|
9484
9498
|
| undefined;
|
|
9499
|
+
/** Specifies JavaScript or CSS files to be used when the user opens certain web pages. */
|
|
9485
9500
|
content_scripts?:
|
|
9486
9501
|
| Array<{
|
|
9487
9502
|
matches?: string[] | undefined;
|
|
@@ -9496,14 +9511,35 @@ export namespace Browser {
|
|
|
9496
9511
|
world?: "ISOLATED" | "MAIN" | undefined;
|
|
9497
9512
|
}>
|
|
9498
9513
|
| undefined;
|
|
9514
|
+
/** Defines restrictions on the scripts, styles, and other resources an extension can use. */
|
|
9499
9515
|
content_security_policy?: {
|
|
9500
9516
|
extension_pages?: string;
|
|
9501
9517
|
sandbox?: string;
|
|
9502
|
-
};
|
|
9518
|
+
} | undefined;
|
|
9519
|
+
/** Specifies file types for ChromeOS extensions to handle. */
|
|
9520
|
+
file_handlers?:
|
|
9521
|
+
| Array<{
|
|
9522
|
+
/** Specifies an HTML file to show when a file is opened. The file must be within your extension. Processing the file, whether it's displayed or used in some other way, is done with JavaScript using appropriate web platform APIs. This code must be in a separate JavaScript file included via a `<script>` tag. */
|
|
9523
|
+
action: string;
|
|
9524
|
+
/** A user friendly description of the action. */
|
|
9525
|
+
name: string;
|
|
9526
|
+
/** The file types that can be processed by the page specified in "action". The items in the dictionary are a key/value pair where the key is a MIME type and the value is an array of file extensions. Only known MIME types are allowed for the key. Custom file types are allowed but the key for a custom type must be a known MIME type, and the mapping between the MIME type and the custom file type must be supported by the underlying operating system. */
|
|
9527
|
+
accept: { [mime_type: string]: string[] };
|
|
9528
|
+
/** Specifies whether multiple files should be opened in a single client or multiple clients. The default value is "single-client". */
|
|
9529
|
+
launch_type?: "multiple-clients" | "single-client" | undefined;
|
|
9530
|
+
}>
|
|
9531
|
+
| undefined;
|
|
9532
|
+
/** Lists the web pages your extension is allowed to interact with, defined using URL match patterns. User permission for these sites is requested at install time. */
|
|
9503
9533
|
host_permissions?: string[] | undefined;
|
|
9534
|
+
/** Declares optional permissions for your extension. */
|
|
9504
9535
|
optional_permissions?: ManifestOptionalPermission[] | undefined;
|
|
9536
|
+
/** Declares optional host permissions for your extension. */
|
|
9505
9537
|
optional_host_permissions?: string[] | undefined;
|
|
9538
|
+
/** Enables use of particular extension APIs. */
|
|
9506
9539
|
permissions?: ManifestPermission[] | undefined;
|
|
9540
|
+
/** Identifies an HTML file to display in a sidePanel. */
|
|
9541
|
+
side_panel?: { default_path: string } | undefined;
|
|
9542
|
+
/** Defines files within the extension that can be accessed by web pages or other extensions. */
|
|
9507
9543
|
web_accessible_resources?:
|
|
9508
9544
|
| Array<
|
|
9509
9545
|
& {
|