@wxt-dev/browser 0.0.316 → 0.0.317
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 +45 -0
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.317",
|
|
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.317",
|
|
23
23
|
"fs-extra": "^11.3.0",
|
|
24
24
|
"nano-spawn": "^0.2.0",
|
|
25
25
|
"tsx": "4.19.3",
|
package/src/gen/index.d.ts
CHANGED
|
@@ -14862,6 +14862,18 @@ export namespace Browser {
|
|
|
14862
14862
|
*/
|
|
14863
14863
|
export type ExecutionWorld = "MAIN" | "USER_SCRIPT";
|
|
14864
14864
|
|
|
14865
|
+
/** @since Chrome 135 */
|
|
14866
|
+
export interface InjectionResult {
|
|
14867
|
+
/** The document associated with the injection. */
|
|
14868
|
+
documentId: string;
|
|
14869
|
+
/** The error, if any. `error` and `result` are mutually exclusive. */
|
|
14870
|
+
error?: string;
|
|
14871
|
+
/** The frame associated with the injection. */
|
|
14872
|
+
frameId: number;
|
|
14873
|
+
/** The result of the script execution. */
|
|
14874
|
+
result: any;
|
|
14875
|
+
}
|
|
14876
|
+
|
|
14865
14877
|
export interface WorldProperties {
|
|
14866
14878
|
/** Specifies the world csp. The default is the `ISOLATED` world csp. */
|
|
14867
14879
|
csp?: string;
|
|
@@ -14878,6 +14890,18 @@ export namespace Browser {
|
|
|
14878
14890
|
ids?: string[];
|
|
14879
14891
|
}
|
|
14880
14892
|
|
|
14893
|
+
/** @since Chrome 135 */
|
|
14894
|
+
export interface InjectionTarget {
|
|
14895
|
+
/** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` is specified. */
|
|
14896
|
+
allFrames?: boolean;
|
|
14897
|
+
/** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
|
|
14898
|
+
documentIds?: string[];
|
|
14899
|
+
/** The IDs of specific frames to inject into. */
|
|
14900
|
+
frameIds?: number[];
|
|
14901
|
+
/** The ID of the tab into which to inject. */
|
|
14902
|
+
tabId: number;
|
|
14903
|
+
}
|
|
14904
|
+
|
|
14881
14905
|
export interface RegisteredUserScript {
|
|
14882
14906
|
/** If true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched. */
|
|
14883
14907
|
allFrames?: boolean;
|
|
@@ -14904,6 +14928,20 @@ export namespace Browser {
|
|
|
14904
14928
|
worldId?: string;
|
|
14905
14929
|
}
|
|
14906
14930
|
|
|
14931
|
+
/** @since Chrome 135 */
|
|
14932
|
+
export interface UserScriptInjection {
|
|
14933
|
+
/** Whether the injection should be triggered in the target as soon as possible. Note that this is not a guarantee that injection will occur prior to page load, as the page may have already loaded by the time the script reaches the target. */
|
|
14934
|
+
injectImmediately?: boolean;
|
|
14935
|
+
/** The list of ScriptSource objects defining sources of scripts to be injected into the target. */
|
|
14936
|
+
js: ScriptSource[];
|
|
14937
|
+
/** Details specifying the target into which to inject the script. */
|
|
14938
|
+
target: InjectionTarget;
|
|
14939
|
+
/** The JavaScript "world" to run the script in. The default is `USER_SCRIPT`. */
|
|
14940
|
+
world?: ExecutionWorld;
|
|
14941
|
+
/** Specifies the user script world ID to execute in. If omitted, the script will execute in the default user script world. Only valid if `world` is omitted or is `USER_SCRIPT`. Values with leading underscores (`_`) are reserved. */
|
|
14942
|
+
worldId?: string;
|
|
14943
|
+
}
|
|
14944
|
+
|
|
14907
14945
|
/**
|
|
14908
14946
|
* Properties for a script source.
|
|
14909
14947
|
*/
|
|
@@ -14956,6 +14994,13 @@ export namespace Browser {
|
|
|
14956
14994
|
export function getWorldConfigurations(): Promise<WorldProperties[]>;
|
|
14957
14995
|
export function getWorldConfigurations(callback: (worlds: WorldProperties[]) => void): void;
|
|
14958
14996
|
|
|
14997
|
+
/**
|
|
14998
|
+
* Injects a script into a target context. By default, the script will be run at `document_idle`, or immediately if the page has already loaded. If the `injectImmediately` property is set, the script will inject without waiting, even if the page has not finished loading. If the script evaluates to a promise, the browser will wait for the promise to settle and return the resulting value.
|
|
14999
|
+
* @since Chrome 135
|
|
15000
|
+
*/
|
|
15001
|
+
export function execute(injection: UserScriptInjection): Promise<InjectionResult[]>;
|
|
15002
|
+
export function execute(injection: UserScriptInjection, callback: (result: InjectionResult[]) => void): void;
|
|
15003
|
+
|
|
14959
15004
|
/**
|
|
14960
15005
|
* Registers one or more user scripts for this extension.
|
|
14961
15006
|
*
|