Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chromium-bidi

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chromium-bidi - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.d.ts

7

lib/cjs/bidiMapper/BidiNoOpParser.d.ts

@@ -17,3 +17,3 @@ /**

*/
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
import type { BrowsingContext, Cdp, Input, Network, Script, Session, Storage, Permissions } from '../protocol/protocol.js';
import type { BidiCommandParameterParser } from './BidiParser.js';

@@ -42,2 +42,3 @@ export declare class BidiNoOpParser implements BidiCommandParameterParser {

parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
parseSetFilesParams(params: unknown): Input.SetFilesParameters;
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;

@@ -50,3 +51,7 @@ parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;

parseRemoveInterceptParams(params: unknown): Network.RemoveInterceptParameters;
parseSetPermissionsParams(params: unknown): Permissions.SetPermissionParameters;
parseSubscribeParams(params: unknown): Session.SubscriptionRequest;
parseDeleteCookiesParams(params: unknown): Storage.DeleteCookiesParameters;
parseGetCookiesParams(params: unknown): Storage.GetCookiesParameters;
parseSetCookieParams(params: unknown): Storage.SetCookieParameters;
}

@@ -95,2 +95,5 @@ "use strict";

}
parseSetFilesParams(params) {
return params;
}
// keep-sorted end

@@ -121,2 +124,8 @@ // Network domain

// keep-sorted end
// Permissions domain
// keep-sorted start block=yes
parseSetPermissionsParams(params) {
return params;
}
// keep-sorted end
// Session domain

@@ -127,4 +136,16 @@ // keep-sorted start block=yes

}
// keep-sorted end
// Storage domain
// keep-sorted start block=yes
parseDeleteCookiesParams(params) {
return params;
}
parseGetCookiesParams(params) {
return params;
}
parseSetCookieParams(params) {
return params;
}
}
exports.BidiNoOpParser = BidiNoOpParser;
//# sourceMappingURL=BidiNoOpParser.js.map

@@ -17,3 +17,3 @@ /**

*/
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
import type { BrowsingContext, Cdp, Input, Network, Permissions, Script, Session, Storage } from '../protocol/protocol.js';
export interface BidiCommandParameterParser {

@@ -35,2 +35,4 @@ parseActivateParams(params: unknown): BrowsingContext.ActivateParameters;

parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
parseSetFilesParams(params: unknown): Input.SetFilesParameters;
parseSetPermissionsParams(params: unknown): Permissions.SetPermissionParameters;
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;

@@ -50,2 +52,5 @@ parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;

parseSubscribeParams(params: unknown): Session.SubscriptionRequest;
parseDeleteCookiesParams(params: unknown): Storage.DeleteCookiesParameters;
parseGetCookiesParams(params: unknown): Storage.GetCookiesParameters;
parseSetCookieParams(params: unknown): Storage.SetCookieParameters;
}

@@ -30,5 +30,7 @@ "use strict";

const NetworkStorage_js_1 = require("./domains/network/NetworkStorage.js");
const PermissionsProcessor_js_1 = require("./domains/permissions/PermissionsProcessor.js");
const PreloadScriptStorage_js_1 = require("./domains/script/PreloadScriptStorage.js");
const ScriptProcessor_js_1 = require("./domains/script/ScriptProcessor.js");
const SessionProcessor_js_1 = require("./domains/session/SessionProcessor.js");
const StorageProcessor_js_1 = require("./domains/storage/StorageProcessor.js");
const OutgoingMessage_js_1 = require("./OutgoingMessage.js");

