/** * !!! PLEASE DO NOT EDIT THIS FILE !!! * * This source file, even though checked in, is auto-generated based on the * current development within the WebDriver Bidi spec. Any changes to this * file need to come from the specification. You can generate this file by calling * * ``` * $ npm run generate:bidi * ``` * * from the project root. You can find the scripts that generates this file in * ./scripts/bidi/** */ import type * as local from './localTypes.js' import type * as remote from './remoteTypes.js' import { BidiCore } from './core.js' export class BidiHandler extends BidiCore { /** * WebDriver Bidi command to send command method "session.status" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-session-status * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-session-status | command parameter} * @returns `Promise` **/ async sessionStatus(params: remote.EmptyParams): Promise { const result = await this.send({ method: 'session.status', params }) return result.result as local.SessionStatusResult } /** * WebDriver Bidi command to send command method "session.new" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-session-new * @param params `remote.SessionNewParameters` {@link https://w3c.github.io/webdriver-bidi/#command-session-new | command parameter} * @returns `Promise` **/ async sessionNew(params: remote.SessionNewParameters): Promise { const result = await this.send({ method: 'session.new', params }) return result.result as local.SessionNewResult } /** * WebDriver Bidi command to send command method "session.end" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-session-end * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-session-end | command parameter} * @returns `Promise` **/ async sessionEnd(params: remote.EmptyParams): Promise { const result = await this.send({ method: 'session.end', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "session.subscribe" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-session-subscribe * @param params `remote.SessionSubscriptionRequest` {@link https://w3c.github.io/webdriver-bidi/#command-session-subscribe | command parameter} * @returns `Promise` **/ async sessionSubscribe(params: remote.SessionSubscriptionRequest): Promise { const result = await this.send({ method: 'session.subscribe', params }) return result.result as local.SessionSubscribeResult } /** * WebDriver Bidi command to send command method "session.unsubscribe" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe * @param params `remote.SessionUnsubscribeParameters` {@link https://w3c.github.io/webdriver-bidi/#command-session-unsubscribe | command parameter} * @returns `Promise` **/ async sessionUnsubscribe(params: remote.SessionUnsubscribeParameters): Promise { const result = await this.send({ method: 'session.unsubscribe', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browser.close" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browser-close * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-browser-close | command parameter} * @returns `Promise` **/ async browserClose(params: remote.EmptyParams): Promise { const result = await this.send({ method: 'browser.close', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browser.createUserContext" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browser-createUserContext * @param params `remote.BrowserCreateUserContextParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browser-createUserContext | command parameter} * @returns `Promise` **/ async browserCreateUserContext(params: remote.BrowserCreateUserContextParameters): Promise { const result = await this.send({ method: 'browser.createUserContext', params }) return result.result as local.BrowserCreateUserContextResult } /** * WebDriver Bidi command to send command method "browser.getClientWindows" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browser-getClientWindows * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-browser-getClientWindows | command parameter} * @returns `Promise` **/ async browserGetClientWindows(params: remote.EmptyParams): Promise { const result = await this.send({ method: 'browser.getClientWindows', params }) return result.result as local.BrowserGetClientWindowsResult } /** * WebDriver Bidi command to send command method "browser.getUserContexts" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browser-getUserContexts * @param params `remote.EmptyParams` {@link https://w3c.github.io/webdriver-bidi/#command-browser-getUserContexts | command parameter} * @returns `Promise` **/ async browserGetUserContexts(params: remote.EmptyParams): Promise { const result = await this.send({ method: 'browser.getUserContexts', params }) return result.result as local.BrowserGetUserContextsResult } /** * WebDriver Bidi command to send command method "browser.removeUserContext" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browser-removeUserContext * @param params `remote.BrowserRemoveUserContextParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browser-removeUserContext | command parameter} * @returns `Promise` **/ async browserRemoveUserContext(params: remote.BrowserRemoveUserContextParameters): Promise { const result = await this.send({ method: 'browser.removeUserContext', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browser.setClientWindowState" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browser-setClientWindowState * @param params `remote.BrowserSetClientWindowStateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browser-setClientWindowState | command parameter} * @returns `Promise` **/ async browserSetClientWindowState(params: remote.BrowserSetClientWindowStateParameters): Promise { const result = await this.send({ method: 'browser.setClientWindowState', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browsingContext.activate" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-activate * @param params `remote.BrowsingContextActivateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-activate | command parameter} * @returns `Promise` **/ async browsingContextActivate(params: remote.BrowsingContextActivateParameters): Promise { const result = await this.send({ method: 'browsingContext.activate', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browsingContext.captureScreenshot" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot * @param params `remote.BrowsingContextCaptureScreenshotParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-captureScreenshot | command parameter} * @returns `Promise` **/ async browsingContextCaptureScreenshot(params: remote.BrowsingContextCaptureScreenshotParameters): Promise { const result = await this.send({ method: 'browsingContext.captureScreenshot', params }) return result.result as local.BrowsingContextCaptureScreenshotResult } /** * WebDriver Bidi command to send command method "browsingContext.close" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-close * @param params `remote.BrowsingContextCloseParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-close | command parameter} * @returns `Promise` **/ async browsingContextClose(params: remote.BrowsingContextCloseParameters): Promise { const result = await this.send({ method: 'browsingContext.close', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browsingContext.create" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-create * @param params `remote.BrowsingContextCreateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-create | command parameter} * @returns `Promise` **/ async browsingContextCreate(params: remote.BrowsingContextCreateParameters): Promise { const result = await this.send({ method: 'browsingContext.create', params }) return result.result as local.BrowsingContextCreateResult } /** * WebDriver Bidi command to send command method "browsingContext.getTree" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree * @param params `remote.BrowsingContextGetTreeParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-getTree | command parameter} * @returns `Promise` **/ async browsingContextGetTree(params: remote.BrowsingContextGetTreeParameters): Promise { const result = await this.send({ method: 'browsingContext.getTree', params }) return result.result as local.BrowsingContextGetTreeResult } /** * WebDriver Bidi command to send command method "browsingContext.handleUserPrompt" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt * @param params `remote.BrowsingContextHandleUserPromptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-handleUserPrompt | command parameter} * @returns `Promise` **/ async browsingContextHandleUserPrompt(params: remote.BrowsingContextHandleUserPromptParameters): Promise { const result = await this.send({ method: 'browsingContext.handleUserPrompt', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browsingContext.locateNodes" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-locateNodes * @param params `remote.BrowsingContextLocateNodesParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-locateNodes | command parameter} * @returns `Promise` **/ async browsingContextLocateNodes(params: remote.BrowsingContextLocateNodesParameters): Promise { const result = await this.send({ method: 'browsingContext.locateNodes', params }) return result.result as local.BrowsingContextLocateNodesResult } /** * WebDriver Bidi command to send command method "browsingContext.navigate" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate * @param params `remote.BrowsingContextNavigateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-navigate | command parameter} * @returns `Promise` **/ async browsingContextNavigate(params: remote.BrowsingContextNavigateParameters): Promise { const result = await this.send({ method: 'browsingContext.navigate', params }) return result.result as local.BrowsingContextNavigateResult } /** * WebDriver Bidi command to send command method "browsingContext.print" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-print * @param params `remote.BrowsingContextPrintParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-print | command parameter} * @returns `Promise` **/ async browsingContextPrint(params: remote.BrowsingContextPrintParameters): Promise { const result = await this.send({ method: 'browsingContext.print', params }) return result.result as local.BrowsingContextPrintResult } /** * WebDriver Bidi command to send command method "browsingContext.reload" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload * @param params `remote.BrowsingContextReloadParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-reload | command parameter} * @returns `Promise` **/ async browsingContextReload(params: remote.BrowsingContextReloadParameters): Promise { const result = await this.send({ method: 'browsingContext.reload', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browsingContext.setViewport" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-setViewport * @param params `remote.BrowsingContextSetViewportParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-setViewport | command parameter} * @returns `Promise` **/ async browsingContextSetViewport(params: remote.BrowsingContextSetViewportParameters): Promise { const result = await this.send({ method: 'browsingContext.setViewport', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "browsingContext.traverseHistory" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-browsingContext-traverseHistory * @param params `remote.BrowsingContextTraverseHistoryParameters` {@link https://w3c.github.io/webdriver-bidi/#command-browsingContext-traverseHistory | command parameter} * @returns `Promise` **/ async browsingContextTraverseHistory(params: remote.BrowsingContextTraverseHistoryParameters): Promise { const result = await this.send({ method: 'browsingContext.traverseHistory', params }) return result.result as local.BrowsingContextTraverseHistoryResult } /** * WebDriver Bidi command to send command method "emulation.setGeolocationOverride" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-emulation-setGeolocationOverride * @param params `remote.EmulationSetGeolocationOverrideParameters` {@link https://w3c.github.io/webdriver-bidi/#command-emulation-setGeolocationOverride | command parameter} * @returns `Promise` **/ async emulationSetGeolocationOverride(params: remote.EmulationSetGeolocationOverrideParameters): Promise { const result = await this.send({ method: 'emulation.setGeolocationOverride', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.addIntercept" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-addIntercept * @param params `remote.NetworkAddInterceptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-addIntercept | command parameter} * @returns `Promise` **/ async networkAddIntercept(params: remote.NetworkAddInterceptParameters): Promise { const result = await this.send({ method: 'network.addIntercept', params }) return result.result as local.NetworkAddInterceptResult } /** * WebDriver Bidi command to send command method "network.continueRequest" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-continueRequest * @param params `remote.NetworkContinueRequestParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-continueRequest | command parameter} * @returns `Promise` **/ async networkContinueRequest(params: remote.NetworkContinueRequestParameters): Promise { const result = await this.send({ method: 'network.continueRequest', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.continueResponse" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-continueResponse * @param params `remote.NetworkContinueResponseParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-continueResponse | command parameter} * @returns `Promise` **/ async networkContinueResponse(params: remote.NetworkContinueResponseParameters): Promise { const result = await this.send({ method: 'network.continueResponse', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.continueWithAuth" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-continueWithAuth * @param params `remote.NetworkContinueWithAuthParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-continueWithAuth | command parameter} * @returns `Promise` **/ async networkContinueWithAuth(params: remote.NetworkContinueWithAuthParameters): Promise { const result = await this.send({ method: 'network.continueWithAuth', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.failRequest" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-failRequest * @param params `remote.NetworkFailRequestParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-failRequest | command parameter} * @returns `Promise` **/ async networkFailRequest(params: remote.NetworkFailRequestParameters): Promise { const result = await this.send({ method: 'network.failRequest', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.provideResponse" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-provideResponse * @param params `remote.NetworkProvideResponseParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-provideResponse | command parameter} * @returns `Promise` **/ async networkProvideResponse(params: remote.NetworkProvideResponseParameters): Promise { const result = await this.send({ method: 'network.provideResponse', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.removeIntercept" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-removeIntercept * @param params `remote.NetworkRemoveInterceptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-removeIntercept | command parameter} * @returns `Promise` **/ async networkRemoveIntercept(params: remote.NetworkRemoveInterceptParameters): Promise { const result = await this.send({ method: 'network.removeIntercept', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "network.setCacheBehavior" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-network-setCacheBehavior * @param params `remote.NetworkSetCacheBehaviorParameters` {@link https://w3c.github.io/webdriver-bidi/#command-network-setCacheBehavior | command parameter} * @returns `Promise` **/ async networkSetCacheBehavior(params: remote.NetworkSetCacheBehaviorParameters): Promise { const result = await this.send({ method: 'network.setCacheBehavior', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "script.addPreloadScript" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript * @param params `remote.ScriptAddPreloadScriptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-addPreloadScript | command parameter} * @returns `Promise` **/ async scriptAddPreloadScript(params: remote.ScriptAddPreloadScriptParameters): Promise { const result = await this.send({ method: 'script.addPreloadScript', params }) return result.result as local.ScriptAddPreloadScriptResult } /** * WebDriver Bidi command to send command method "script.disown" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-script-disown * @param params `remote.ScriptDisownParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-disown | command parameter} * @returns `Promise` **/ async scriptDisown(params: remote.ScriptDisownParameters): Promise { const result = await this.send({ method: 'script.disown', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "script.callFunction" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-script-callFunction * @param params `remote.ScriptCallFunctionParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-callFunction | command parameter} * @returns `Promise` **/ async scriptCallFunction(params: remote.ScriptCallFunctionParameters): Promise { const result = await this.send({ method: 'script.callFunction', params }) return result.result as local.ScriptEvaluateResult } /** * WebDriver Bidi command to send command method "script.evaluate" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-script-evaluate * @param params `remote.ScriptEvaluateParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-evaluate | command parameter} * @returns `Promise` **/ async scriptEvaluate(params: remote.ScriptEvaluateParameters): Promise { const result = await this.send({ method: 'script.evaluate', params }) return result.result as local.ScriptEvaluateResult } /** * WebDriver Bidi command to send command method "script.getRealms" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-script-getRealms * @param params `remote.ScriptGetRealmsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-getRealms | command parameter} * @returns `Promise` **/ async scriptGetRealms(params: remote.ScriptGetRealmsParameters): Promise { const result = await this.send({ method: 'script.getRealms', params }) return result.result as local.ScriptGetRealmsResult } /** * WebDriver Bidi command to send command method "script.removePreloadScript" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript * @param params `remote.ScriptRemovePreloadScriptParameters` {@link https://w3c.github.io/webdriver-bidi/#command-script-removePreloadScript | command parameter} * @returns `Promise` **/ async scriptRemovePreloadScript(params: remote.ScriptRemovePreloadScriptParameters): Promise { const result = await this.send({ method: 'script.removePreloadScript', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "storage.getCookies" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-storage-getCookies * @param params `remote.StorageGetCookiesParameters` {@link https://w3c.github.io/webdriver-bidi/#command-storage-getCookies | command parameter} * @returns `Promise` **/ async storageGetCookies(params: remote.StorageGetCookiesParameters): Promise { const result = await this.send({ method: 'storage.getCookies', params }) return result.result as local.StorageGetCookiesResult } /** * WebDriver Bidi command to send command method "storage.setCookie" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-storage-setCookie * @param params `remote.StorageSetCookieParameters` {@link https://w3c.github.io/webdriver-bidi/#command-storage-setCookie | command parameter} * @returns `Promise` **/ async storageSetCookie(params: remote.StorageSetCookieParameters): Promise { const result = await this.send({ method: 'storage.setCookie', params }) return result.result as local.StorageSetCookieResult } /** * WebDriver Bidi command to send command method "storage.deleteCookies" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-storage-deleteCookies * @param params `remote.StorageDeleteCookiesParameters` {@link https://w3c.github.io/webdriver-bidi/#command-storage-deleteCookies | command parameter} * @returns `Promise` **/ async storageDeleteCookies(params: remote.StorageDeleteCookiesParameters): Promise { const result = await this.send({ method: 'storage.deleteCookies', params }) return result.result as local.StorageDeleteCookiesResult } /** * WebDriver Bidi command to send command method "input.performActions" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-input-performActions * @param params `remote.InputPerformActionsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-performActions | command parameter} * @returns `Promise` **/ async inputPerformActions(params: remote.InputPerformActionsParameters): Promise { const result = await this.send({ method: 'input.performActions', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "input.releaseActions" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-input-releaseActions * @param params `remote.InputReleaseActionsParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-releaseActions | command parameter} * @returns `Promise` **/ async inputReleaseActions(params: remote.InputReleaseActionsParameters): Promise { const result = await this.send({ method: 'input.releaseActions', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "input.setFiles" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-input-setFiles * @param params `remote.InputSetFilesParameters` {@link https://w3c.github.io/webdriver-bidi/#command-input-setFiles | command parameter} * @returns `Promise` **/ async inputSetFiles(params: remote.InputSetFilesParameters): Promise { const result = await this.send({ method: 'input.setFiles', params }) return result.result as local.EmptyResult } /** * WebDriver Bidi command to send command method "webExtension.install" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-webExtension-install * @param params `remote.WebExtensionInstallParameters` {@link https://w3c.github.io/webdriver-bidi/#command-webExtension-install | command parameter} * @returns `Promise` **/ async webExtensionInstall(params: remote.WebExtensionInstallParameters): Promise { const result = await this.send({ method: 'webExtension.install', params }) return result.result as local.WebExtensionInstallResult } /** * WebDriver Bidi command to send command method "webExtension.uninstall" with parameters. * @url https://w3c.github.io/webdriver-bidi/#command-webExtension-uninstall * @param params `remote.WebExtensionUninstallParameters` {@link https://w3c.github.io/webdriver-bidi/#command-webExtension-uninstall | command parameter} * @returns `Promise` **/ async webExtensionUninstall(params: remote.WebExtensionUninstallParameters): Promise { const result = await this.send({ method: 'webExtension.uninstall', params }) return result.result as local.EmptyResult } }