You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` is specified. */
14894
+
allFrames?: boolean;
14895
+
/** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */
14896
+
documentIds?: string[];
14897
+
/** The IDs of specific frames to inject into. */
14898
+
frameIds?: number[];
14899
+
/** The ID of the tab into which to inject. */
14900
+
tabId: number;
14901
+
}
14902
+
14879
14903
export interface RegisteredUserScript {
14880
14904
/** 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. */
/** 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. */
14932
+
injectImmediately?: boolean;
14933
+
/** The list of ScriptSource objects defining sources of scripts to be injected into the target. */
14934
+
js: ScriptSource[];
14935
+
/** Details specifying the target into which to inject the script. */
14936
+
target: InjectionTarget;
14937
+
/** The JavaScript "world" to run the script in. The default is `USER_SCRIPT`. */
14938
+
world?: ExecutionWorld;
14939
+
/** 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. */
export function getWorldConfigurations(): Promise<WorldProperties[]>;
14955
14993
export function getWorldConfigurations(callback: (worlds: WorldProperties[]) => void): void;
14956
14994
14995
+
/**
14996
+
* 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.
14997
+
* @since Chrome 135
14998
+
*/
14999
+
export function execute(injection: UserScriptInjection): Promise<InjectionResult[]>;
15000
+
export function execute(injection: UserScriptInjection, callback: (result: InjectionResult[]) => void): void;
15001
+
14957
15002
/**
14958
15003
* Registers one or more user scripts for this extension.
0 commit comments