@@ -42,4 +44,6 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {

#networkProcessor;
#permissionsProcessor;
#scriptProcessor;
#sessionProcessor;
#storageProcessor;
// keep-sorted end

@@ -58,6 +62,8 @@ #parser;

this.#cdpProcessor = new CdpProcessor_js_1.CdpProcessor(browsingContextStorage, cdpConnection, browserCdpClient);
this.#inputProcessor = new InputProcessor_js_1.InputProcessor(browsingContextStorage);
this.#inputProcessor = new InputProcessor_js_1.InputProcessor(browsingContextStorage, realmStorage);
this.#networkProcessor = new NetworkProcessor_js_1.NetworkProcessor(browsingContextStorage, networkStorage);
this.#permissionsProcessor = new PermissionsProcessor_js_1.PermissionsProcessor(browserCdpClient);
this.#scriptProcessor = new ScriptProcessor_js_1.ScriptProcessor(browsingContextStorage, realmStorage, preloadScriptStorage, logger);
this.#sessionProcessor = new SessionProcessor_js_1.SessionProcessor(eventManager);
this.#storageProcessor = new StorageProcessor_js_1.StorageProcessor(browserCdpClient, browsingContextStorage, logger);
// keep-sorted end

@@ -116,2 +122,4 @@ }

return await this.#inputProcessor.releaseActions(this.#parser.parseReleaseActionsParams(command.params));
case 'input.setFiles':
return await this.#inputProcessor.setFiles(this.#parser.parseSetFilesParams(command.params));
// keep-sorted end

@@ -135,2 +143,7 @@ // Network domain

// keep-sorted end
// Permissions domain
// keep-sorted start block=yes
case 'permissions.setPermission':
return await this.#permissionsProcessor.setPermissions(this.#parser.parseSetPermissionsParams(command.params));
// keep-sorted end
// Script domain

@@ -160,4 +173,13 @@ // keep-sorted start block=yes

// keep-sorted end
// Storage domain
// keep-sorted start block=yes
case 'storage.deleteCookies':
throw new protocol_js_1.UnsupportedOperationException(`${command.method} is not supported yet`);
case 'storage.getCookies':
return await this.#storageProcessor.getCookies(this.#parser.parseGetCookiesParams(command.params));
case 'storage.setCookie':
return await this.#storageProcessor.setCookie(this.#parser.parseSetCookieParams(command.params));
// keep-sorted end
}
// Intentionally kept outside of the switch statement to ensure that
// Intentionally kept outside the switch statement to ensure that
// ESLint @typescript-eslint/switch-exhaustiveness-check triggers if a new

@@ -164,0 +186,0 @@ // command is added.

4

lib/cjs/bidiMapper/domains/input/InputProcessor.d.ts
import { Input, type EmptyResult } from '../../../protocol/protocol.js';
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
import type { RealmStorage } from '../script/RealmStorage.js';
export declare class InputProcessor {
#private;
constructor(browsingContextStorage: BrowsingContextStorage);
constructor(browsingContextStorage: BrowsingContextStorage, realmStorage: RealmStorage);
performActions(params: Input.PerformActionsParameters): Promise<EmptyResult>;
releaseActions(params: Input.ReleaseActionsParameters): Promise<EmptyResult>;
setFiles(params: Input.SetFilesParameters): Promise<EmptyResult>;
}

@@ -21,2 +21,3 @@ "use strict";

const protocol_js_1 = require("../../../protocol/protocol.js");
const assert_js_1 = require("../../../utils/assert.js");
const ActionDispatcher_js_1 = require("../input/ActionDispatcher.js");

@@ -26,5 +27,7 @@ const InputStateManager_js_1 = require("../input/InputStateManager.js");

