added script support in remote browser script

Signed-off-by: RonniSkansing <rskansing@gmail.com>
This commit is contained in:
RonniSkansing committed 2026-09-30 22:50:37 +02:00
1 parent 0538ef0381
commit f9d4169f90
9 files changed
+234

No files matched your search

@@ -765,6 +765,15 @@ interface RequestInfo {
* var s = newSession({ proxy: r.country === 'DE' ? 'de-proxy' : 'us-proxy' });
*/
declare function request(): RequestInfo;
/**
* Run a saved Script by name, passing data as its input, and return the object
* the Script returns. Synchronous (blocks until the Script finishes). Useful for
* reusable snippets and talking to external services. Requires the Scripts
* feature to be enabled.
* var geo = runScript('enrich-ip', { ip: request().ip });
* var s = newSession({ proxy: geo.proxy });
*/
declare function runScript(name: string, data?: object): any;
/** Send an event to the victim page (visible to the victim's JS) */
declare function emit(key: string, value?: any): void;
/** Log a message to the test runner */
@@ -111,6 +111,14 @@ declare const event: {
data: Record<string, any>;
};
/**
* input is the data object passed when this script is run in callable mode,
* e.g. from a remote browser script via runScript('name', data). It is an empty
* object for campaign event triggered runs. Return an object to send data back
* to the caller (callable mode only).
*/
declare const input: Record<string, any>;
interface FetchOptions {
/** HTTP method: GET (default), POST, PUT, PATCH, DELETE, ... */
method?: string;