#browsingContextStorage;
#realmStorage;
#inputStateManager = new InputStateManager_js_1.InputStateManager();
constructor(browsingContextStorage) {
constructor(browsingContextStorage, realmStorage) {
this.#browsingContextStorage = browsingContextStorage;
this.#realmStorage = realmStorage;
}

@@ -48,2 +51,75 @@ async performActions(params) {

}
async setFiles(params) {
const realm = this.#realmStorage.findRealm({
browsingContextId: params.context,
});
if (realm === undefined) {
throw new protocol_js_1.NoSuchFrameException(`Could not find browsingContext ${params.context}`);
}
let isFileInput;
try {
const result = await realm.callFunction(String(function getFiles() {
return (this instanceof HTMLInputElement &&
this.type === 'file' &&
!this.disabled);
}), params.element, [], false, "none" /* Script.ResultOwnership.None */, {}, false);
(0, assert_js_1.assert)(result.type === 'success');
(0, assert_js_1.assert)(result.result.type === 'boolean');
isFileInput = result.result.value;
}
catch {
throw new protocol_js_1.NoSuchElementException(`Could not find element ${params.element.sharedId}`);
}
if (!isFileInput) {
throw new protocol_js_1.UnableToSetFileInputException(`Element ${params.element.sharedId} is not a mutable file input.`);
}
// Our goal here is to iterate over the input element files and get their
// file paths.
const paths = [];
for (let i = 0; i < params.files.length; ++i) {
const result = await realm.callFunction(String(function getFiles(index) {
if (!this.files) {
// We use `null` because `item` also returns null.
return null;
}
return this.files.item(index);
}), params.element, [{ type: 'number', value: 0 }], false, "root" /* Script.ResultOwnership.Root */, {}, false);
(0, assert_js_1.assert)(result.type === 'success');
if (result.result.type !== 'object') {
break;
}
const { handle } = result.result;
(0, assert_js_1.assert)(handle !== undefined);
const { path } = await realm.cdpClient.sendCommand('DOM.getFileInfo', {
objectId: handle,
});
paths.push(path);
// Cleanup the handle.
void realm.disown(handle).catch(undefined);
}
paths.sort();
// We create a new array so we preserve the order of the original files.
const sortedFiles = [...params.files].sort();
if (paths.length !== params.files.length ||
sortedFiles.some((path, index) => {
return paths[index] !== path;
})) {
const { objectId } = await realm.deserializeToCdpArg(params.element);
// This cannot throw since this was just used in `callFunction` above.
(0, assert_js_1.assert)(objectId !== undefined);
await realm.cdpClient.sendCommand('DOM.setFileInputFiles', {
files: params.files,
objectId,
});
}
else {
// XXX: We should dispatch a trusted event.
await realm.callFunction(String(function dispatchEvent() {
this.dispatchEvent(new Event('cancel', {
bubbles: true,
}));
}), params.element, [], false, "none" /* Script.ResultOwnership.None */, {}, false);
}
return {};
}
#getActionsByTick(params, inputState) {

@@ -50,0 +126,0 @@ const actionsByTick = [];

@@ -54,9 +54,9 @@ /**

count: number;
"__#87350@#x": number;
"__#87350@#y": number;
"__#87350@#time": number;
"__#88814@#x": number;
"__#88814@#y": number;
"__#88814@#time": number;
compare(context: any): boolean;
};
"__#87350@#DOUBLE_CLICK_TIME_MS": number;
"__#87350@#MAX_DOUBLE_CLICK_RADIUS": number;
"__#88814@#DOUBLE_CLICK_TIME_MS": number;
"__#88814@#MAX_DOUBLE_CLICK_RADIUS": number;
};

@@ -63,0 +63,0 @@ setClickCount(button: number, context: InstanceType<typeof PointerSource.ClickContext>): number;

@@ -548,7 +548,7 @@ "use strict";

case 'Strict':
return 'strict';
return "strict" /* Network.SameSite.Strict */;
case 'Lax':
return 'lax';
return "lax" /* Network.SameSite.Lax */;
default:
return 'none';
return "none" /* Network.SameSite.None */;
}

@@ -555,0 +555,0 @@ }

@@ -49,4 +49,5 @@ /**

callFunction(functionDeclaration: string, thisLocalValue: Script.LocalValue, argumentsLocalValues: Script.LocalValue[], awaitPromise: boolean, resultOwnership: Script.ResultOwnership, serializationOptions: Script.SerializationOptions, userActivation?: boolean): Promise<Script.EvaluateResult>;
deserializeToCdpArg(localValue: Script.LocalValue): Promise<Protocol.Runtime.CallArgument>;
disown(handle: Script.Handle): Promise<void>;
dispose(): void;
}

@@ -265,5 +265,5 @@ "use strict";

// Key is a serialized value.
keyArg = await this.#deserializeToCdpArg(key);
keyArg = await this.deserializeToCdpArg(key);
}
const valueArg = await this.#deserializeToCdpArg(value);
const valueArg = await this.deserializeToCdpArg(value);
keyValueArray.push(keyArg);

@@ -275,3 +275,3 @@ keyValueArray.push(valueArg);

async #flattenValueList(listLocalValue) {
return await Promise.all(listLocalValue.map((localValue) => this.#deserializeToCdpArg(localValue)));
return await Promise.all(listLocalValue.map((localValue) => this.deserializeToCdpArg(localValue)));
}

@@ -312,4 +312,4 @@ async #serializeCdpExceptionDetails(cdpExceptionDetails, lineOffset, resultOwnership) {

const thisAndArgumentsList = [
await this.#deserializeToCdpArg(thisLocalValue),
...(await Promise.all(argumentsLocalValues.map(async (argumentLocalValue) => await this.#deserializeToCdpArg(argumentLocalValue)))),
await this.deserializeToCdpArg(thisLocalValue),
...(await Promise.all(argumentsLocalValues.map(async (argumentLocalValue) => await this.deserializeToCdpArg(argumentLocalValue)))),
];

@@ -350,3 +350,3 @@ let cdpCallFunctionResult;

}
async #deserializeToCdpArg(localValue) {
async deserializeToCdpArg(localValue) {
if ('sharedId' in localValue && localValue.sharedId) {

@@ -353,0 +353,0 @@ const parsedSharedId = SharedIdParser_js_1.SharedIdParser.parseSharedId(localValue.sharedId);

@@ -18,3 +18,3 @@ /**

import type { BidiCommandParameterParser } from '../bidiMapper/BidiMapper.js';
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
import type { BrowsingContext, Cdp, Input, Network, Permissions, Script, Session, Storage } from '../protocol/protocol.js';
export declare class BidiParser implements BidiCommandParameterParser {

@@ -36,2 +36,3 @@ parseActivateParams(params: unknown): BrowsingContext.ActivateParameters;

parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
parseSetFilesParams(params: unknown): Input.SetFilesParameters;
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;

@@ -44,2 +45,3 @@ parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;

parseRemoveInterceptParams(params: unknown): Network.RemoveInterceptParameters;
parseSetPermissionsParams(params: unknown): Permissions.SetPermissionParameters;
parseAddPreloadScriptParams(params: unknown): Script.AddPreloadScriptParameters;

@@ -52,2 +54,5 @@ parseCallFunctionParams(params: unknown): Script.CallFunctionParameters;

parseSubscribeParams(params: unknown): Session.SubscriptionRequest;
parseDeleteCookiesParams(params: unknown): Storage.DeleteCookiesParameters;
parseGetCookiesParams(params: unknown): Storage.GetCookiesParameters;
parseSetCookieParams(params: unknown): Storage.SetCookieParameters;
}

@@ -82,2 +82,5 @@ "use strict";

}
parseSetFilesParams(params) {
return Parser.Input.parseSetFilesParams(params);
}
// keep-sorted end

@@ -108,2 +111,8 @@ // Network domain

// keep-sorted end
// Permissions domain
// keep-sorted start block=yes
parseSetPermissionsParams(params) {
return Parser.Permissions.parseSetPermissionsParams(params);
}
// keep-sorted end
// Script domain

@@ -135,4 +144,16 @@ // keep-sorted start block=yes

}
// keep-sorted end
// Storage domain
// keep-sorted start block=yes
parseDeleteCookiesParams(params) {
return Parser.Storage.parseDeleteCookiesParams(params);
}
parseGetCookiesParams(params) {
return Parser.Storage.parseGetCookiesParams(params);
}
parseSetCookieParams(params) {
return Parser.Storage.parseSetCookieParams(params);
}
}
exports.BidiParser = BidiParser;
//# sourceMappingURL=BidiParser.js.map

@@ -72,39 +72,3 @@ /**

};
function parseContinueResponseParameters(params: unknown): {
request: string;
cookies?: {
value: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
};
name: string;
domain?: string | undefined;
httpOnly?: boolean | undefined;
expiry?: string | undefined;
maxAge?: number | undefined;
path?: string | undefined;
sameSite?: "strict" | "none" | "lax" | undefined;
secure?: boolean | undefined;
}[] | undefined;
credentials?: {
type: "password";
password: string;
username: string;
} | undefined;
headers?: {
value: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
};
name: string;
}[] | undefined;
reasonPhrase?: string | undefined;
statusCode?: number | undefined;
};
function parseContinueResponseParameters(params: unknown): Protocol.Network.ContinueResponseParameters;
function parseContinueWithAuthParameters(params: unknown): {

@@ -125,41 +89,3 @@ request: string;

};
function parseProvideResponseParameters(params: unknown): {
request: string;
body?: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
} | undefined;
cookies?: {
value: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
};
name: string;
domain?: string | undefined;
httpOnly?: boolean | undefined;
expiry?: string | undefined;
maxAge?: number | undefined;
path?: string | undefined;
sameSite?: "strict" | "none" | "lax" | undefined;
secure?: boolean | undefined;
}[] | undefined;
headers?: {
value: {
type: "string";
value: string;
} | {
type: "base64";
value: string;
};
name: string;
}[] | undefined;
reasonPhrase?: string | undefined;
statusCode?: number | undefined;
};
function parseProvideResponseParameters(params: unknown): Protocol.Network.ProvideResponseParameters;
function parseRemoveInterceptParameters(params: unknown): {

@@ -203,3 +129,9 @@ intercept: string;

function parseReleaseActionsParams(params: unknown): Protocol.Input.ReleaseActionsParameters;
function parseSetFilesParams(params: unknown): Protocol.Input.SetFilesParameters;
}
export declare namespace Storage {
function parseGetCookiesParams(params: unknown): Protocol.Storage.GetCookiesParameters;
function parseSetCookieParams(params: unknown): Protocol.Storage.SetCookieParameters;
function parseDeleteCookiesParams(params: unknown): Protocol.Storage.DeleteCookiesParameters;
}
export declare namespace Cdp {

@@ -209,1 +141,4 @@ function parseSendCommandRequest(params: unknown): Protocol.Cdp.SendCommandParameters;

}
export declare namespace Permissions {
function parseSetPermissionsParams(params: unknown): Protocol.Permissions.SetPermissionParameters;
}

@@ -42,3 +42,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.Cdp = exports.Input = exports.Session = exports.BrowsingContext = exports.Script = exports.Network = exports.parseObject = void 0;
exports.Permissions = exports.Cdp = exports.Storage = exports.Input = exports.Session = exports.BrowsingContext = exports.Script = exports.Network = exports.parseObject = void 0;
/**

@@ -50,2 +50,3 @@ * @fileoverview Provides parsing and validator for WebDriver BiDi protocol.

const protocol_js_1 = require("../protocol/protocol.js");
const WebDriverBidiPermissions = __importStar(require("./generated/webdriver-bidi-permissions.js"));
const WebDriverBidi = __importStar(require("./generated/webdriver-bidi.js"));

@@ -76,2 +77,7 @@ function parseObject(obj, schema) {

function parseContinueResponseParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Network.ContinueResponseParametersSchema);

@@ -89,2 +95,7 @@ }

function parseProvideResponseParameters(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Network.ProvideResponseParametersSchema);

@@ -192,3 +203,37 @@ }

Input.parseReleaseActionsParams = parseReleaseActionsParams;
function parseSetFilesParams(params) {
return parseObject(params, WebDriverBidi.Input.SetFilesParametersSchema);
}
Input.parseSetFilesParams = parseSetFilesParams;
})(Input || (exports.Input = Input = {}));
var Storage;
(function (Storage) {
function parseGetCookiesParams(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Storage.GetCookiesParametersSchema);
}
Storage.parseGetCookiesParams = parseGetCookiesParams;
function parseSetCookieParams(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Storage.SetCookieParametersSchema);
}
Storage.parseSetCookieParams = parseSetCookieParams;
function parseDeleteCookiesParams(params) {
// Work around of `cddlconv` https://github.com/google/cddlconv/issues/19.
// The generated schema `SameSiteSchema` in `src/protocol-parser/webdriver-bidi.ts` is
// of type `"none" | "strict" | "lax"` which is not assignable to generated enum
// `SameSite` in `src/protocol/webdriver-bidi.ts`.
// TODO: remove cast after https://github.com/google/cddlconv/issues/19 is fixed.
return parseObject(params, WebDriverBidi.Storage.DeleteCookiesParametersSchema);
}
Storage.parseDeleteCookiesParams = parseDeleteCookiesParams;
})(Storage || (exports.Storage = Storage = {}));
var Cdp;

@@ -216,2 +261,9 @@ (function (Cdp) {

})(Cdp || (exports.Cdp = Cdp = {}));
var Permissions;
(function (Permissions) {
function parseSetPermissionsParams(params) {
return parseObject(params, WebDriverBidiPermissions.Permissions.SetPermissionParametersSchema);
}
Permissions.parseSetPermissionsParams = parseSetPermissionsParams;
})(Permissions || (exports.Permissions = Permissions = {}));
//# sourceMappingURL=protocol-parser.js.map

@@ -18,2 +18,3 @@ /**

import type * as Cdp from './cdp.js';
import type * as WebDriverBidiPermissions from './generated/webdriver-bidi-permissions.js';
import type * as WebDriverBidi from './generated/webdriver-bidi.js';

@@ -67,3 +68,5 @@ export type EventNames = BiDiModule | BrowsingContext.EventNames | Cdp.EventNames | Log.EventNames | Network.EventNames | Script.EventNames;

}
export type Command = (WebDriverBidi.Command | Cdp.Command) & {
export type Command = (WebDriverBidi.Command | Cdp.Command | ({
id: WebDriverBidi.JsUint;
} & WebDriverBidiPermissions.PermissionsCommand)) & {
channel?: WebDriverBidi.Script.Channel;

@@ -70,0 +73,0 @@ };

@@ -80,1 +80,13 @@ /**

}
export declare class NoSuchStoragePartitionException extends Exception {
constructor(message: string, stacktrace?: string);
}
export declare class UnableToSetCookieException extends Exception {
constructor(message: string, stacktrace?: string);
}
export declare class UnableToSetFileInputException extends Exception {
constructor(message: string, stacktrace?: string);
}
export declare class UnderspecifiedStoragePartitionException extends Exception {
constructor(message: string, stacktrace?: string);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnsupportedOperationException = exports.UnableToCloseBrowserException = exports.UnableToCaptureScreenException = exports.UnknownErrorException = exports.UnknownCommandException = exports.SessionNotCreatedException = exports.NoSuchScriptException = exports.NoSuchRequestException = exports.NoSuchNodeException = exports.NoSuchInterceptException = exports.NoSuchHistoryEntryException = exports.NoSuchHandleException = exports.NoSuchFrameException = exports.NoSuchElementException = exports.NoSuchAlertException = exports.MoveTargetOutOfBoundsException = exports.InvalidSessionIdException = exports.InvalidArgumentException = exports.Exception = void 0;
exports.UnderspecifiedStoragePartitionException = exports.UnableToSetFileInputException = exports.UnableToSetCookieException = exports.NoSuchStoragePartitionException = exports.UnsupportedOperationException = exports.UnableToCloseBrowserException = exports.UnableToCaptureScreenException = exports.UnknownErrorException = exports.UnknownCommandException = exports.SessionNotCreatedException = exports.NoSuchScriptException = exports.NoSuchRequestException = exports.NoSuchNodeException = exports.NoSuchInterceptException = exports.NoSuchHistoryEntryException = exports.NoSuchHandleException = exports.NoSuchFrameException = exports.NoSuchElementException = exports.NoSuchAlertException = exports.MoveTargetOutOfBoundsException = exports.InvalidSessionIdException = exports.InvalidArgumentException = exports.Exception = void 0;
class Exception {

@@ -132,2 +132,26 @@ error;

exports.UnsupportedOperationException = UnsupportedOperationException;
class NoSuchStoragePartitionException extends Exception {
constructor(message, stacktrace) {
super("no such storage partition" /* ErrorCode.NoSuchStoragePartition */, message, stacktrace);
}
}
exports.NoSuchStoragePartitionException = NoSuchStoragePartitionException;
class UnableToSetCookieException extends Exception {
constructor(message, stacktrace) {
super("unable to set cookie" /* ErrorCode.UnableToSetCookie */, message, stacktrace);
}
}
exports.UnableToSetCookieException = UnableToSetCookieException;
class UnableToSetFileInputException extends Exception {
constructor(message, stacktrace) {
super("unable to set file input" /* ErrorCode.UnableToSetFileInput */, message, stacktrace);
}
}
exports.UnableToSetFileInputException = UnableToSetFileInputException;
class UnderspecifiedStoragePartitionException extends Exception {
constructor(message, stacktrace) {
super("underspecified storage partition" /* ErrorCode.UnderspecifiedStoragePartition */, message, stacktrace);
}
}
exports.UnderspecifiedStoragePartitionException = UnderspecifiedStoragePartitionException;
//# sourceMappingURL=ErrorResponse.js.map

@@ -33,4 +33,4 @@ /**

export type EventData = BrowsingContextEvent | LogEvent | NetworkEvent | ScriptEvent;
export type CommandData = BrowserCommand | BrowsingContextCommand | InputCommand | NetworkCommand | ScriptCommand | SessionCommand;
export type ResultData = BrowsingContextResult | EmptyResult | NetworkResult | ScriptResult | SessionResult;
export type CommandData = BrowserCommand | BrowsingContextCommand | InputCommand | NetworkCommand | ScriptCommand | SessionCommand | StorageCommand;
export type ResultData = BrowsingContextResult | EmptyResult | NetworkResult | ScriptResult | SessionResult | StorageResult;
export type EmptyParams = Extensible;

@@ -70,5 +70,9 @@ export type Message = CommandResponse | ErrorResponse | Event;

NoSuchScript = "no such script",
NoSuchStoragePartition = "no such storage partition",
SessionNotCreated = "session not created",
UnableToCaptureScreen = "unable to capture screen",
UnableToCloseBrowser = "unable to close browser",
UnableToSetCookie = "unable to set cookie",
UnableToSetFileInput = "unable to set file input",
UnderspecifiedStoragePartition = "underspecified storage partition",
UnknownCommand = "unknown command",

@@ -697,2 +701,9 @@ UnknownError = "unknown error",

export declare namespace Network {
const enum SameSite {
Strict = "strict",
Lax = "lax",
None = "none"
}
}
export declare namespace Network {
type Cookie = {

@@ -706,5 +717,5 @@ name: string;

secure: boolean;
sameSite: 'strict' | 'lax' | 'none';
sameSite: Network.SameSite;
expiry?: JsUint;
};
} & Extensible;
}

@@ -797,3 +808,3 @@ export declare namespace Network {

path?: string;
sameSite?: 'strict' | 'lax' | 'none';
sameSite?: Network.SameSite;
secure?: boolean;

@@ -1589,2 +1600,103 @@ };

}
export type StorageCommand = Storage.DeleteCookies | Storage.GetCookies | Storage.SetCookie;
export type StorageResult = Storage.DeleteCookiesResult | Storage.GetCookiesResult | Storage.SetCookieResult;
export declare namespace Storage {
type PartitionKey = {
userContext?: string;
sourceOrigin?: string;
} & Extensible;
}
export declare namespace Storage {
type GetCookies = {
method: 'storage.getCookies';
params: Storage.GetCookiesParameters;
};
}
export declare namespace Storage {
type CookieFilter = {
name?: string;
value?: Network.BytesValue;
domain?: string;
path?: string;
size?: JsUint;
httpOnly?: boolean;
secure?: boolean;
sameSite?: Network.SameSite;
expiry?: JsUint;
} & Extensible;
}
export declare namespace Storage {
type BrowsingContextPartitionDescriptor = {
type: 'context';
context: BrowsingContext.BrowsingContext;
};
}
export declare namespace Storage {
type StorageKeyPartitionDescriptor = {
type: 'storageKey';
userContext?: string;
sourceOrigin?: string;
} & Extensible;
}
export declare namespace Storage {
type PartitionDescriptor = Storage.BrowsingContextPartitionDescriptor | Storage.StorageKeyPartitionDescriptor;
}
export declare namespace Storage {
type GetCookiesParameters = {
filter?: Storage.CookieFilter;
partition?: Storage.PartitionDescriptor;
};
}
export declare namespace Storage {
type GetCookiesResult = {
cookies: [...Network.Cookie[]];
partitionKey: Storage.PartitionKey;
};
}
export declare namespace Storage {
type SetCookie = {
method: 'storage.setCookie';
params: Storage.SetCookieParameters;
};
}
export declare namespace Storage {
type PartialCookie = {
name: string;
value: Network.BytesValue;
domain: string;
path?: string;
httpOnly?: boolean;
secure?: boolean;
sameSite?: Network.SameSite;
expiry?: JsUint;
} & Extensible;
}
export declare namespace Storage {
type SetCookieParameters = {
cookie: Storage.PartialCookie;
partition?: Storage.PartitionDescriptor;
};
}
export declare namespace Storage {
type SetCookieResult = {
partitionKey: Storage.PartitionKey;
};
}
export declare namespace Storage {
type DeleteCookies = {
method: 'storage.deleteCookies';
params: Storage.DeleteCookiesParameters;
};
}
export declare namespace Storage {
type DeleteCookiesParameters = {
filter?: Storage.CookieFilter;
partition?: Storage.PartitionDescriptor;
};
}
export declare namespace Storage {
type DeleteCookiesResult = {
partitionKey: Storage.PartitionKey;
};
}
export type LogEvent = Log.EntryAdded;

@@ -1634,3 +1746,3 @@ export declare namespace Log {

}
export type InputCommand = Input.PerformActions | Input.ReleaseActions;
export type InputCommand = Input.PerformActions | Input.ReleaseActions | Input.SetFiles;
export declare namespace Input {

@@ -1818,1 +1930,14 @@ type ElementOrigin = {

}
export declare namespace Input {
type SetFiles = {
method: 'input.setFiles';
params: Input.SetFilesParameters;
};
}
export declare namespace Input {
type SetFilesParameters = {
context: BrowsingContext.BrowsingContext;
element: Script.SharedReference;
files: [...string[]];
};
}

@@ -21,1 +21,2 @@ /**

export * from './ErrorResponse.js';
export * from './generated/webdriver-bidi-permissions.js';

@@ -50,2 +50,3 @@ "use strict";

__exportStar(require("./ErrorResponse.js"), exports);
__exportStar(require("./generated/webdriver-bidi-permissions.js"), exports);
//# sourceMappingURL=protocol.js.map
{
"name": "chromium-bidi",
"version": "0.5.3",
"version": "0.5.4",
"description": "An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.",
"scripts": {
"bidi-types": "wireit",
"bidi-types": "node tools/generate-bidi-types.mjs",
"build": "wireit",

@@ -12,8 +12,8 @@ "clean": "rimraf lib .eslintcache .wireit",

"e2e": "npm run e2e-headless --",
"eslint": "eslint --ext js --ext mjs --ext ts --fix .",
"flake8": "flake8 examples/ tests/",
"format": "npm run pre-commit --",
"format:eslint": "eslint --ext js --ext mjs --ext ts --fix .",
"format:prettier": "prettier --write .",
"pre-commit": "pre-commit run --hook-stage manual --all-files",
"prepare": "wireit",
"prettier": "prettier --write .",
"rollup": "wireit",

@@ -36,9 +36,2 @@ "server": "npm run server-headless --",

"wireit": {
"bidi-types": {
"command": "tools/generate-bidi-types.mjs",
"output": [
"src/protocol/generated/webdriver-bidi.ts",
"src/protocol-parser/generated/webdriver-bidi.ts"
]
},
"build": {

@@ -193,2 +186,3 @@ "dependencies": [

"@types/ws": "8.5.10",
"@types/yargs": "17.0.32",
"@typescript-eslint/eslint-plugin": "6.17.0",

@@ -200,3 +194,3 @@ "@typescript-eslint/parser": "6.17.0",

"debug": "4.3.4",
"devtools-protocol": "0.0.1239539",
"devtools-protocol": "0.0.1245094",
"eslint": "8.56.0",

@@ -203,0 +197,0 @@ "eslint-config-prettier": "9.1.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc