A big commit with a bunch of node modules so I could run puppeteer for Walmart. Added some todos and Headway's templates.
This commit is contained in:
8
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiMapper.d.ts
generated
vendored
8
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiMapper.d.ts
generated
vendored
@ -20,9 +20,9 @@
|
||||
* XXX: Add ESlint rule for this (https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-restricted-paths.md)
|
||||
*/
|
||||
export { BidiServer, MapperOptions } from './BidiServer.js';
|
||||
export type { ICdpConnection, ICdpConnection as CdpConnection, } from '../cdp/CdpConnection.js';
|
||||
export type { ICdpClient, ICdpClient as CdpClient } from '../cdp/CdpClient.js';
|
||||
export type { CdpConnection } from '../cdp/CdpConnection.js';
|
||||
export type { CdpClient } from '../cdp/CdpClient.js';
|
||||
export { EventEmitter } from '../utils/EventEmitter.js';
|
||||
export type { IBidiTransport as BidiTransport } from './BidiTransport.js';
|
||||
export type { BidiTransport } from './BidiTransport.js';
|
||||
export { OutgoingMessage } from './OutgoingMessage.js';
|
||||
export type { IBidiParser } from './BidiParser.js';
|
||||
export type { BidiCommandParameterParser } from './BidiParser.js';
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiMapper.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"BidiMapper.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiMapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;;GAIG;AACH,iDAA0D;AAAlD,2GAAA,UAAU,OAAA;AAMlB,4DAAsD;AAA9C,+GAAA,YAAY,OAAA;AAEpB,2DAAqD;AAA7C,qHAAA,eAAe,OAAA"}
|
||||
{"version":3,"file":"BidiMapper.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiMapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;;;GAIG;AACH,iDAA0D;AAAlD,2GAAA,UAAU,OAAA;AAGlB,4DAAsD;AAA9C,+GAAA,YAAY,OAAA;AAEpB,2DAAqD;AAA7C,qHAAA,eAAe,OAAA"}
|
||||
11
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiNoOpParser.d.ts
generated
vendored
11
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiNoOpParser.d.ts
generated
vendored
@ -14,9 +14,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
|
||||
import type { IBidiParser } from './BidiParser.js';
|
||||
export declare class BidiNoOpParser implements IBidiParser {
|
||||
import type { BrowsingContext, Cdp, Input, Network, Script, Session, Storage, Permissions } from '../protocol/protocol.js';
|
||||
import type { BidiCommandParameterParser } from './BidiParser.js';
|
||||
export declare class BidiNoOpParser implements BidiCommandParameterParser {
|
||||
parseActivateParams(params: unknown): BrowsingContext.ActivateParameters;
|
||||
parseCaptureScreenshotParams(params: unknown): BrowsingContext.CaptureScreenshotParameters;
|
||||
parseCloseParams(params: unknown): BrowsingContext.CloseParameters;
|
||||
@ -38,6 +38,7 @@ export declare class BidiNoOpParser implements IBidiParser {
|
||||
parseRemovePreloadScriptParams(params: unknown): Script.RemovePreloadScriptParameters;
|
||||
parsePerformActionsParams(params: unknown): Input.PerformActionsParameters;
|
||||
parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
|
||||
parseSetFilesParams(params: unknown): Input.SetFilesParameters;
|
||||
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;
|
||||
parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;
|
||||
parseContinueResponseParams(params: unknown): Network.ContinueResponseParameters;
|
||||
@ -45,5 +46,9 @@ export declare class BidiNoOpParser implements IBidiParser {
|
||||
parseFailRequestParams(params: unknown): Network.FailRequestParameters;
|
||||
parseProvideResponseParams(params: unknown): Network.ProvideResponseParameters;
|
||||
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;
|
||||
}
|
||||
|
||||
21
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiNoOpParser.js
generated
vendored
21
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiNoOpParser.js
generated
vendored
@ -92,6 +92,9 @@ class BidiNoOpParser {
|
||||
parseReleaseActionsParams(params) {
|
||||
return params;
|
||||
}
|
||||
parseSetFilesParams(params) {
|
||||
return params;
|
||||
}
|
||||
// keep-sorted end
|
||||
// Network domain
|
||||
// keep-sorted start block=yes
|
||||
@ -117,11 +120,29 @@ class BidiNoOpParser {
|
||||
return params;
|
||||
}
|
||||
// keep-sorted end
|
||||
// Permissions domain
|
||||
// keep-sorted start block=yes
|
||||
parseSetPermissionsParams(params) {
|
||||
return params;
|
||||
}
|
||||
// keep-sorted end
|
||||
// Session domain
|
||||
// keep-sorted start block=yes
|
||||
parseSubscribeParams(params) {
|
||||
return params;
|
||||
}
|
||||
// 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
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiNoOpParser.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiNoOpParser.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"BidiNoOpParser.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiNoOpParser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAaH,MAAa,cAAc;IACzB,0BAA0B;IAC1B,8BAA8B;IAC9B,mBAAmB,CAAC,MAAe;QACjC,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,4BAA4B,CAC1B,MAAe;QAEf,OAAO,MAAqD,CAAC;IAC/D,CAAC;IACD,gBAAgB,CAAC,MAAe;QAC9B,OAAO,MAAyC,CAAC;IACnD,CAAC;IACD,iBAAiB,CAAC,MAAe;QAC/B,OAAO,MAA0C,CAAC;IACpD,CAAC;IACD,kBAAkB,CAAC,MAAe;QAChC,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,2BAA2B,CACzB,MAAe;QAEf,OAAO,MAAoD,CAAC;IAC9D,CAAC;IACD,mBAAmB,CAAC,MAAe;QACjC,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,gBAAgB,CAAC,MAAe;QAC9B,OAAO,MAAyC,CAAC;IACnD,CAAC;IACD,iBAAiB,CAAC,MAAe;QAC/B,OAAO,MAA0C,CAAC;IACpD,CAAC;IACD,sBAAsB,CACpB,MAAe;QAEf,OAAO,MAA+C,CAAC;IACzD,CAAC;IACD,0BAA0B,CACxB,MAAe;QAEf,OAAO,MAAmD,CAAC;IAC7D,CAAC;IACD,kBAAkB;IAElB,aAAa;IACb,8BAA8B;IAC9B,qBAAqB,CAAC,MAAe;QACnC,OAAO,MAAkC,CAAC;IAC5C,CAAC;IACD,sBAAsB,CAAC,MAAe;QACpC,OAAO,MAAmC,CAAC;IAC7C,CAAC;IACD,kBAAkB;IAElB,gBAAgB;IAChB,8BAA8B;IAC9B,2BAA2B,CACzB,MAAe;QAEf,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,uBAAuB,CAAC,MAAe;QACrC,OAAO,MAAuC,CAAC;IACjD,CAAC;IACD,iBAAiB,CAAC,MAAe;QAC/B,OAAO,MAAiC,CAAC;IAC3C,CAAC;IACD,mBAAmB,CAAC,MAAe;QACjC,OAAO,MAAmC,CAAC;IAC7C,CAAC;IACD,oBAAoB,CAAC,MAAe;QAClC,OAAO,MAAoC,CAAC;IAC9C,CAAC;IACD,8BAA8B,CAC5B,MAAe;QAEf,OAAO,MAA8C,CAAC;IACxD,CAAC;IACD,kBAAkB;IAElB,eAAe;IACf,8BAA8B;IAC9B,yBAAyB,CAAC,MAAe;QACvC,OAAO,MAAwC,CAAC;IAClD,CAAC;IACD,yBAAyB,CAAC,MAAe;QACvC,OAAO,MAAwC,CAAC;IAClD,CAAC;IACD,kBAAkB;IAElB,iBAAiB;IACjB,8BAA8B;IAC9B,uBAAuB,CAAC,MAAe;QACrC,OAAO,MAAwC,CAAC;IAClD,CAAC;IACD,0BAA0B,CACxB,MAAe;QAEf,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,2BAA2B,CACzB,MAAe;QAEf,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,2BAA2B,CACzB,MAAe;QAEf,OAAO,MAA4C,CAAC;IACtD,CAAC;IACD,sBAAsB,CAAC,MAAe;QACpC,OAAO,MAAuC,CAAC;IACjD,CAAC;IACD,0BAA0B,CACxB,MAAe;QAEf,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,0BAA0B,CACxB,MAAe;QAEf,OAAO,MAA2C,CAAC;IACrD,CAAC;IACD,kBAAkB;IAElB,iBAAiB;IACjB,8BAA8B;IAC9B,oBAAoB,CAAC,MAAe;QAClC,OAAO,MAAqC,CAAC;IAC/C,CAAC;CAEF;AArID,wCAqIC"}
|
||||
{"version":3,"file":"BidiNoOpParser.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiNoOpParser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAeH,MAA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AO,MAAqC,CAAC;IAC/C,CAAC;CAEF;AA9JD,wCA8JC"}
|
||||
9
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiParser.d.ts
generated
vendored
9
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiParser.d.ts
generated
vendored
@ -14,8 +14,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BrowsingContext, Cdp, Input, Network, Script, Session } from '../protocol/protocol.js';
|
||||
export interface IBidiParser {
|
||||
import type { BrowsingContext, Cdp, Input, Network, Permissions, Script, Session, Storage } from '../protocol/protocol.js';
|
||||
export interface BidiCommandParameterParser {
|
||||
parseActivateParams(params: unknown): BrowsingContext.ActivateParameters;
|
||||
parseCaptureScreenshotParams(params: unknown): BrowsingContext.CaptureScreenshotParameters;
|
||||
parseCloseParams(params: unknown): BrowsingContext.CloseParameters;
|
||||
@ -31,6 +31,8 @@ export interface IBidiParser {
|
||||
parseSendCommandParams(params: unknown): Cdp.SendCommandParameters;
|
||||
parsePerformActionsParams(params: unknown): Input.PerformActionsParameters;
|
||||
parseReleaseActionsParams(params: unknown): Input.ReleaseActionsParameters;
|
||||
parseSetFilesParams(params: unknown): Input.SetFilesParameters;
|
||||
parseSetPermissionsParams(params: unknown): Permissions.SetPermissionParameters;
|
||||
parseAddInterceptParams(params: unknown): Network.AddInterceptParameters;
|
||||
parseContinueRequestParams(params: unknown): Network.ContinueRequestParameters;
|
||||
parseContinueResponseParams(params: unknown): Network.ContinueResponseParameters;
|
||||
@ -45,4 +47,7 @@ export interface IBidiParser {
|
||||
parseGetRealmsParams(params: unknown): Script.GetRealmsParameters;
|
||||
parseRemovePreloadScriptParams(params: unknown): Script.RemovePreloadScriptParameters;
|
||||
parseSubscribeParams(params: unknown): Session.SubscriptionRequest;
|
||||
parseDeleteCookiesParams(params: unknown): Storage.DeleteCookiesParameters;
|
||||
parseGetCookiesParams(params: unknown): Storage.GetCookiesParameters;
|
||||
parseSetCookieParams(params: unknown): Storage.SetCookieParameters;
|
||||
}
|
||||
|
||||
11
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiServer.d.ts
generated
vendored
11
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiServer.d.ts
generated
vendored
@ -14,20 +14,21 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { ICdpClient } from '../cdp/CdpClient';
|
||||
import type { ICdpConnection } from '../cdp/CdpConnection.js';
|
||||
import type { CdpClient } from '../cdp/CdpClient';
|
||||
import type { CdpConnection } from '../cdp/CdpConnection.js';
|
||||
import type { ChromiumBidi } from '../protocol/protocol.js';
|
||||
import { EventEmitter } from '../utils/EventEmitter.js';
|
||||
import { type LoggerFn } from '../utils/log.js';
|
||||
import type { Result } from '../utils/result.js';
|
||||
import type { IBidiParser } from './BidiParser.js';
|
||||
import type { IBidiTransport } from './BidiTransport.js';
|
||||
import type { BidiCommandParameterParser } from './BidiParser.js';
|
||||
import type { BidiTransport } from './BidiTransport.js';
|
||||
import type { OutgoingMessage } from './OutgoingMessage.js';
|
||||
type BidiServerEvent = {
|
||||
message: ChromiumBidi.Command;
|
||||
};
|
||||
export type MapperOptions = {
|
||||
acceptInsecureCerts: boolean;
|
||||
sharedIdWithFrame?: boolean;
|
||||
};
|
||||
export declare class BidiServer extends EventEmitter<BidiServerEvent> {
|
||||
#private;
|
||||
@ -35,7 +36,7 @@ export declare class BidiServer extends EventEmitter<BidiServerEvent> {
|
||||
/**
|
||||
* Creates and starts BiDi Mapper instance.
|
||||
*/
|
||||
static createAndStart(bidiTransport: IBidiTransport, cdpConnection: ICdpConnection, browserCdpClient: ICdpClient, selfTargetId: string, options?: MapperOptions, parser?: IBidiParser, logger?: LoggerFn): Promise<BidiServer>;
|
||||
static createAndStart(bidiTransport: BidiTransport, cdpConnection: CdpConnection, browserCdpClient: CdpClient, selfTargetId: string, options?: MapperOptions, parser?: BidiCommandParameterParser, logger?: LoggerFn): Promise<BidiServer>;
|
||||
/**
|
||||
* Sends BiDi message.
|
||||
*/
|
||||
|
||||
24
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiServer.js
generated
vendored
24
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiServer.js
generated
vendored
@ -22,8 +22,8 @@ const log_js_1 = require("../utils/log.js");
|
||||
const ProcessingQueue_js_1 = require("../utils/ProcessingQueue.js");
|
||||
const CommandProcessor_js_1 = require("./CommandProcessor.js");
|
||||
const BrowsingContextStorage_js_1 = require("./domains/context/BrowsingContextStorage.js");
|
||||
const EventManager_js_1 = require("./domains/events/EventManager.js");
|
||||
const RealmStorage_js_1 = require("./domains/script/RealmStorage.js");
|
||||
const EventManager_js_1 = require("./domains/session/EventManager.js");
|
||||
class BidiServer extends EventEmitter_js_1.EventEmitter {
|
||||
#messageQueue;
|
||||
#transport;
|
||||
@ -43,14 +43,14 @@ class BidiServer extends EventEmitter_js_1.EventEmitter {
|
||||
}
|
||||
await this.#transport.sendMessage(message);
|
||||
};
|
||||
constructor(bidiTransport, cdpConnection, browserCdpClient, selfTargetId, options, parser, logger) {
|
||||
constructor(bidiTransport, cdpConnection, browserCdpClient, selfTargetId, defaultUserContextId, options, parser, logger) {
|
||||
super();
|
||||
this.#logger = logger;
|
||||
this.#messageQueue = new ProcessingQueue_js_1.ProcessingQueue(this.#processOutgoingMessage, this.#logger);
|
||||
this.#transport = bidiTransport;
|
||||
this.#transport.setOnMessage(this.#handleIncomingMessage);
|
||||
this.#eventManager = new EventManager_js_1.EventManager(this.#browsingContextStorage);
|
||||
this.#commandProcessor = new CommandProcessor_js_1.CommandProcessor(cdpConnection, browserCdpClient, this.#eventManager, selfTargetId, this.#browsingContextStorage, new RealmStorage_js_1.RealmStorage(), options?.acceptInsecureCerts ?? false, parser, this.#logger);
|
||||
this.#commandProcessor = new CommandProcessor_js_1.CommandProcessor(cdpConnection, browserCdpClient, this.#eventManager, selfTargetId, defaultUserContextId, this.#browsingContextStorage, new RealmStorage_js_1.RealmStorage(), options?.acceptInsecureCerts ?? false, options?.sharedIdWithFrame ?? false, parser, this.#logger);
|
||||
this.#eventManager.on("event" /* EventManagerEvents.Event */, ({ message, event }) => {
|
||||
this.emitOutgoingMessage(message, event);
|
||||
});
|
||||
@ -62,7 +62,23 @@ class BidiServer extends EventEmitter_js_1.EventEmitter {
|
||||
* Creates and starts BiDi Mapper instance.
|
||||
*/
|
||||
static async createAndStart(bidiTransport, cdpConnection, browserCdpClient, selfTargetId, options, parser, logger) {
|
||||
const server = new BidiServer(bidiTransport, cdpConnection, browserCdpClient, selfTargetId, options, parser, logger);
|
||||
// The default context is not exposed in Target.getBrowserContexts but can
|
||||
// be observed via Target.getTargets. To determine the default browser
|
||||
// context, we check which one is mentioned in Target.getTargets and not in
|
||||
// Target.getBrowserContexts.
|
||||
const [{ browserContextIds }, { targetInfos }] = await Promise.all([
|
||||
browserCdpClient.sendCommand('Target.getBrowserContexts'),
|
||||
browserCdpClient.sendCommand('Target.getTargets'),
|
||||
]);
|
||||
let defaultUserContextId = 'default';
|
||||
for (const info of targetInfos) {
|
||||
if (info.browserContextId &&
|
||||
!browserContextIds.includes(info.browserContextId)) {
|
||||
defaultUserContextId = info.browserContextId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const server = new BidiServer(bidiTransport, cdpConnection, browserCdpClient, selfTargetId, defaultUserContextId, options, parser, logger);
|
||||
// Needed to get events about new targets.
|
||||
await browserCdpClient.sendCommand('Target.setDiscoverTargets', {
|
||||
discover: true,
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiServer.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiServer.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"BidiServer.js","sourceRoot":"","sources":["../../../src/bidiMapper/BidiServer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAKH,8DA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AAW,CAAC,sBAAsB,EAAE;YACzD,UAAU,EAAE,IAAI;YAChB,sBAAsB,EAAE,IAAI;YAC5B,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,MAAM,MAAM,CAAC,uBAAuB,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,mBAAmB,CACjB,YAA8C,EAC9C,KAAa;QAEb,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK;QACH,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,uBAAuB;QAC3B,MAAM,OAAO,CAAC,GAAG,CACf,IAAI,CAAC,uBAAuB;aACzB,mBAAmB,EAAE;aACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CACnC,CAAC;IACJ,CAAC;CACF;AAjJD,gCAiJC"}
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiTransport.d.ts
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/BidiTransport.d.ts
generated
vendored
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { ChromiumBidi } from '../protocol/protocol.js';
|
||||
export interface IBidiTransport {
|
||||
export interface BidiTransport {
|
||||
setOnMessage: (handler: (message: ChromiumBidi.Command) => Promise<void> | void) => void;
|
||||
sendMessage: (message: ChromiumBidi.Message) => Promise<void> | void;
|
||||
close(): void;
|
||||
|
||||
12
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/CommandProcessor.d.ts
generated
vendored
12
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/CommandProcessor.d.ts
generated
vendored
@ -14,16 +14,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { ICdpClient } from '../cdp/CdpClient';
|
||||
import type { ICdpConnection } from '../cdp/CdpConnection.js';
|
||||
import { type ChromiumBidi } from '../protocol/protocol.js';
|
||||
import type { CdpClient } from '../cdp/CdpClient';
|
||||
import type { CdpConnection } from '../cdp/CdpConnection.js';
|
||||
import { type ChromiumBidi, type Browser } from '../protocol/protocol.js';
|
||||
import { EventEmitter } from '../utils/EventEmitter.js';
|
||||
import { type LoggerFn } from '../utils/log.js';
|
||||
import type { Result } from '../utils/result.js';
|
||||
import type { IBidiParser } from './BidiParser.js';
|
||||
import type { BidiCommandParameterParser } from './BidiParser.js';
|
||||
import type { BrowsingContextStorage } from './domains/context/BrowsingContextStorage.js';
|
||||
import type { EventManager } from './domains/events/EventManager.js';
|
||||
import type { RealmStorage } from './domains/script/RealmStorage.js';
|
||||
import type { EventManager } from './domains/session/EventManager.js';
|
||||
import { OutgoingMessage } from './OutgoingMessage.js';
|
||||
export declare const enum CommandProcessorEvents {
|
||||
Response = "response"
|
||||
@ -36,7 +36,7 @@ type CommandProcessorEventsMap = {
|
||||
};
|
||||
export declare class CommandProcessor extends EventEmitter<CommandProcessorEventsMap> {
|
||||
#private;
|
||||
constructor(cdpConnection: ICdpConnection, browserCdpClient: ICdpClient, eventManager: EventManager, selfTargetId: string, browsingContextStorage: BrowsingContextStorage, realmStorage: RealmStorage, acceptInsecureCerts: boolean, parser?: IBidiParser, logger?: LoggerFn);
|
||||
constructor(cdpConnection: CdpConnection, browserCdpClient: CdpClient, eventManager: EventManager, selfTargetId: string, defaultUserContextId: Browser.UserContext, browsingContextStorage: BrowsingContextStorage, realmStorage: RealmStorage, acceptInsecureCerts: boolean, sharedIdWithFrame: boolean, parser?: BidiCommandParameterParser, logger?: LoggerFn);
|
||||
processCommand(command: ChromiumBidi.Command): Promise<void>;
|
||||
}
|
||||
export {};
|
||||
|
||||
36
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/CommandProcessor.js
generated
vendored
36
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/CommandProcessor.js
generated
vendored
@ -27,9 +27,11 @@ const BrowsingContextProcessor_js_1 = require("./domains/context/BrowsingContext
|
||||
const InputProcessor_js_1 = require("./domains/input/InputProcessor.js");
|
||||
const NetworkProcessor_js_1 = require("./domains/network/NetworkProcessor.js");
|
||||
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");
|
||||
class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
// keep-sorted start
|
||||
@ -38,12 +40,14 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
#cdpProcessor;
|
||||
#inputProcessor;
|
||||
#networkProcessor;
|
||||
#permissionsProcessor;
|
||||
#scriptProcessor;
|
||||
#sessionProcessor;
|
||||
#storageProcessor;
|
||||
// keep-sorted end
|
||||
#parser;
|
||||
#logger;
|
||||
constructor(cdpConnection, browserCdpClient, eventManager, selfTargetId, browsingContextStorage, realmStorage, acceptInsecureCerts, parser = new BidiNoOpParser_js_1.BidiNoOpParser(), logger) {
|
||||
constructor(cdpConnection, browserCdpClient, eventManager, selfTargetId, defaultUserContextId, browsingContextStorage, realmStorage, acceptInsecureCerts, sharedIdWithFrame, parser = new BidiNoOpParser_js_1.BidiNoOpParser(), logger) {
|
||||
super();
|
||||
this.#parser = parser;
|
||||
this.#logger = logger;
|
||||
@ -51,12 +55,14 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
const preloadScriptStorage = new PreloadScriptStorage_js_1.PreloadScriptStorage();
|
||||
// keep-sorted start block=yes
|
||||
this.#browserProcessor = new BrowserProcessor_js_1.BrowserProcessor(browserCdpClient);
|
||||
this.#browsingContextProcessor = new BrowsingContextProcessor_js_1.BrowsingContextProcessor(cdpConnection, browserCdpClient, selfTargetId, eventManager, browsingContextStorage, realmStorage, networkStorage, preloadScriptStorage, acceptInsecureCerts, logger);
|
||||
this.#browsingContextProcessor = new BrowsingContextProcessor_js_1.BrowsingContextProcessor(cdpConnection, browserCdpClient, selfTargetId, eventManager, browsingContextStorage, realmStorage, networkStorage, preloadScriptStorage, acceptInsecureCerts, sharedIdWithFrame, defaultUserContextId, logger);
|
||||
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
|
||||
}
|
||||
async #processCommand(command) {
|
||||
@ -69,6 +75,12 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
// keep-sorted start block=yes
|
||||
case 'browser.close':
|
||||
return this.#browserProcessor.close();
|
||||
case 'browser.createUserContext':
|
||||
return await this.#browserProcessor.createUserContext();
|
||||
case 'browser.getUserContexts':
|
||||
return await this.#browserProcessor.getUserContexts();
|
||||
case 'browser.removeUserContext':
|
||||
return await this.#browserProcessor.removeUserContext(command.params.userContext);
|
||||
// keep-sorted end
|
||||
// Browsing Context domain
|
||||
// keep-sorted start block=yes
|
||||
@ -110,6 +122,8 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
return await this.#inputProcessor.performActions(this.#parser.parsePerformActionsParams(command.params));
|
||||
case 'input.releaseActions':
|
||||
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
|
||||
// Network domain
|
||||
// keep-sorted start block=yes
|
||||
@ -128,6 +142,11 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
case 'network.removeIntercept':
|
||||
return await this.#networkProcessor.removeIntercept(this.#parser.parseRemoveInterceptParams(command.params));
|
||||
// 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
|
||||
// keep-sorted start block=yes
|
||||
case 'script.addPreloadScript':
|
||||
@ -152,8 +171,17 @@ class CommandProcessor extends EventEmitter_js_1.EventEmitter {
|
||||
case 'session.unsubscribe':
|
||||
return this.#sessionProcessor.unsubscribe(this.#parser.parseSubscribeParams(command.params), command.channel);
|
||||
// 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
|
||||
// command is added.
|
||||
throw new protocol_js_1.UnknownCommandException(`Unknown command '${command.method}'.`);
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/CommandProcessor.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/CommandProcessor.js.map
generated
vendored
File diff suppressed because one or more lines are too long
7
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/OutgoingMessage.d.ts
generated
vendored
7
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/OutgoingMessage.d.ts
generated
vendored
@ -14,13 +14,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BidiPlusChannel } from '../protocol/chromium-bidi.js';
|
||||
import type { ChromiumBidi } from '../protocol/protocol.js';
|
||||
import type { Result } from '../utils/result.js';
|
||||
export declare class OutgoingMessage {
|
||||
#private;
|
||||
private constructor();
|
||||
static createFromPromise(messagePromise: Promise<Result<ChromiumBidi.Message>>, channel: string | null): Promise<Result<OutgoingMessage>>;
|
||||
static createResolved(message: ChromiumBidi.Message, channel?: string | null): Promise<Result<OutgoingMessage>>;
|
||||
static createFromPromise(messagePromise: Promise<Result<ChromiumBidi.Message>>, channel: BidiPlusChannel): Promise<Result<OutgoingMessage>>;
|
||||
static createResolved(message: ChromiumBidi.Message, channel?: BidiPlusChannel): Promise<Result<OutgoingMessage>>;
|
||||
get message(): ChromiumBidi.Message;
|
||||
get channel(): string | null;
|
||||
get channel(): BidiPlusChannel;
|
||||
}
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/OutgoingMessage.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/OutgoingMessage.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"OutgoingMessage.js","sourceRoot":"","sources":["../../../src/bidiMapper/OutgoingMessage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;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C;IAC1B,CAAC;IAED,MAAM,CAAC,iBAAiB,CACtB,cAAqD,EACrD,OAAwB;QAExB,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YACrC,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC/B,OAAO;oBACL,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,IAAI,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC;iBACnD,CAAC;YACJ,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,cAAc,CACnB,OAA6B,EAC7B,OAAyB;QAEzB,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,IAAI,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AA5CD,0CA4CC"}
|
||||
@ -14,10 +14,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { EmptyResult } from '../../../protocol/protocol.js';
|
||||
import type { ICdpClient } from '../../BidiMapper.js';
|
||||
import { type EmptyResult, type Browser } from '../../../protocol/protocol.js';
|
||||
import type { CdpClient } from '../../BidiMapper.js';
|
||||
export declare class BrowserProcessor {
|
||||
#private;
|
||||
constructor(browserCdpClient: ICdpClient);
|
||||
constructor(browserCdpClient: CdpClient);
|
||||
close(): EmptyResult;
|
||||
createUserContext(): Promise<Browser.CreateUserContextResult>;
|
||||
removeUserContext(userContext: Browser.UserContext): Promise<EmptyResult>;
|
||||
getUserContexts(): Promise<Browser.GetUserContextsResult>;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BrowserProcessor = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
class BrowserProcessor {
|
||||
#browserCdpClient;
|
||||
constructor(browserCdpClient) {
|
||||
@ -28,6 +29,45 @@ class BrowserProcessor {
|
||||
setTimeout(() => this.#browserCdpClient.sendCommand('Browser.close'), 0);
|
||||
return {};
|
||||
}
|
||||
async createUserContext() {
|
||||
const context = await this.#browserCdpClient.sendCommand('Target.createBrowserContext');
|
||||
return {
|
||||
userContext: context.browserContextId,
|
||||
};
|
||||
}
|
||||
async removeUserContext(userContext) {
|
||||
if (userContext === 'default') {
|
||||
throw new protocol_js_1.InvalidArgumentException('`default` user context cannot be removed');
|
||||
}
|
||||
try {
|
||||
await this.#browserCdpClient.sendCommand('Target.disposeBrowserContext', {
|
||||
browserContextId: userContext,
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
// https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/target_handler.cc;l=1424;drc=c686e8f4fd379312469fe018f5c390e9c8f20d0d
|
||||
if (err.message.startsWith('Failed to find context with id')) {
|
||||
throw new protocol_js_1.NoSuchUserContextException(err.message);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
async getUserContexts() {
|
||||
const result = await this.#browserCdpClient.sendCommand('Target.getBrowserContexts');
|
||||
return {
|
||||
userContexts: [
|
||||
{
|
||||
userContext: 'default',
|
||||
},
|
||||
...result.browserContextIds.map((id) => {
|
||||
return {
|
||||
userContext: id,
|
||||
};
|
||||
}),
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.BrowserProcessor = BrowserProcessor;
|
||||
//# sourceMappingURL=BrowserProcessor.js.map
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"BrowserProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/browser/BrowserProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAKH,MAAa,gBAAgB;IAClB,iBAAiB,CAAa;IAEvC,YAAY,gBAA4B;QACtC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,KAAK;QACH,sDAAsD;QACtD,6DAA6D;QAC7D,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzE,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAdD,4CAcC"}
|
||||
{"version":3,"file":"BrowserProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/browser/BrowserProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,+DAKuC;AAGvC,MAAa,gBAAgB;IAClB,iBAAiB,CAAY;IAEtC,YAAY,gBAA2B;QACrC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,KAAK;QACH,sDAAsD;QACtD,6DAA6D;QAC7D,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACtD,6BAA6B,CAC9B,CAAC;QACF,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,gBAAgB;SACtC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,iBAAiB,CACrB,WAAgC;QAEhC,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,sCAAwB,CAChC,0CAA0C,CAC3C,CAAC;QACJ,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,8BAA8B,EAAE;gBACvE,gBAAgB,EAAE,WAAW;aAC9B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,mKAAmK;YACnK,IAAK,GAAa,CAAC,OAAO,CAAC,UAAU,CAAC,gCAAgC,CAAC,EAAE,CAAC;gBACxE,MAAM,IAAI,wCAA0B,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;YAC/D,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CACrD,2BAA2B,CAC5B,CAAC;QACF,OAAO;YACL,YAAY,EAAE;gBACZ;oBACE,WAAW,EAAE,SAAS;iBACvB;gBACD,GAAG,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;oBACrC,OAAO;wBACL,WAAW,EAAE,EAAE;qBAChB,CAAC;gBACJ,CAAC,CAAC;aACH;SACF,CAAC;IACJ,CAAC;CACF;AA/DD,4CA+DC"}
|
||||
4
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.d.ts
generated
vendored
4
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/cdp/CdpProcessor.d.ts
generated
vendored
@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { Cdp } from '../../../protocol/protocol.js';
|
||||
import type { ICdpClient, ICdpConnection } from '../../BidiMapper.js';
|
||||
import type { CdpClient, CdpConnection } from '../../BidiMapper.js';
|
||||
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
|
||||
export declare class CdpProcessor {
|
||||
#private;
|
||||
constructor(browsingContextStorage: BrowsingContextStorage, cdpConnection: ICdpConnection, browserCdpClient: ICdpClient);
|
||||
constructor(browsingContextStorage: BrowsingContextStorage, cdpConnection: CdpConnection, browserCdpClient: CdpClient);
|
||||
getSession(params: Cdp.GetSessionParameters): Cdp.GetSessionResult;
|
||||
sendCommand(params: Cdp.SendCommandParameters): Promise<Cdp.SendCommandResult>;
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"CdpProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/cdp/CdpProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAMH,MAAa,YAAY;IACd,uBAAuB,CAAyB;IAChD,cAAc,CAAiB;IAC/B,iBAAiB,CAAa;IAEvC,YACE,sBAA8C,EAC9C,aAA6B,EAC7B,gBAA4B;QAE5B,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,MAAgC;QACzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,MAAM,SAAS,GACb,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;QAC1E,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,WAAW,CACf,MAAiC;QAEjC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO;YAC3B,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;YAClD,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACtE,OAAO;YACL,MAAM;YACN,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;CACF;AArCD,oCAqCC"}
|
||||
{"version":3,"file":"CdpProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/cdp/CdpProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAMH,MAAa,YAAY;IACd,uBAAuB,CAAyB;IAChD,cAAc,CAAgB;IAC9B,iBAAiB,CAAY;IAEtC,YACE,sBAA8C,EAC9C,aAA4B,EAC5B,gBAA2B;QAE3B,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;QACtD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,UAAU,CAAC,MAAgC;QACzC,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,MAAM,SAAS,GACb,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;QAC1E,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,WAAW,CACf,MAAiC;QAEjC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO;YAC3B,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;YAClD,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACtE,OAAO;YACL,MAAM;YACN,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;CACF;AArCD,oCAqCC"}
|
||||
@ -17,16 +17,17 @@
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import { BrowsingContext } from '../../../protocol/protocol.js';
|
||||
import { type LoggerFn } from '../../../utils/log.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import { Realm } from '../script/Realm.js';
|
||||
import type { Realm } from '../script/Realm.js';
|
||||
import type { RealmStorage } from '../script/RealmStorage.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import type { BrowsingContextStorage } from './BrowsingContextStorage.js';
|
||||
import type { CdpTarget } from './CdpTarget.js';
|
||||
export declare class BrowsingContextImpl {
|
||||
#private;
|
||||
static readonly LOGGER_PREFIX: "debug:browsingContext";
|
||||
readonly userContext: string;
|
||||
private constructor();
|
||||
static create(cdpTarget: CdpTarget, realmStorage: RealmStorage, id: BrowsingContext.BrowsingContext, parentId: BrowsingContext.BrowsingContext | null, eventManager: EventManager, browsingContextStorage: BrowsingContextStorage, logger?: LoggerFn): BrowsingContextImpl;
|
||||
static create(cdpTarget: CdpTarget, realmStorage: RealmStorage, id: BrowsingContext.BrowsingContext, parentId: BrowsingContext.BrowsingContext | null, userContext: string, eventManager: EventManager, browsingContextStorage: BrowsingContextStorage, sharedIdWithFrame: boolean, logger?: LoggerFn): BrowsingContextImpl;
|
||||
static getTimestamp(): number;
|
||||
/**
|
||||
* @see https://html.spec.whatwg.org/multipage/document-sequences.html#navigable
|
||||
|
||||
@ -22,11 +22,12 @@ const assert_js_1 = require("../../../utils/assert.js");
|
||||
const Deferred_js_1 = require("../../../utils/Deferred.js");
|
||||
const log_js_1 = require("../../../utils/log.js");
|
||||
const unitConversions_js_1 = require("../../../utils/unitConversions.js");
|
||||
const Realm_js_1 = require("../script/Realm.js");
|
||||
const WindowRealm_js_1 = require("../script/WindowRealm.js");
|
||||
class BrowsingContextImpl {
|
||||
static LOGGER_PREFIX = `${log_js_1.LogType.debug}:browsingContext`;
|
||||
/** The ID of this browsing context. */
|
||||
#id;
|
||||
userContext;
|
||||
/**
|
||||
* The ID of the parent browsing context.
|
||||
* If null, this is a top-level context.
|
||||
@ -35,15 +36,12 @@ class BrowsingContextImpl {
|
||||
/** Direct children browsing contexts. */
|
||||
#children = new Set();
|
||||
#browsingContextStorage;
|
||||
#deferreds = {
|
||||
Page: {
|
||||
navigatedWithinDocument: new Deferred_js_1.Deferred(),
|
||||
lifecycleEvent: {
|
||||
DOMContentLoaded: new Deferred_js_1.Deferred(),
|
||||
load: new Deferred_js_1.Deferred(),
|
||||
},
|
||||
frameStartedLoading: new Deferred_js_1.Deferred(),
|
||||
},
|
||||
#lifecycle = {
|
||||
DOMContentLoaded: new Deferred_js_1.Deferred(),
|
||||
load: new Deferred_js_1.Deferred(),
|
||||
};
|
||||
#navigation = {
|
||||
withinDocument: new Deferred_js_1.Deferred(),
|
||||
};
|
||||
#url = 'about:blank';
|
||||
#eventManager;
|
||||
@ -51,18 +49,21 @@ class BrowsingContextImpl {
|
||||
#loaderId;
|
||||
#cdpTarget;
|
||||
#maybeDefaultRealm;
|
||||
#sharedIdWithFrame;
|
||||
#logger;
|
||||
constructor(cdpTarget, realmStorage, id, parentId, eventManager, browsingContextStorage, logger) {
|
||||
constructor(cdpTarget, realmStorage, id, parentId, userContext, eventManager, browsingContextStorage, sharedIdWithFrame, logger) {
|
||||
this.#cdpTarget = cdpTarget;
|
||||
this.#realmStorage = realmStorage;
|
||||
this.#id = id;
|
||||
this.#parentId = parentId;
|
||||
this.userContext = userContext;
|
||||
this.#eventManager = eventManager;
|
||||
this.#browsingContextStorage = browsingContextStorage;
|
||||
this.#sharedIdWithFrame = sharedIdWithFrame;
|
||||
this.#logger = logger;
|
||||
}
|
||||
static create(cdpTarget, realmStorage, id, parentId, eventManager, browsingContextStorage, logger) {
|
||||
const context = new BrowsingContextImpl(cdpTarget, realmStorage, id, parentId, eventManager, browsingContextStorage, logger);
|
||||
static create(cdpTarget, realmStorage, id, parentId, userContext, eventManager, browsingContextStorage, sharedIdWithFrame, logger) {
|
||||
const context = new BrowsingContextImpl(cdpTarget, realmStorage, id, parentId, userContext, eventManager, browsingContextStorage, sharedIdWithFrame, logger);
|
||||
context.#initListeners();
|
||||
browsingContextStorage.addContext(context);
|
||||
if (!context.isTopLevelContext()) {
|
||||
@ -98,7 +99,7 @@ class BrowsingContextImpl {
|
||||
this.parent.#children.delete(this.id);
|
||||
}
|
||||
// Fail all ongoing navigations.
|
||||
this.#failDeferredsIfNotFinished();
|
||||
this.#failLifecycleIfNotFinished();
|
||||
this.#eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.BrowsingContext.EventNames.ContextDestroyed,
|
||||
@ -168,10 +169,10 @@ class BrowsingContextImpl {
|
||||
return this.#url;
|
||||
}
|
||||
async lifecycleLoaded() {
|
||||
await this.#deferreds.Page.lifecycleEvent.load;
|
||||
await this.#lifecycle.load;
|
||||
}
|
||||
async targetUnblockedOrThrow() {
|
||||
const result = await this.#cdpTarget.targetUnblocked;
|
||||
const result = await this.#cdpTarget.unblocked;
|
||||
if (result.kind === 'error') {
|
||||
throw result.error;
|
||||
}
|
||||
@ -207,6 +208,7 @@ class BrowsingContextImpl {
|
||||
return {
|
||||
context: this.#id,
|
||||
url: this.url,
|
||||
userContext: this.userContext,
|
||||
children: maxDepth > 0
|
||||
? this.directChildren.map((c) => c.serializeToBidiValue(maxDepth - 1, false))
|
||||
: null,
|
||||
@ -233,7 +235,7 @@ class BrowsingContextImpl {
|
||||
}
|
||||
const timestamp = BrowsingContextImpl.getTimestamp();
|
||||
this.#url = params.url;
|
||||
this.#deferreds.Page.navigatedWithinDocument.resolve(params);
|
||||
this.#navigation.withinDocument.resolve(params);
|
||||
this.#eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.BrowsingContext.EventNames.FragmentNavigated,
|
||||
@ -289,7 +291,7 @@ class BrowsingContextImpl {
|
||||
url: this.#url,
|
||||
},
|
||||
}, this.id);
|
||||
this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.resolve(params);
|
||||
this.#lifecycle.DOMContentLoaded.resolve(params);
|
||||
break;
|
||||
case 'load':
|
||||
this.#eventManager.registerEvent({
|
||||
@ -302,7 +304,7 @@ class BrowsingContextImpl {
|
||||
url: this.#url,
|
||||
},
|
||||
}, this.id);
|
||||
this.#deferreds.Page.lifecycleEvent.load.resolve(params);
|
||||
this.#lifecycle.load.resolve(params);
|
||||
break;
|
||||
}
|
||||
});
|
||||
@ -327,11 +329,7 @@ class BrowsingContextImpl {
|
||||
default:
|
||||
return;
|
||||
}
|
||||
const realm = new Realm_js_1.Realm(this.#realmStorage, this.#browsingContextStorage, uniqueId, this.id, id, origin,
|
||||
// XXX: differentiate types.
|
||||
'window',
|
||||
// Sandbox name for isolated world.
|
||||
sandbox, this.#cdpTarget.cdpClient, this.#eventManager, this.#logger);
|
||||
const realm = new WindowRealm_js_1.WindowRealm(this.id, this.#browsingContextStorage, this.#cdpTarget.cdpClient, this.#eventManager, id, this.#logger, origin, uniqueId, this.#realmStorage, sandbox, this.#sharedIdWithFrame);
|
||||
if (auxData.isDefault) {
|
||||
this.#maybeDefaultRealm = realm;
|
||||
// Initialize ChannelProxy listeners for all the channels of all the
|
||||
@ -382,8 +380,8 @@ class BrowsingContextImpl {
|
||||
#documentChanged(loaderId) {
|
||||
// Same document navigation.
|
||||
if (loaderId === undefined || this.#loaderId === loaderId) {
|
||||
if (this.#deferreds.Page.navigatedWithinDocument.isFinished) {
|
||||
this.#deferreds.Page.navigatedWithinDocument =
|
||||
if (this.#navigation.withinDocument.isFinished) {
|
||||
this.#navigation.withinDocument =
|
||||
new Deferred_js_1.Deferred();
|
||||
}
|
||||
else {
|
||||
@ -391,31 +389,30 @@ class BrowsingContextImpl {
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.#resetDeferredsIfFinished();
|
||||
this.#resetLifecycleIfFinished();
|
||||
this.#loaderId = loaderId;
|
||||
}
|
||||
#resetDeferredsIfFinished() {
|
||||
if (this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.isFinished) {
|
||||
this.#deferreds.Page.lifecycleEvent.DOMContentLoaded =
|
||||
#resetLifecycleIfFinished() {
|
||||
if (this.#lifecycle.DOMContentLoaded.isFinished) {
|
||||
this.#lifecycle.DOMContentLoaded =
|
||||
new Deferred_js_1.Deferred();
|
||||
}
|
||||
else {
|
||||
this.#logger?.(BrowsingContextImpl.LOGGER_PREFIX, 'Document changed (DOMContentLoaded)');
|
||||
}
|
||||
if (this.#deferreds.Page.lifecycleEvent.load.isFinished) {
|
||||
this.#deferreds.Page.lifecycleEvent.load =
|
||||
new Deferred_js_1.Deferred();
|
||||
if (this.#lifecycle.load.isFinished) {
|
||||
this.#lifecycle.load = new Deferred_js_1.Deferred();
|
||||
}
|
||||
else {
|
||||
this.#logger?.(BrowsingContextImpl.LOGGER_PREFIX, 'Document changed (load)');
|
||||
}
|
||||
}
|
||||
#failDeferredsIfNotFinished() {
|
||||
if (!this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.isFinished) {
|
||||
this.#deferreds.Page.lifecycleEvent.DOMContentLoaded.reject(new protocol_js_1.UnknownErrorException('navigation canceled'));
|
||||
#failLifecycleIfNotFinished() {
|
||||
if (!this.#lifecycle.DOMContentLoaded.isFinished) {
|
||||
this.#lifecycle.DOMContentLoaded.reject(new protocol_js_1.UnknownErrorException('navigation canceled'));
|
||||
}
|
||||
if (!this.#deferreds.Page.lifecycleEvent.load.isFinished) {
|
||||
this.#deferreds.Page.lifecycleEvent.load.reject(new protocol_js_1.UnknownErrorException('navigation canceled'));
|
||||
if (!this.#lifecycle.load.isFinished) {
|
||||
this.#lifecycle.load.reject(new protocol_js_1.UnknownErrorException('navigation canceled'));
|
||||
}
|
||||
}
|
||||
async navigate(url, wait) {
|
||||
@ -441,19 +438,19 @@ class BrowsingContextImpl {
|
||||
case "interactive" /* BrowsingContext.ReadinessState.Interactive */:
|
||||
// No `loaderId` means same-document navigation.
|
||||
if (cdpNavigateResult.loaderId === undefined) {
|
||||
await this.#deferreds.Page.navigatedWithinDocument;
|
||||
await this.#navigation.withinDocument;
|
||||
}
|
||||
else {
|
||||
await this.#deferreds.Page.lifecycleEvent.DOMContentLoaded;
|
||||
await this.#lifecycle.DOMContentLoaded;
|
||||
}
|
||||
break;
|
||||
case "complete" /* BrowsingContext.ReadinessState.Complete */:
|
||||
// No `loaderId` means same-document navigation.
|
||||
if (cdpNavigateResult.loaderId === undefined) {
|
||||
await this.#deferreds.Page.navigatedWithinDocument;
|
||||
await this.#navigation.withinDocument;
|
||||
}
|
||||
else {
|
||||
await this.lifecycleLoaded();
|
||||
await this.#lifecycle.load;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -468,15 +465,15 @@ class BrowsingContextImpl {
|
||||
await this.#cdpTarget.cdpClient.sendCommand('Page.reload', {
|
||||
ignoreCache,
|
||||
});
|
||||
this.#resetDeferredsIfFinished();
|
||||
this.#resetLifecycleIfFinished();
|
||||
switch (wait) {
|
||||
case "none" /* BrowsingContext.ReadinessState.None */:
|
||||
break;
|
||||
case "interactive" /* BrowsingContext.ReadinessState.Interactive */:
|
||||
await this.#deferreds.Page.lifecycleEvent.DOMContentLoaded;
|
||||
await this.#lifecycle.DOMContentLoaded;
|
||||
break;
|
||||
case "complete" /* BrowsingContext.ReadinessState.Complete */:
|
||||
await this.lifecycleLoaded();
|
||||
await this.#lifecycle.load;
|
||||
break;
|
||||
}
|
||||
return {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,15 +1,15 @@
|
||||
import type { ICdpClient } from '../../../cdp/CdpClient.js';
|
||||
import type { ICdpConnection } from '../../../cdp/CdpConnection.js';
|
||||
import { BrowsingContext, type EmptyResult } from '../../../protocol/protocol.js';
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import type { CdpConnection } from '../../../cdp/CdpConnection.js';
|
||||
import { BrowsingContext, type EmptyResult, type Browser } from '../../../protocol/protocol.js';
|
||||
import { type LoggerFn } from '../../../utils/log.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { NetworkStorage } from '../network/NetworkStorage.js';
|
||||
import type { PreloadScriptStorage } from '../script/PreloadScriptStorage.js';
|
||||
import type { RealmStorage } from '../script/RealmStorage.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import type { BrowsingContextStorage } from './BrowsingContextStorage.js';
|
||||
export declare class BrowsingContextProcessor {
|
||||
#private;
|
||||
constructor(cdpConnection: ICdpConnection, browserCdpClient: ICdpClient, selfTargetId: string, eventManager: EventManager, browsingContextStorage: BrowsingContextStorage, realmStorage: RealmStorage, networkStorage: NetworkStorage, preloadScriptStorage: PreloadScriptStorage, acceptInsecureCerts: boolean, logger?: LoggerFn);
|
||||
constructor(cdpConnection: CdpConnection, browserCdpClient: CdpClient, selfTargetId: string, eventManager: EventManager, browsingContextStorage: BrowsingContextStorage, realmStorage: RealmStorage, networkStorage: NetworkStorage, preloadScriptStorage: PreloadScriptStorage, acceptInsecureCerts: boolean, sharedIdWithFrame: boolean, defaultUserContextId: Browser.UserContext, logger?: LoggerFn);
|
||||
getTree(params: BrowsingContext.GetTreeParameters): BrowsingContext.GetTreeResult;
|
||||
create(params: BrowsingContext.CreateParameters): Promise<BrowsingContext.CreateResult>;
|
||||
navigate(params: BrowsingContext.NavigateParameters): Promise<BrowsingContext.NavigateResult>;
|
||||
|
||||
@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BrowsingContextProcessor = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const log_js_1 = require("../../../utils/log.js");
|
||||
const Realm_js_1 = require("../script/Realm.js");
|
||||
const DedicatedWorkerRealm_js_1 = require("../script/DedicatedWorkerRealm.js");
|
||||
const BrowsingContextImpl_js_1 = require("./BrowsingContextImpl.js");
|
||||
const CdpTarget_js_1 = require("./CdpTarget.js");
|
||||
class BrowsingContextProcessor {
|
||||
@ -14,10 +14,12 @@ class BrowsingContextProcessor {
|
||||
#browsingContextStorage;
|
||||
#networkStorage;
|
||||
#acceptInsecureCerts;
|
||||
#sharedIdWithFrame;
|
||||
#preloadScriptStorage;
|
||||
#realmStorage;
|
||||
#defaultUserContextId;
|
||||
#logger;
|
||||
constructor(cdpConnection, browserCdpClient, selfTargetId, eventManager, browsingContextStorage, realmStorage, networkStorage, preloadScriptStorage, acceptInsecureCerts, logger) {
|
||||
constructor(cdpConnection, browserCdpClient, selfTargetId, eventManager, browsingContextStorage, realmStorage, networkStorage, preloadScriptStorage, acceptInsecureCerts, sharedIdWithFrame, defaultUserContextId, logger) {
|
||||
this.#acceptInsecureCerts = acceptInsecureCerts;
|
||||
this.#cdpConnection = cdpConnection;
|
||||
this.#browserCdpClient = browserCdpClient;
|
||||
@ -27,6 +29,8 @@ class BrowsingContextProcessor {
|
||||
this.#preloadScriptStorage = preloadScriptStorage;
|
||||
this.#networkStorage = networkStorage;
|
||||
this.#realmStorage = realmStorage;
|
||||
this.#sharedIdWithFrame = sharedIdWithFrame;
|
||||
this.#defaultUserContextId = defaultUserContextId;
|
||||
this.#logger = logger;
|
||||
this.#setEventListeners(browserCdpClient);
|
||||
}
|
||||
@ -40,27 +44,51 @@ class BrowsingContextProcessor {
|
||||
}
|
||||
async create(params) {
|
||||
let referenceContext;
|
||||
let userContext = params.userContext ?? 'default';
|
||||
if (params.referenceContext !== undefined) {
|
||||
referenceContext = this.#browsingContextStorage.getContext(params.referenceContext);
|
||||
if (!referenceContext.isTopLevelContext()) {
|
||||
throw new protocol_js_1.InvalidArgumentException(`referenceContext should be a top-level context`);
|
||||
}
|
||||
userContext = referenceContext.userContext;
|
||||
}
|
||||
let result;
|
||||
let newWindow = false;
|
||||
switch (params.type) {
|
||||
case "tab" /* BrowsingContext.CreateType.Tab */:
|
||||
result = await this.#browserCdpClient.sendCommand('Target.createTarget', {
|
||||
url: 'about:blank',
|
||||
newWindow: false,
|
||||
});
|
||||
newWindow = false;
|
||||
break;
|
||||
case "window" /* BrowsingContext.CreateType.Window */:
|
||||
result = await this.#browserCdpClient.sendCommand('Target.createTarget', {
|
||||
url: 'about:blank',
|
||||
newWindow: true,
|
||||
});
|
||||
newWindow = true;
|
||||
break;
|
||||
}
|
||||
if (userContext !== 'default') {
|
||||
const existingContexts = this.#browsingContextStorage
|
||||
.getAllContexts()
|
||||
.filter((context) => context.userContext === userContext);
|
||||
if (!existingContexts.length) {
|
||||
// If there are no contexts in the given user context, we need to set
|
||||
// newWindow to true as newWindow=false will be rejected.
|
||||
newWindow = true;
|
||||
}
|
||||
}
|
||||
let result;
|
||||
try {
|
||||
result = await this.#browserCdpClient.sendCommand('Target.createTarget', {
|
||||
url: 'about:blank',
|
||||
newWindow,
|
||||
browserContextId: userContext === 'default' ? undefined : userContext,
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
if (
|
||||
// See https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/devtools/protocol/target_handler.cc;l=90;drc=e80392ac11e48a691f4309964cab83a3a59e01c8
|
||||
err.message.startsWith('Failed to find browser context with id') ||
|
||||
// See https://source.chromium.org/chromium/chromium/src/+/main:headless/lib/browser/protocol/target_handler.cc;l=49;drc=e80392ac11e48a691f4309964cab83a3a59e01c8
|
||||
err.message === 'browserContextId') {
|
||||
throw new protocol_js_1.NoSuchUserContextException(`The context ${userContext} was not found`);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
// Wait for the new tab to be loaded to avoid race conditions in the
|
||||
// `browsingContext` events, when the `browsingContext.domContentLoaded` and
|
||||
// `browsingContext.load` events from the initial `about:blank` navigation
|
||||
@ -178,7 +206,7 @@ class BrowsingContextProcessor {
|
||||
#handleFrameAttachedEvent(params) {
|
||||
const parentBrowsingContext = this.#browsingContextStorage.findContext(params.parentFrameId);
|
||||
if (parentBrowsingContext !== undefined) {
|
||||
BrowsingContextImpl_js_1.BrowsingContextImpl.create(parentBrowsingContext.cdpTarget, this.#realmStorage, params.frameId, params.parentFrameId, this.#eventManager, this.#browsingContextStorage, this.#logger);
|
||||
BrowsingContextImpl_js_1.BrowsingContextImpl.create(parentBrowsingContext.cdpTarget, this.#realmStorage, params.frameId, params.parentFrameId, parentBrowsingContext.userContext, this.#eventManager, this.#browsingContextStorage, this.#sharedIdWithFrame, this.#logger);
|
||||
}
|
||||
}
|
||||
#handleFrameDetachedEvent(params) {
|
||||
@ -198,8 +226,7 @@ class BrowsingContextProcessor {
|
||||
if (targetInfo.targetId === this.#selfTargetId) {
|
||||
break;
|
||||
}
|
||||
this.#setEventListeners(targetCdpClient);
|
||||
const cdpTarget = CdpTarget_js_1.CdpTarget.create(targetInfo.targetId, targetCdpClient, this.#browserCdpClient, sessionId, this.#realmStorage, this.#eventManager, this.#preloadScriptStorage, this.#networkStorage, this.#acceptInsecureCerts);
|
||||
const cdpTarget = this.#createCdpTarget(targetCdpClient, targetInfo);
|
||||
const maybeContext = this.#browsingContextStorage.findContext(targetInfo.targetId);
|
||||
if (maybeContext) {
|
||||
// OOPiF.
|
||||
@ -207,20 +234,26 @@ class BrowsingContextProcessor {
|
||||
}
|
||||
else {
|
||||
// New context.
|
||||
BrowsingContextImpl_js_1.BrowsingContextImpl.create(cdpTarget, this.#realmStorage, targetInfo.targetId, null, this.#eventManager, this.#browsingContextStorage, this.#logger);
|
||||
BrowsingContextImpl_js_1.BrowsingContextImpl.create(cdpTarget, this.#realmStorage, targetInfo.targetId, null, targetInfo.browserContextId &&
|
||||
targetInfo.browserContextId !== this.#defaultUserContextId
|
||||
? targetInfo.browserContextId
|
||||
: 'default', this.#eventManager, this.#browsingContextStorage, this.#sharedIdWithFrame, this.#logger);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 'worker': {
|
||||
this.#setEventListeners(targetCdpClient);
|
||||
const cdpTarget = CdpTarget_js_1.CdpTarget.create(targetInfo.targetId, targetCdpClient, this.#browserCdpClient, sessionId, this.#realmStorage, this.#eventManager, this.#preloadScriptStorage, this.#networkStorage, this.#acceptInsecureCerts);
|
||||
const browsingContext = parentSessionCdpClient.sessionId &&
|
||||
this.#browsingContextStorage.findContextBySession(parentSessionCdpClient.sessionId);
|
||||
// If there is no browsing context, this worker is already terminated.
|
||||
if (!browsingContext) {
|
||||
break;
|
||||
}
|
||||
this.#handleWorkerTarget(cdpTarget, browsingContext.id);
|
||||
const cdpTarget = this.#createCdpTarget(targetCdpClient, targetInfo);
|
||||
this.#handleWorkerTarget(cdpTarget, this.#realmStorage.getRealm({
|
||||
browsingContextId: browsingContext.id,
|
||||
type: 'window',
|
||||
sandbox: undefined,
|
||||
}));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -231,12 +264,16 @@ class BrowsingContextProcessor {
|
||||
.then(() => parentSessionCdpClient.sendCommand('Target.detachFromTarget', params))
|
||||
.catch((error) => this.#logger?.(log_js_1.LogType.debugError, error));
|
||||
}
|
||||
#createCdpTarget(targetCdpClient, targetInfo) {
|
||||
this.#setEventListeners(targetCdpClient);
|
||||
return CdpTarget_js_1.CdpTarget.create(targetInfo.targetId, targetCdpClient, this.#browserCdpClient, this.#realmStorage, this.#eventManager, this.#preloadScriptStorage, this.#networkStorage, this.#acceptInsecureCerts, this.#logger);
|
||||
}
|
||||
#workers = new Map();
|
||||
#handleWorkerTarget(cdpTarget, browsingContextId) {
|
||||
#handleWorkerTarget(cdpTarget, ownerRealm) {
|
||||
cdpTarget.cdpClient.on('Runtime.executionContextCreated', (params) => {
|
||||
const { uniqueId, id, origin } = params.context;
|
||||
const realm = new Realm_js_1.Realm(this.#realmStorage, this.#browsingContextStorage, uniqueId, browsingContextId, id, (0, BrowsingContextImpl_js_1.serializeOrigin)(origin), 'dedicated-worker', undefined, cdpTarget.cdpClient, this.#eventManager, this.#logger);
|
||||
this.#workers.set(cdpTarget.cdpSessionId, realm);
|
||||
const workerRealm = new DedicatedWorkerRealm_js_1.DedicatedWorkerRealm(cdpTarget.cdpClient, this.#eventManager, id, this.#logger, (0, BrowsingContextImpl_js_1.serializeOrigin)(origin), ownerRealm, uniqueId, this.#realmStorage);
|
||||
this.#workers.set(cdpTarget.cdpSessionId, workerRealm);
|
||||
});
|
||||
}
|
||||
#handleDetachedFromTargetEvent(params) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
19
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/context/CdpTarget.d.ts
generated
vendored
19
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/context/CdpTarget.d.ts
generated
vendored
@ -1,21 +1,22 @@
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import type { ICdpClient } from '../../../cdp/CdpClient.js';
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import { Deferred } from '../../../utils/Deferred.js';
|
||||
import type { LoggerFn } from '../../../utils/log.js';
|
||||
import type { Result } from '../../../utils/result.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { NetworkStorage } from '../network/NetworkStorage.js';
|
||||
import type { ChannelProxy } from '../script/ChannelProxy.js';
|
||||
import type { PreloadScriptStorage } from '../script/PreloadScriptStorage.js';
|
||||
import type { RealmStorage } from '../script/RealmStorage.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
export declare class CdpTarget {
|
||||
#private;
|
||||
static create(targetId: Protocol.Target.TargetID, cdpClient: ICdpClient, browserCdpClient: ICdpClient, cdpSessionId: Protocol.Target.SessionID, realmStorage: RealmStorage, eventManager: EventManager, preloadScriptStorage: PreloadScriptStorage, networkStorage: NetworkStorage, acceptInsecureCerts: boolean): CdpTarget;
|
||||
constructor(targetId: Protocol.Target.TargetID, cdpClient: ICdpClient, browserCdpClient: ICdpClient, cdpSessionId: Protocol.Target.SessionID, eventManager: EventManager, preloadScriptStorage: PreloadScriptStorage, networkStorage: NetworkStorage, acceptInsecureCerts: boolean);
|
||||
/** Returns a promise that resolves when the target is unblocked. */
|
||||
get targetUnblocked(): Deferred<Result<void>>;
|
||||
get targetId(): Protocol.Target.TargetID;
|
||||
get cdpClient(): ICdpClient;
|
||||
get browserCdpClient(): ICdpClient;
|
||||
static create(targetId: Protocol.Target.TargetID, cdpClient: CdpClient, browserCdpClient: CdpClient, realmStorage: RealmStorage, eventManager: EventManager, preloadScriptStorage: PreloadScriptStorage, networkStorage: NetworkStorage, acceptInsecureCerts: boolean, logger?: LoggerFn): CdpTarget;
|
||||
constructor(targetId: Protocol.Target.TargetID, cdpClient: CdpClient, browserCdpClient: CdpClient, eventManager: EventManager, preloadScriptStorage: PreloadScriptStorage, networkStorage: NetworkStorage, acceptInsecureCerts: boolean);
|
||||
/** Returns a deferred that resolves when the target is unblocked. */
|
||||
get unblocked(): Deferred<Result<void>>;
|
||||
get id(): Protocol.Target.TargetID;
|
||||
get cdpClient(): CdpClient;
|
||||
get browserCdpClient(): CdpClient;
|
||||
/** Needed for CDP escape path. */
|
||||
get cdpSessionId(): Protocol.Target.SessionID;
|
||||
/** Calls `Fetch.enable` with the added network intercepts. */
|
||||
|
||||
27
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/context/CdpTarget.js
generated
vendored
27
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/context/CdpTarget.js
generated
vendored
@ -5,18 +5,17 @@ const Deferred_js_1 = require("../../../utils/Deferred.js");
|
||||
const LogManager_js_1 = require("../log/LogManager.js");
|
||||
const NetworkManager_js_1 = require("../network/NetworkManager.js");
|
||||
class CdpTarget {
|
||||
#targetId;
|
||||
#id;
|
||||
#cdpClient;
|
||||
#browserCdpClient;
|
||||
#cdpSessionId;
|
||||
#eventManager;
|
||||
#preloadScriptStorage;
|
||||
#networkStorage;
|
||||
#targetUnblocked = new Deferred_js_1.Deferred();
|
||||
#acceptInsecureCerts;
|
||||
static create(targetId, cdpClient, browserCdpClient, cdpSessionId, realmStorage, eventManager, preloadScriptStorage, networkStorage, acceptInsecureCerts) {
|
||||
const cdpTarget = new CdpTarget(targetId, cdpClient, browserCdpClient, cdpSessionId, eventManager, preloadScriptStorage, networkStorage, acceptInsecureCerts);
|
||||
LogManager_js_1.LogManager.create(cdpTarget, realmStorage, eventManager);
|
||||
static create(targetId, cdpClient, browserCdpClient, realmStorage, eventManager, preloadScriptStorage, networkStorage, acceptInsecureCerts, logger) {
|
||||
const cdpTarget = new CdpTarget(targetId, cdpClient, browserCdpClient, eventManager, preloadScriptStorage, networkStorage, acceptInsecureCerts);
|
||||
LogManager_js_1.LogManager.create(cdpTarget, realmStorage, eventManager, logger);
|
||||
NetworkManager_js_1.NetworkManager.create(cdpTarget, eventManager, networkStorage);
|
||||
cdpTarget.#setEventListeners();
|
||||
// No need to await.
|
||||
@ -24,22 +23,21 @@ class CdpTarget {
|
||||
void cdpTarget.#unblock();
|
||||
return cdpTarget;
|
||||
}
|
||||
constructor(targetId, cdpClient, browserCdpClient, cdpSessionId, eventManager, preloadScriptStorage, networkStorage, acceptInsecureCerts) {
|
||||
this.#targetId = targetId;
|
||||
constructor(targetId, cdpClient, browserCdpClient, eventManager, preloadScriptStorage, networkStorage, acceptInsecureCerts) {
|
||||
this.#id = targetId;
|
||||
this.#cdpClient = cdpClient;
|
||||
this.#cdpSessionId = cdpSessionId;
|
||||
this.#eventManager = eventManager;
|
||||
this.#preloadScriptStorage = preloadScriptStorage;
|
||||
this.#networkStorage = networkStorage;
|
||||
this.#browserCdpClient = browserCdpClient;
|
||||
this.#acceptInsecureCerts = acceptInsecureCerts;
|
||||
}
|
||||
/** Returns a promise that resolves when the target is unblocked. */
|
||||
get targetUnblocked() {
|
||||
/** Returns a deferred that resolves when the target is unblocked. */
|
||||
get unblocked() {
|
||||
return this.#targetUnblocked;
|
||||
}
|
||||
get targetId() {
|
||||
return this.#targetId;
|
||||
get id() {
|
||||
return this.#id;
|
||||
}
|
||||
get cdpClient() {
|
||||
return this.#cdpClient;
|
||||
@ -49,7 +47,8 @@ class CdpTarget {
|
||||
}
|
||||
/** Needed for CDP escape path. */
|
||||
get cdpSessionId() {
|
||||
return this.#cdpSessionId;
|
||||
// SAFETY we got the client by it's id for creating
|
||||
return this.#cdpClient.sessionId;
|
||||
}
|
||||
/** Calls `Fetch.enable` with the added network intercepts. */
|
||||
async fetchEnable() {
|
||||
@ -116,7 +115,7 @@ class CdpTarget {
|
||||
params: {
|
||||
event,
|
||||
params,
|
||||
session: this.#cdpSessionId,
|
||||
session: this.cdpSessionId,
|
||||
},
|
||||
}, null);
|
||||
});
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"CdpTarget.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/context/CdpTarget.ts"],"names":[],"mappings":";;;AAoBA,4DAAoD;AAGpD,wDAAgD;AAChD,oEAA4D;AAM5D,MAAa,SAAS;IACX,SAAS,CAA2B;IACpC,UAAU,CAAa;IACvB,iBAAiB,CAAa;IAC9B,aAAa,CAA4B;IACzC,aAAa,CAAe;IAE5B,qBAAqB,CAAuB;IAC5C,eAAe,CAAiB;IAEhC,gBAAgB,GAAG,IAAI,sBAAQ,EAAgB,CAAC;IAChD,oBAAoB,CAAU;IAEvC,MAAM,CAAC,MAAM,CACX,QAAkC,EAClC,SAAqB,EACrB,gBAA4B,EAC5B,YAAuC,EACvC,YAA0B,EAC1B,YAA0B,EAC1B,oBAA0C,EAC1C,cAA8B,EAC9B,mBAA4B;QAE5B,MAAM,SAAS,GAAG,IAAI,SAAS,CAC7B,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,mBAAmB,CACpB,CAAC;QAEF,0BAAU,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;QACzD,kCAAc,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;QAE/D,SAAS,CAAC,kBAAkB,EAAE,CAAC;QAE/B,oBAAoB;QACpB,0DAA0D;QAC1D,KAAK,SAAS,CAAC,QAAQ,EAAE,CAAC;QAE1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,YACE,QAAkC,EAClC,SAAqB,EACrB,gBAA4B,EAC5B,YAAuC,EACvC,YAA0B,EAC1B,oBAA0C,EAC1C,cAA8B,EAC9B,mBAA4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CAC9B;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,OAAO,KAAK,EAAE;gBACtB,MAAM,EAAE;oBACN,KAAK;oBACL,MAAM;oBACN,OAAO,EAAE,IAAI,CAAC,aAAa;iBAC5B;aACF,EACD,IAAI,CACL,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,qBAAqB;aAC9B,IAAI,EAAE;aACN,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,2CAA2C;IAC3C,KAAK,CAAC,8BAA8B;QAClC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;YACnD,MAAM,EAAE,IAAI;SACb,CAAC,EAAE,CAAC;YACH,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF;AA3LD,8BA2LC"}
|
||||
{"version":3,"file":"CdpTarget.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/context/CdpTarget.ts"],"names":[],"mappings":";;;AAoBA,4DAAoD;AAGpD,wDAAgD;AAChD,oEAA4D;AAO5D,MAAa,SAAS;IACX,GAAG,CAA2B;IAC9B,UAAU,CAAY;IACtB,iBAAiB,CAAY;IAC7B,aAAa,CAAe;IAE5B,qBAAqB,CAAuB;IAC5C,eAAe,CAAiB;IAEhC,gBAAgB,GAAG,IAAI,sBAAQ,EAAgB,CAAC;IAChD,oBAAoB,CAAU;IAEvC,MAAM,CAAC,MAAM,CACX,QAAkC,EAClC,SAAoB,EACpB,gBAA2B,EAC3B,YAA0B,EAC1B,YAA0B,EAC1B,oBAA0C,EAC1C,cAA8B,EAC9B,mBAA4B,EAC5B,MAAiB;QAEjB,MAAM,SAAS,GAAG,IAAI,SAAS,CAC7B,QAAQ,EACR,SAAS,EACT,gBAAgB,E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AC;oBAC5B,IAAI,EAAE,OAAO;oBACb,KAAK;iBACN,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;QACH,CAAC;QAED,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAC5B,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACxC,gEAAgE;YAChE,yBAAyB;YACzB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,OAAO;YACT,CAAC;YACD,IAAI,CAAC,aAAa,CAAC,aAAa,CAC9B;gBACE,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,OAAO,KAAK,EAAE;gBACtB,MAAM,EAAE;oBACN,KAAK;oBACL,MAAM;oBACN,OAAO,EAAE,IAAI,CAAC,YAAY;iBAC3B;aACF,EACD,IAAI,CACL,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,qBAAqB;aAC9B,IAAI,EAAE;aACN,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,2CAA2C;IAC3C,KAAK,CAAC,8BAA8B;QAClC,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;YACnD,MAAM,EAAE,IAAI;SACb,CAAC,EAAE,CAAC;YACH,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF;AAxLD,8BAwLC"}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/events/events.js.map
generated
vendored
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/events/events.js.map
generated
vendored
@ -1 +0,0 @@
|
||||
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/events/events.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,+DAGuC;AAEvC;;;GAGG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,0BAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CACxE,CAAC;AACJ,CAAC;AAJD,gCAIC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,IAAY;IAEZ,IAAI,CAAC,0BAAY,CAAC,WAAW,CAAC,GAAG,CAAC,IAAa,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,MAAM,IAAI,sCAAwB,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAND,oDAMC"}
|
||||
@ -1,9 +1,10 @@
|
||||
import { Input } from '../../../protocol/protocol.js';
|
||||
import type { EmptyResult } from '../../../protocol/webdriver-bidi';
|
||||
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>;
|
||||
}
|
||||
|
||||
78
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/input/InputProcessor.js
generated
vendored
78
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/input/InputProcessor.js
generated
vendored
@ -18,13 +18,16 @@ exports.InputProcessor = void 0;
|
||||
* limitations under the License.
|
||||
*/
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const assert_js_1 = require("../../../utils/assert.js");
|
||||
const ActionDispatcher_js_1 = require("../input/ActionDispatcher.js");
|
||||
const InputStateManager_js_1 = require("../input/InputStateManager.js");
|
||||
class InputProcessor {
|
||||
#browsingContextStorage;
|
||||
#realmStorage;
|
||||
#inputStateManager = new InputStateManager_js_1.InputStateManager();
|
||||
constructor(browsingContextStorage) {
|
||||
constructor(browsingContextStorage, realmStorage) {
|
||||
this.#browsingContextStorage = browsingContextStorage;
|
||||
this.#realmStorage = realmStorage;
|
||||
}
|
||||
async performActions(params) {
|
||||
const context = this.#browsingContextStorage.getContext(params.context);
|
||||
@ -43,6 +46,79 @@ class InputProcessor {
|
||||
this.#inputStateManager.delete(topContext);
|
||||
return {};
|
||||
}
|
||||
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.deserializeForCdp(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) {
|
||||
const actionsByTick = [];
|
||||
for (const action of params.actions) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
10
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/input/InputSource.d.ts
generated
vendored
10
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/input/InputSource.d.ts
generated
vendored
@ -51,13 +51,13 @@ export declare class PointerSource {
|
||||
static ClickContext: {
|
||||
new (x: number, y: number, time: number): {
|
||||
count: number;
|
||||
"__#87322@#x": number;
|
||||
"__#87322@#y": number;
|
||||
"__#87322@#time": number;
|
||||
"__#89102@#x": number;
|
||||
"__#89102@#y": number;
|
||||
"__#89102@#time": number;
|
||||
compare(context: any): boolean;
|
||||
};
|
||||
"__#87322@#DOUBLE_CLICK_TIME_MS": number;
|
||||
"__#87322@#MAX_DOUBLE_CLICK_RADIUS": number;
|
||||
"__#89102@#DOUBLE_CLICK_TIME_MS": number;
|
||||
"__#89102@#MAX_DOUBLE_CLICK_RADIUS": number;
|
||||
};
|
||||
setClickCount(button: number, context: InstanceType<typeof PointerSource.ClickContext>): number;
|
||||
getClickCount(button: number): number;
|
||||
|
||||
5
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/log/LogManager.d.ts
generated
vendored
5
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/log/LogManager.d.ts
generated
vendored
@ -1,8 +1,9 @@
|
||||
import { type LoggerFn } from '../../../utils/log.js';
|
||||
import type { CdpTarget } from '../context/CdpTarget.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { RealmStorage } from '../script/RealmStorage.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
export declare class LogManager {
|
||||
#private;
|
||||
private constructor();
|
||||
static create(cdpTarget: CdpTarget, realmStorage: RealmStorage, eventManager: EventManager): LogManager;
|
||||
static create(cdpTarget: CdpTarget, realmStorage: RealmStorage, eventManager: EventManager, logger?: LoggerFn): LogManager;
|
||||
}
|
||||
|
||||
87
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/log/LogManager.js
generated
vendored
87
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/log/LogManager.js
generated
vendored
@ -2,6 +2,7 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LogManager = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const log_js_1 = require("../../../utils/log.js");
|
||||
const logHelper_js_1 = require("./logHelper.js");
|
||||
/** Converts CDP StackTrace object to BiDi StackTrace object. */
|
||||
function getBidiStackTrace(cdpStackTrace) {
|
||||
@ -31,13 +32,15 @@ class LogManager {
|
||||
#eventManager;
|
||||
#realmStorage;
|
||||
#cdpTarget;
|
||||
constructor(cdpTarget, realmStorage, eventManager) {
|
||||
#logger;
|
||||
constructor(cdpTarget, realmStorage, eventManager, logger) {
|
||||
this.#cdpTarget = cdpTarget;
|
||||
this.#realmStorage = realmStorage;
|
||||
this.#eventManager = eventManager;
|
||||
this.#logger = logger;
|
||||
}
|
||||
static create(cdpTarget, realmStorage, eventManager) {
|
||||
const logManager = new LogManager(cdpTarget, realmStorage, eventManager);
|
||||
static create(cdpTarget, realmStorage, eventManager, logger) {
|
||||
const logManager = new LogManager(cdpTarget, realmStorage, eventManager, logger);
|
||||
logManager.#initializeEntryAddedEventListener();
|
||||
return logManager;
|
||||
}
|
||||
@ -49,33 +52,37 @@ class LogManager {
|
||||
cdpSessionId: this.#cdpTarget.cdpSessionId,
|
||||
executionContextId: params.executionContextId,
|
||||
});
|
||||
if (realm === undefined) {
|
||||
// Ignore exceptions not attached to any realm.
|
||||
this.#logger?.(log_js_1.LogType.cdp, params);
|
||||
return;
|
||||
}
|
||||
const argsPromise = realm === undefined
|
||||
? Promise.resolve(params.args)
|
||||
: // Properly serialize arguments if possible.
|
||||
Promise.all(params.args.map((arg) => {
|
||||
return realm.serializeCdpObject(arg, "none" /* Script.ResultOwnership.None */);
|
||||
}));
|
||||
this.#eventManager.registerPromiseEvent(argsPromise.then((args) => ({
|
||||
kind: 'success',
|
||||
value: {
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded,
|
||||
params: {
|
||||
level: getLogLevel(params.type),
|
||||
source: {
|
||||
realm: realm?.realmId ?? 'UNKNOWN',
|
||||
context: realm?.browsingContextId ?? 'UNKNOWN',
|
||||
for (const browsingContext of realm.associatedBrowsingContexts) {
|
||||
this.#eventManager.registerPromiseEvent(argsPromise.then((args) => ({
|
||||
kind: 'success',
|
||||
value: {
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded,
|
||||
params: {
|
||||
level: getLogLevel(params.type),
|
||||
source: realm.source,
|
||||
text: (0, logHelper_js_1.getRemoteValuesText)(args, true),
|
||||
timestamp: Math.round(params.timestamp),
|
||||
stackTrace: getBidiStackTrace(params.stackTrace),
|
||||
type: 'console',
|
||||
// Console method is `warn`, not `warning`.
|
||||
method: params.type === 'warning' ? 'warn' : params.type,
|
||||
args,
|
||||
},
|
||||
text: (0, logHelper_js_1.getRemoteValuesText)(args, true),
|
||||
timestamp: Math.round(params.timestamp),
|
||||
stackTrace: getBidiStackTrace(params.stackTrace),
|
||||
type: 'console',
|
||||
// Console method is `warn`, not `warning`.
|
||||
method: params.type === 'warning' ? 'warn' : params.type,
|
||||
args,
|
||||
},
|
||||
},
|
||||
})), realm?.browsingContextId ?? 'UNKNOWN', protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded);
|
||||
})), browsingContext.id, protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded);
|
||||
}
|
||||
});
|
||||
this.#cdpTarget.cdpClient.on('Runtime.exceptionThrown', (params) => {
|
||||
// Try to find realm by `cdpSessionId` and `executionContextId`,
|
||||
@ -84,24 +91,28 @@ class LogManager {
|
||||
cdpSessionId: this.#cdpTarget.cdpSessionId,
|
||||
executionContextId: params.exceptionDetails.executionContextId,
|
||||
});
|
||||
this.#eventManager.registerPromiseEvent(LogManager.#getExceptionText(params, realm).then((text) => ({
|
||||
kind: 'success',
|
||||
value: {
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded,
|
||||
params: {
|
||||
level: "error" /* Log.Level.Error */,
|
||||
source: {
|
||||
realm: realm?.realmId ?? 'UNKNOWN',
|
||||
context: realm?.browsingContextId ?? 'UNKNOWN',
|
||||
if (realm === undefined) {
|
||||
// Ignore exceptions not attached to any realm.
|
||||
this.#logger?.(log_js_1.LogType.cdp, params);
|
||||
return;
|
||||
}
|
||||
for (const browsingContext of realm.associatedBrowsingContexts) {
|
||||
this.#eventManager.registerPromiseEvent(LogManager.#getExceptionText(params, realm).then((text) => ({
|
||||
kind: 'success',
|
||||
value: {
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded,
|
||||
params: {
|
||||
level: "error" /* Log.Level.Error */,
|
||||
source: realm.source,
|
||||
text,
|
||||
timestamp: Math.round(params.timestamp),
|
||||
stackTrace: getBidiStackTrace(params.exceptionDetails.stackTrace),
|
||||
type: 'javascript',
|
||||
},
|
||||
text,
|
||||
timestamp: Math.round(params.timestamp),
|
||||
stackTrace: getBidiStackTrace(params.exceptionDetails.stackTrace),
|
||||
type: 'javascript',
|
||||
},
|
||||
},
|
||||
})), realm?.browsingContextId ?? 'UNKNOWN', protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded);
|
||||
})), browsingContext.id, protocol_js_1.ChromiumBidi.Log.EventNames.LogEntryAdded);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/log/LogManager.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/log/LogManager.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"LogManager.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/log/LogManager.ts"],"names":[],"mappings":";;;AAkBA,+DAAwE;AAMxE,iDAAmD;AAEnD,gEAAgE;AAChE,SAAS,iBAAiB,CACxB,aAAsD;IAEtD,MAAM,W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D,IAAI,EAAE,YAAY;qBACnB;iBACF;aACF,CAAC,CAAC,EACH,KAAK,EAAE,iBAAiB,IAAI,SAAS,EACrC,0BAAY,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAC1C,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAC5B,MAA6C,EAC7C,KAAa;QAEb,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;YACvC,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACtC,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,MAAM,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACxE,CAAC;CACF;AAnID,gCAmIC"}
|
||||
{"version":3,"file":"LogManager.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/log/LogManager.ts"],"names":[],"mappings":";;;AAkBA,+DAAwE;AACxE,kDAA6D;AAM7D,iDAAmD;AAEnD,gEAAgE;AAChE,SAAS,iBAAiB,CACxB,aAAsD;IAEtD,MAAM,WAAW,GAAG,aAAa,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAC9D,OAAO;YACL,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,GAAG,EAAE,SAAS,CAAC,GAAG;SACnB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,WAAW,EAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,SAAS,WAAW,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Y;yBACnB;qBACF;iBACF,CAAC,CAAC,EACH,eAAe,CAAC,EAAE,EAClB,0BAAY,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAC1C,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAC5B,MAA6C,EAC7C,KAAa;QAEb,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;YACvC,OAAO,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC;QACtC,CAAC;QACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,MAAM,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACxE,CAAC;CACF;AApJD,gCAoJC"}
|
||||
@ -1,5 +1,5 @@
|
||||
import type { CdpTarget } from '../context/CdpTarget.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import type { NetworkStorage } from './NetworkStorage.js';
|
||||
/** Maps 1:1 to CdpTarget. */
|
||||
export declare class NetworkManager {
|
||||
|
||||
@ -100,7 +100,7 @@ class NetworkManager {
|
||||
if (params.networkId) {
|
||||
networkManager
|
||||
.#getOrCreateNetworkRequest(params.networkId)
|
||||
.onRequestPaused(params, networkManager.#networkStorage);
|
||||
.onRequestPaused(params);
|
||||
}
|
||||
});
|
||||
return networkManager;
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"NetworkManager.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/network/NetworkManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAaH,2DAAmD;AAGnD,6BAA6B;AAC7B,MAAa,cAAc;IAChB,UAAU,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,CAAC;QAC9C,CAAC,CACF,CAAC;QAEF,SAAS,CAAC,SAAS,CAAC,EAAE,CACpB,gCAAgC,EAChC,CAAC,MAAoD,EAAE,EAAE;YACvD,cAAc;iBACX,0BAA0B,CAAC,MAAM,CAAC,SAAS,CAAC;iBAC5C,iBAAiB,EAAE,CAAC;QACzB,CAAC,CACF,CAAC;QAEF,SAAS,CAAC,SAAS,CAAC,EAAE,CACpB,uBAAuB,EACvB,CAAC,MAA2C,EAAE,EAAE;YAC9C,cAAc;iBACX,0BAA0B,CAAC,MAAM,CAAC,SAAS,CAAC;iBAC5C,oBAAoB,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC,CACF,CAAC;QAEF,oFAAoF;QACpF,SAAS,CAAC,SAAS,CAAC,EAAE,CACpB,qBAAqB,EACrB,CAAC,MAAyC,EAAE,EAAE;YAC5C,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,cAAc;qBACX,0BAA0B,CAAC,MAAM,CAAC,SAAS,CAAC;qBAC5C,eAAe,CAAC,MAAM,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC,CACF,CAAC;QAEF,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAtJD,wCAsJC"}
|
||||
{"version":3,"file":"NetworkManager.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/network/NetworkManager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAaH,2DAAmD;AAGnD,6BAA6B;AAC7B,MAAa,cAAc;IAChB,UAAU,CAAY;IACtB,aAAa,CAAe;IAC5B,eAAe,CAAiB;IAEzC,YACE,SAAoB,EACpB,YAA0B,EAC1B,cAA8B;QAE9B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED,2EAA2E;IAC3E,IAAI,SAAS;QAC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AuB,EACvB,CAAC,MAA2C,EAAE,EAAE;YAC9C,cAAc;iBACX,0BAA0B,CAAC,MAAM,CAAC,SAAS,CAAC;iBAC5C,oBAAoB,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC,CACF,CAAC;QAEF,oFAAoF;QACpF,SAAS,CAAC,SAAS,CAAC,EAAE,CACpB,qBAAqB,EACrB,CAAC,MAAyC,EAAE,EAAE;YAC5C,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,cAAc;qBACX,0BAA0B,CAAC,MAAM,CAAC,SAAS,CAAC;qBAC5C,eAAe,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC,CACF,CAAC;QAEF,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAtJD,wCAsJC"}
|
||||
@ -9,7 +9,7 @@ export declare class NetworkProcessor {
|
||||
continueRequest(params: Network.ContinueRequestParameters): Promise<EmptyResult>;
|
||||
continueResponse(params: Network.ContinueResponseParameters): Promise<EmptyResult>;
|
||||
continueWithAuth(params: Network.ContinueWithAuthParameters): Promise<EmptyResult>;
|
||||
failRequest(params: Network.FailRequestParameters): Promise<EmptyResult>;
|
||||
failRequest({ request: networkId, }: Network.FailRequestParameters): Promise<EmptyResult>;
|
||||
provideResponse(params: Network.ProvideResponseParameters): Promise<EmptyResult>;
|
||||
removeIntercept(params: Network.RemoveInterceptParameters): Promise<EmptyResult>;
|
||||
/**
|
||||
|
||||
@ -14,9 +14,6 @@ class NetworkProcessor {
|
||||
this.#networkStorage = networkStorage;
|
||||
}
|
||||
async addIntercept(params) {
|
||||
if (params.phases.length === 0) {
|
||||
throw new protocol_js_1.InvalidArgumentException('At least one phase must be specified.');
|
||||
}
|
||||
// If AuthRequired is specified, BeforeRequestSent must also be specified.
|
||||
// This is a CDP quirk.
|
||||
if (params.phases.includes("authRequired" /* Network.InterceptPhase.AuthRequired */) &&
|
||||
@ -48,8 +45,7 @@ class NetworkProcessor {
|
||||
// ; Step 9. cookies
|
||||
// ; Step 10. body
|
||||
const requestHeaders = (0, NetworkUtils_js_1.cdpFetchHeadersFromBidiNetworkHeaders)(headers);
|
||||
const request = this.#networkStorage.getRequest(networkId);
|
||||
(0, assert_js_1.assert)(request, `Network request with ID ${networkId} doesn't exist`);
|
||||
const request = this.#getRequestOrFail(networkId);
|
||||
await request.continueRequest(fetchId, url, method, requestHeaders);
|
||||
this.#networkStorage.removeBlockedRequest(networkId);
|
||||
return {};
|
||||
@ -65,8 +61,7 @@ class NetworkProcessor {
|
||||
// TODO: Set / expand.
|
||||
// ; Step 10. cookies
|
||||
// ; Step 11. credentials
|
||||
const request = this.#networkStorage.getRequest(networkId);
|
||||
(0, assert_js_1.assert)(request, `Network request with ID ${networkId} doesn't exist`);
|
||||
const request = this.#getRequestOrFail(networkId);
|
||||
await request.continueResponse(fetchId, statusCode, reasonPhrase, responseHeaders);
|
||||
this.#networkStorage.removeBlockedRequest(networkId);
|
||||
return {};
|
||||
@ -77,45 +72,41 @@ class NetworkProcessor {
|
||||
if (phase !== "authRequired" /* Network.InterceptPhase.AuthRequired */) {
|
||||
throw new protocol_js_1.InvalidArgumentException(`Blocked request for network id '${networkId}' is not in 'AuthRequired' phase`);
|
||||
}
|
||||
const request = this.#networkStorage.getRequest(networkId);
|
||||
(0, assert_js_1.assert)(request, `Network request with ID ${networkId} doesn't exist`);
|
||||
const request = this.#getRequestOrFail(networkId);
|
||||
let username;
|
||||
let password;
|
||||
if (params.action === 'provideCredentials') {
|
||||
const { credentials } = params;
|
||||
username = params.credentials.username;
|
||||
password = params.credentials.password;
|
||||
username = credentials.username;
|
||||
password = credentials.password;
|
||||
// TODO: This should be invalid argument exception.
|
||||
// Spec may need to be updated.
|
||||
(0, assert_js_1.assert)(credentials.type === 'password', `Credentials type ${credentials.type} must be 'password'`);
|
||||
}
|
||||
const response = (0, NetworkUtils_js_1.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction)(params.action);
|
||||
await request.continueWithAuth(fetchId, response, username, password);
|
||||
return {};
|
||||
}
|
||||
async failRequest(params) {
|
||||
const networkId = params.request;
|
||||
const blockedRequest = this.#getBlockedRequest(networkId);
|
||||
const { request: fetchId, phase } = blockedRequest;
|
||||
async failRequest({ request: networkId, }) {
|
||||
const { request: fetchId, phase } = this.#getBlockedRequest(networkId);
|
||||
if (phase === "authRequired" /* Network.InterceptPhase.AuthRequired */) {
|
||||
throw new protocol_js_1.InvalidArgumentException(`Blocked request for network id '${networkId}' is in 'AuthRequired' phase`);
|
||||
}
|
||||
const request = this.#networkStorage.getRequest(networkId);
|
||||
(0, assert_js_1.assert)(request, `Network request with ID ${networkId} doesn't exist`);
|
||||
const request = this.#getRequestOrFail(networkId);
|
||||
await request.failRequest(fetchId, 'Failed');
|
||||
this.#networkStorage.removeBlockedRequest(networkId);
|
||||
return {};
|
||||
}
|
||||
async provideResponse(params) {
|
||||
const networkId = params.request;
|
||||
const { statusCode, reasonPhrase, headers, body, request: networkId, } = params;
|
||||
const { request: fetchId } = this.#getBlockedRequest(networkId);
|
||||
const { statusCode, reasonPhrase, headers, body } = params;
|
||||
// TODO: Step 6
|
||||
// https://w3c.github.io/webdriver-bidi/#command-network-continueResponse
|
||||
const responseHeaders = (0, NetworkUtils_js_1.cdpFetchHeadersFromBidiNetworkHeaders)(headers);
|
||||
// TODO: Set / expand.
|
||||
// ; Step 10. cookies
|
||||
// ; Step 11. credentials
|
||||
const request = this.#networkStorage.getRequest(networkId);
|
||||
(0, assert_js_1.assert)(request, `Network request with ID ${networkId} doesn't exist`);
|
||||
const request = this.#getRequestOrFail(networkId);
|
||||
await request.provideResponse(fetchId, statusCode ?? request.statusCode, reasonPhrase, responseHeaders, body?.value // TODO: Differ base64 / string
|
||||
);
|
||||
this.#networkStorage.removeBlockedRequest(networkId);
|
||||
@ -172,6 +163,13 @@ class NetworkProcessor {
|
||||
}
|
||||
return blockedRequest;
|
||||
}
|
||||
#getRequestOrFail(id) {
|
||||
const request = this.#networkStorage.getRequest(id);
|
||||
if (!request) {
|
||||
throw new protocol_js_1.NoSuchRequestException(`Network request with ID ${id} doesn't exist`);
|
||||
}
|
||||
return request;
|
||||
}
|
||||
/**
|
||||
* Attempts to parse the given url.
|
||||
* Throws an InvalidArgumentException if the url is invalid.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,7 +5,7 @@
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import { Network, type JsUint } from '../../../protocol/protocol.js';
|
||||
import type { CdpTarget } from '../context/CdpTarget.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import type { NetworkStorage } from './NetworkStorage.js';
|
||||
/** Abstracts one individual network request. */
|
||||
export declare class NetworkRequest {
|
||||
@ -24,7 +24,7 @@ export declare class NetworkRequest {
|
||||
onServedFromCache(): void;
|
||||
onLoadingFailedEvent(event: Protocol.Network.LoadingFailedEvent): void;
|
||||
/** Fired whenever a network request interception is hit. */
|
||||
onRequestPaused(params: Protocol.Fetch.RequestPausedEvent, networkStorage: NetworkStorage): void;
|
||||
onRequestPaused(params: Protocol.Fetch.RequestPausedEvent): void;
|
||||
/** @see https://chromedevtools.github.io/devtools-protocol/tot/Fetch/#method-failRequest */
|
||||
failRequest(networkId: Network.Request, errorReason: Protocol.Network.ErrorReason): Promise<void>;
|
||||
/** @see https://chromedevtools.github.io/devtools-protocol/tot/Fetch/#method-continueRequest */
|
||||
|
||||
32
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkRequest.js
generated
vendored
32
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkRequest.js
generated
vendored
@ -159,7 +159,7 @@ class NetworkRequest {
|
||||
}, this.#context);
|
||||
}
|
||||
/** Fired whenever a network request interception is hit. */
|
||||
onRequestPaused(params, networkStorage) {
|
||||
onRequestPaused(params) {
|
||||
if (this.#isIgnoredEvent()) {
|
||||
void this.continueRequest(params.requestId).catch(() => {
|
||||
// TODO: Add some logging
|
||||
@ -186,8 +186,7 @@ class NetworkRequest {
|
||||
const headers = (0, NetworkUtils_js_1.bidiNetworkHeadersFromCdpFetchHeaders)(
|
||||
// TODO: Use params.request.headers if request?
|
||||
params.responseHeaders);
|
||||
(0, assert_js_1.assert)(this.requestId === params.networkId);
|
||||
networkStorage.addBlockedRequest(this.requestId, {
|
||||
this.#networkStorage.addBlockedRequest(this.requestId, {
|
||||
request: params.requestId, // intercept request id
|
||||
phase,
|
||||
// TODO: Finish populating response / ResponseData.
|
||||
@ -526,32 +525,7 @@ class NetworkRequest {
|
||||
.filter(({ blockedReasons }) => {
|
||||
return !Array.isArray(blockedReasons) || blockedReasons.length === 0;
|
||||
})
|
||||
.map(({ cookie }) => {
|
||||
return {
|
||||
name: cookie.name,
|
||||
value: {
|
||||
type: 'string',
|
||||
value: cookie.value,
|
||||
},
|
||||
domain: cookie.domain,
|
||||
path: cookie.path,
|
||||
expires: cookie.expires,
|
||||
size: cookie.size,
|
||||
httpOnly: cookie.httpOnly,
|
||||
secure: cookie.secure,
|
||||
sameSite: NetworkRequest.#getCookiesSameSite(cookie.sameSite),
|
||||
};
|
||||
});
|
||||
}
|
||||
static #getCookiesSameSite(cdpSameSiteValue) {
|
||||
switch (cdpSameSiteValue) {
|
||||
case 'Strict':
|
||||
return 'strict';
|
||||
case 'Lax':
|
||||
return 'lax';
|
||||
default:
|
||||
return 'none';
|
||||
}
|
||||
.map(({ cookie }) => (0, NetworkUtils_js_1.cdpToBiDiCookie)(cookie));
|
||||
}
|
||||
}
|
||||
exports.NetworkRequest = NetworkRequest;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -17,6 +17,15 @@
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import { Network } from '../../../protocol/protocol.js';
|
||||
import type { NetworkRequest } from './NetworkRequest.js';
|
||||
interface NetworkInterception {
|
||||
urlPatterns: Network.UrlPattern[];
|
||||
phases: Network.AddInterceptParameters['phases'];
|
||||
}
|
||||
export interface BlockedRequest {
|
||||
request: Protocol.Fetch.RequestId;
|
||||
phase: Network.InterceptPhase;
|
||||
response: Network.ResponseData;
|
||||
}
|
||||
/** Stores network and intercept maps. */
|
||||
export declare class NetworkStorage {
|
||||
#private;
|
||||
@ -27,10 +36,7 @@ export declare class NetworkStorage {
|
||||
*
|
||||
* @return The intercept ID.
|
||||
*/
|
||||
addIntercept(value: {
|
||||
urlPatterns: Network.UrlPattern[];
|
||||
phases: Network.AddInterceptParameters['phases'];
|
||||
}): Network.Intercept;
|
||||
addIntercept(value: NetworkInterception): Network.Intercept;
|
||||
/**
|
||||
* Removes the given intercept from the intercept map.
|
||||
* Throws NoSuchInterceptException if the intercept does not exist.
|
||||
@ -64,22 +70,15 @@ export declare class NetworkStorage {
|
||||
* @see https://url.spec.whatwg.org/#special-scheme
|
||||
*/
|
||||
static isSpecialScheme(protocol: string): boolean;
|
||||
addBlockedRequest(requestId: Network.Request, value: {
|
||||
request: Protocol.Fetch.RequestId;
|
||||
phase: Network.InterceptPhase;
|
||||
response: Network.ResponseData;
|
||||
}): void;
|
||||
addBlockedRequest(requestId: Network.Request, value: BlockedRequest): void;
|
||||
removeBlockedRequest(requestId: Network.Request): void;
|
||||
/**
|
||||
* Returns the blocked request associated with the given network ID, if any.
|
||||
*/
|
||||
getBlockedRequest(networkId: Network.Request): {
|
||||
request: Protocol.Fetch.RequestId;
|
||||
phase: Network.InterceptPhase;
|
||||
response: Network.ResponseData;
|
||||
} | undefined;
|
||||
getBlockedRequest(networkId: Network.Request): BlockedRequest | undefined;
|
||||
/** #@see https://w3c.github.io/webdriver-bidi/#get-the-network-intercepts */
|
||||
getNetworkIntercepts(requestId: Network.Request, phase?: Network.InterceptPhase): Network.Intercept[];
|
||||
/** Matches the given URLPattern against the given URL. */
|
||||
static matchUrlPattern(urlPattern: Network.UrlPattern, url: string | undefined): boolean;
|
||||
}
|
||||
export {};
|
||||
|
||||
11
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkStorage.js
generated
vendored
11
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkStorage.js
generated
vendored
@ -28,13 +28,6 @@ class NetworkStorage {
|
||||
* @return The intercept ID.
|
||||
*/
|
||||
addIntercept(value) {
|
||||
// Check if the given intercept entry already exists.
|
||||
for (const [interceptId, { urlPatterns, phases },] of this.#interceptMap.entries()) {
|
||||
if (JSON.stringify(value.urlPatterns) === JSON.stringify(urlPatterns) &&
|
||||
JSON.stringify(value.phases) === JSON.stringify(phases)) {
|
||||
return interceptId;
|
||||
}
|
||||
}
|
||||
const interceptId = (0, uuid_js_1.uuidv4)();
|
||||
this.#interceptMap.set(interceptId, value);
|
||||
return interceptId;
|
||||
@ -120,7 +113,7 @@ class NetworkStorage {
|
||||
}
|
||||
let url = '';
|
||||
if (protocol) {
|
||||
url += `${protocol}`;
|
||||
url += protocol;
|
||||
if (!protocol.endsWith(':')) {
|
||||
url += ':';
|
||||
}
|
||||
@ -144,7 +137,7 @@ class NetworkStorage {
|
||||
if (!search.startsWith('?')) {
|
||||
url += '?';
|
||||
}
|
||||
url += `${search}`;
|
||||
url += search;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
14
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkUtils.d.ts
generated
vendored
14
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkUtils.d.ts
generated
vendored
@ -2,7 +2,7 @@
|
||||
* @fileoverview Utility functions for the Network domain.
|
||||
*/
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import type { Network } from '../../../protocol/protocol.js';
|
||||
import { Network, type Storage } from '../../../protocol/protocol.js';
|
||||
export declare function computeHeadersSize(headers: Network.Header[]): number;
|
||||
/** Converts from CDP Network domain headers to Bidi network headers. */
|
||||
export declare function bidiNetworkHeadersFromCdpNetworkHeaders(headers?: Protocol.Network.Headers): Network.Header[];
|
||||
@ -14,3 +14,15 @@ export declare function bidiNetworkHeadersFromCdpFetchHeaders(headers?: Protocol
|
||||
export declare function cdpFetchHeadersFromBidiNetworkHeaders(headers?: Network.Header[]): Protocol.Fetch.HeaderEntry[] | undefined;
|
||||
/** Converts from Bidi auth action to CDP auth challenge response. */
|
||||
export declare function cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction(action: 'default' | 'cancel' | 'provideCredentials'): "Default" | "CancelAuth" | "ProvideCredentials";
|
||||
/**
|
||||
* Converts from CDP Network domain cookie to BiDi network cookie.
|
||||
* * https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Cookie
|
||||
* * https://w3c.github.io/webdriver-bidi/#type-network-Cookie
|
||||
*/
|
||||
export declare function cdpToBiDiCookie(cookie: Protocol.Network.Cookie): Network.Cookie;
|
||||
/**
|
||||
* Converts from BiDi set network cookie params to CDP Network domain cookie.
|
||||
* * https://w3c.github.io/webdriver-bidi/#type-network-Cookie
|
||||
* * https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-CookieParam
|
||||
*/
|
||||
export declare function bidiToCdpCookie(params: Storage.SetCookieParameters, partitionKey: Storage.PartitionKey): Protocol.Network.CookieParam;
|
||||
|
||||
110
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkUtils.js
generated
vendored
110
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/network/NetworkUtils.js
generated
vendored
@ -17,7 +17,8 @@
|
||||
*
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction = exports.cdpFetchHeadersFromBidiNetworkHeaders = exports.bidiNetworkHeadersFromCdpFetchHeaders = exports.cdpNetworkHeadersFromBidiNetworkHeaders = exports.bidiNetworkHeadersFromCdpNetworkHeaders = exports.computeHeadersSize = void 0;
|
||||
exports.bidiToCdpCookie = exports.cdpToBiDiCookie = exports.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction = exports.cdpFetchHeadersFromBidiNetworkHeaders = exports.bidiNetworkHeadersFromCdpFetchHeaders = exports.cdpNetworkHeadersFromBidiNetworkHeaders = exports.bidiNetworkHeadersFromCdpNetworkHeaders = exports.computeHeadersSize = void 0;
|
||||
const ErrorResponse_1 = require("../../../protocol/ErrorResponse");
|
||||
function computeHeadersSize(headers) {
|
||||
const requestHeaders = headers.reduce((acc, header) => {
|
||||
return `${acc}${header.name}: ${header.value.value}\r\n`;
|
||||
@ -88,4 +89,111 @@ function cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction(action) {
|
||||
}
|
||||
}
|
||||
exports.cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction = cdpAuthChallengeResponseFromBidiAuthContinueWithAuthAction;
|
||||
/**
|
||||
* Converts from CDP Network domain cookie to BiDi network cookie.
|
||||
* * https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Cookie
|
||||
* * https://w3c.github.io/webdriver-bidi/#type-network-Cookie
|
||||
*/
|
||||
function cdpToBiDiCookie(cookie) {
|
||||
const result = {
|
||||
name: cookie.name,
|
||||
value: { type: 'string', value: cookie.value },
|
||||
domain: cookie.domain,
|
||||
path: cookie.path,
|
||||
size: cookie.size,
|
||||
httpOnly: cookie.httpOnly,
|
||||
secure: cookie.secure,
|
||||
sameSite: cookie.sameSite === undefined
|
||||
? "none" /* Network.SameSite.None */
|
||||
: sameSiteCdpToBiDi(cookie.sameSite),
|
||||
...(cookie.expires >= 0 ? { expiry: cookie.expires } : undefined),
|
||||
};
|
||||
// Extending with CDP-specific properties with `goog:` prefix.
|
||||
result[`goog:session`] = cookie.session;
|
||||
result[`goog:priority`] = cookie.priority;
|
||||
result[`goog:sameParty`] = cookie.sameParty;
|
||||
result[`goog:sourceScheme`] = cookie.sourceScheme;
|
||||
result[`goog:sourcePort`] = cookie.sourcePort;
|
||||
if (cookie.partitionKey !== undefined) {
|
||||
result[`goog:partitionKey`] = cookie.partitionKey;
|
||||
}
|
||||
if (cookie.partitionKeyOpaque !== undefined) {
|
||||
result[`goog:partitionKeyOpaque`] = cookie.partitionKeyOpaque;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.cdpToBiDiCookie = cdpToBiDiCookie;
|
||||
/**
|
||||
* Converts from BiDi set network cookie params to CDP Network domain cookie.
|
||||
* * https://w3c.github.io/webdriver-bidi/#type-network-Cookie
|
||||
* * https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-CookieParam
|
||||
*/
|
||||
function bidiToCdpCookie(params, partitionKey) {
|
||||
if (params.cookie.value.type !== 'string') {
|
||||
// CDP supports only string values in cookies.
|
||||
throw new ErrorResponse_1.UnsupportedOperationException('Only string cookie values are supported');
|
||||
}
|
||||
const deserializedValue = params.cookie.value.value;
|
||||
const result = {
|
||||
name: params.cookie.name,
|
||||
value: deserializedValue,
|
||||
domain: params.cookie.domain,
|
||||
path: params.cookie.path ?? '/',
|
||||
secure: params.cookie.secure ?? false,
|
||||
httpOnly: params.cookie.httpOnly ?? false,
|
||||
// CDP's `partitionKey` is the BiDi's `partition.sourceOrigin`.
|
||||
...(partitionKey.sourceOrigin !== undefined && {
|
||||
partitionKey: partitionKey.sourceOrigin,
|
||||
}),
|
||||
...(params.cookie.expiry !== undefined && {
|
||||
expires: params.cookie.expiry,
|
||||
}),
|
||||
...(params.cookie.sameSite !== undefined && {
|
||||
sameSite: sameSiteBiDiToCdp(params.cookie.sameSite),
|
||||
}),
|
||||
};
|
||||
// Extending with CDP-specific properties with `goog:` prefix.
|
||||
if (params.cookie[`goog:url`] !== undefined) {
|
||||
result.url = params.cookie[`goog:url`];
|
||||
}
|
||||
if (params.cookie[`goog:priority`] !== undefined) {
|
||||
result.priority = params.cookie[`goog:priority`];
|
||||
}
|
||||
if (params.cookie[`goog:sameParty`] !== undefined) {
|
||||
result.sameParty = params.cookie[`goog:sameParty`];
|
||||
}
|
||||
if (params.cookie[`goog:sourceScheme`] !== undefined) {
|
||||
result.sourceScheme = params.cookie[`goog:sourceScheme`];
|
||||
}
|
||||
if (params.cookie[`goog:sourcePort`] !== undefined) {
|
||||
result.sourcePort = params.cookie[`goog:sourcePort`];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.bidiToCdpCookie = bidiToCdpCookie;
|
||||
function sameSiteCdpToBiDi(sameSite) {
|
||||
switch (sameSite) {
|
||||
case 'Strict':
|
||||
return "strict" /* Network.SameSite.Strict */;
|
||||
case 'None':
|
||||
return "none" /* Network.SameSite.None */;
|
||||
case 'Lax':
|
||||
return "lax" /* Network.SameSite.Lax */;
|
||||
default:
|
||||
// Defaults to `Lax`:
|
||||
// https://web.dev/articles/samesite-cookies-explained#samesitelax_by_default
|
||||
return "lax" /* Network.SameSite.Lax */;
|
||||
}
|
||||
}
|
||||
function sameSiteBiDiToCdp(sameSite) {
|
||||
switch (sameSite) {
|
||||
case "strict" /* Network.SameSite.Strict */:
|
||||
return 'Strict';
|
||||
case "lax" /* Network.SameSite.Lax */:
|
||||
return 'Lax';
|
||||
case "none" /* Network.SameSite.None */:
|
||||
return 'None';
|
||||
}
|
||||
throw new ErrorResponse_1.InvalidArgumentException(`Unknown 'sameSite' value ${sameSite}`);
|
||||
}
|
||||
//# sourceMappingURL=NetworkUtils.js.map
|
||||
File diff suppressed because one or more lines are too long
23
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.d.ts
generated
vendored
Normal file
23
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.d.ts
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import { type EmptyResult, type Permissions } from '../../../protocol/protocol.js';
|
||||
export declare class PermissionsProcessor {
|
||||
#private;
|
||||
constructor(browserCdpClient: CdpClient);
|
||||
setPermissions(params: Permissions.SetPermissionParameters): Promise<EmptyResult>;
|
||||
}
|
||||
49
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.js
generated
vendored
Normal file
49
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PermissionsProcessor = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
class PermissionsProcessor {
|
||||
#browserCdpClient;
|
||||
constructor(browserCdpClient) {
|
||||
this.#browserCdpClient = browserCdpClient;
|
||||
}
|
||||
async setPermissions(params) {
|
||||
try {
|
||||
await this.#browserCdpClient.sendCommand('Browser.setPermission', {
|
||||
origin: params.origin,
|
||||
permission: {
|
||||
name: params.descriptor.name,
|
||||
},
|
||||
setting: params.state,
|
||||
});
|
||||
}
|
||||
catch (err) {
|
||||
if (err.message ===
|
||||
`Permission can't be granted to opaque origins.`) {
|
||||
// Return success if the origin is not valid (does not match any
|
||||
// existing origins).
|
||||
return {};
|
||||
}
|
||||
throw new protocol_js_1.InvalidArgumentException(err.message);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
}
|
||||
exports.PermissionsProcessor = PermissionsProcessor;
|
||||
//# sourceMappingURL=PermissionsProcessor.js.map
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/permissions/PermissionsProcessor.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"PermissionsProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/permissions/PermissionsProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAGH,+DAIuC;AAEvC,MAAa,oBAAoB;IAC/B,iBAAiB,CAAY;IAE7B,YAAY,gBAA2B;QACrC,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,MAA2C;QAE3C,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,uBAAuB,EAAE;gBAChE,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,UAAU,EAAE;oBACV,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,IAAI;iBAC7B;gBACD,OAAO,EAAE,MAAM,CAAC,KAAK;aACtB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IACG,GAAa,CAAC,OAAO;gBACtB,gDAAgD,EAChD,CAAC;gBACD,gEAAgE;gBAChE,qBAAqB;gBACrB,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,MAAM,IAAI,sCAAwB,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AA/BD,oDA+BC"}
|
||||
@ -1,6 +1,6 @@
|
||||
import { Script } from '../../../protocol/protocol.js';
|
||||
import { type LoggerFn } from '../../../utils/log.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import type { Realm } from './Realm.js';
|
||||
/**
|
||||
* Used to send messages from realm to BiDi user.
|
||||
|
||||
21
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/ChannelProxy.js
generated
vendored
21
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/ChannelProxy.js
generated
vendored
@ -141,18 +141,17 @@ class ChannelProxy {
|
||||
if (message.exceptionDetails) {
|
||||
throw message.exceptionDetails;
|
||||
}
|
||||
eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Script.EventNames.Message,
|
||||
params: {
|
||||
channel: this.#properties.channel,
|
||||
data: realm.cdpToBidiValue(message, this.#properties.ownership ?? "none" /* Script.ResultOwnership.None */),
|
||||
source: {
|
||||
realm: realm.realmId,
|
||||
context: realm.browsingContextId,
|
||||
for (const browsingContext of realm.associatedBrowsingContexts) {
|
||||
eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Script.EventNames.Message,
|
||||
params: {
|
||||
channel: this.#properties.channel,
|
||||
data: realm.cdpToBidiValue(message, this.#properties.ownership ?? "none" /* Script.ResultOwnership.None */),
|
||||
source: realm.source,
|
||||
},
|
||||
},
|
||||
}, realm.browsingContextId);
|
||||
}, browsingContext.id);
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
// If an error is thrown, then the channel is permanently broken, so we
|
||||
|
||||
File diff suppressed because one or more lines are too long
32
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/DedicatedWorkerRealm.d.ts
generated
vendored
Normal file
32
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/DedicatedWorkerRealm.d.ts
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import type { Script } from '../../../protocol/protocol.js';
|
||||
import type { LoggerFn } from '../../../utils/log.js';
|
||||
import type { BrowsingContextImpl } from '../context/BrowsingContextImpl.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import { Realm } from './Realm.js';
|
||||
import type { RealmStorage } from './RealmStorage.js';
|
||||
export declare class DedicatedWorkerRealm extends Realm {
|
||||
#private;
|
||||
constructor(cdpClient: CdpClient, eventManager: EventManager, executionContextId: Protocol.Runtime.ExecutionContextId, logger: LoggerFn | undefined, origin: string, ownerRealm: Realm, realmId: Script.Realm, realmStorage: RealmStorage);
|
||||
get associatedBrowsingContexts(): BrowsingContextImpl[];
|
||||
get realmType(): 'dedicated-worker';
|
||||
get source(): Script.Source;
|
||||
get realmInfo(): Script.DedicatedWorkerRealmInfo;
|
||||
}
|
||||
51
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/DedicatedWorkerRealm.js
generated
vendored
Normal file
51
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/DedicatedWorkerRealm.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DedicatedWorkerRealm = void 0;
|
||||
const Realm_js_1 = require("./Realm.js");
|
||||
class DedicatedWorkerRealm extends Realm_js_1.Realm {
|
||||
#ownerRealm;
|
||||
constructor(cdpClient, eventManager, executionContextId, logger, origin, ownerRealm, realmId, realmStorage) {
|
||||
super(cdpClient, eventManager, executionContextId, logger, origin, realmId, realmStorage);
|
||||
this.#ownerRealm = ownerRealm;
|
||||
this.initialize();
|
||||
}
|
||||
get associatedBrowsingContexts() {
|
||||
return this.#ownerRealm.associatedBrowsingContexts;
|
||||
}
|
||||
get realmType() {
|
||||
return 'dedicated-worker';
|
||||
}
|
||||
get source() {
|
||||
return {
|
||||
realm: this.realmId,
|
||||
// This is a hack to make Puppeteer able to track workers.
|
||||
// TODO: remove after Puppeteer tracks workers by owners and use the base version.
|
||||
context: this.associatedBrowsingContexts[0]?.id,
|
||||
};
|
||||
}
|
||||
get realmInfo() {
|
||||
return {
|
||||
...this.baseInfo,
|
||||
type: this.realmType,
|
||||
owners: [this.#ownerRealm.realmId],
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.DedicatedWorkerRealm = DedicatedWorkerRealm;
|
||||
//# sourceMappingURL=DedicatedWorkerRealm.js.map
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/DedicatedWorkerRealm.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/DedicatedWorkerRealm.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"DedicatedWorkerRealm.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/DedicatedWorkerRealm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAUH,yCAAiC;AAGjC,MAAa,oBAAqB,SAAQ,gBAAK;IACpC,WAAW,CAAQ;IAE5B,YACE,SAAoB,EACpB,YAA0B,EAC1B,kBAAuD,EACvD,MAA4B,EAC5B,MAAc,EACd,UAAiB,EACjB,OAAqB,EACrB,YAA0B;QAE1B,KAAK,CACH,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,CACb,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAE9B,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,IAAa,0BAA0B;QACrC,OAAO,IAAI,CAAC,WAAW,CAAC,0BAA0B,CAAC;IACrD,CAAC;IAED,IAAa,SAAS;QACpB,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAED,IAAa,MAAM;QACjB,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,OAAO;YACnB,0DAA0D;YAC1D,kFAAkF;YAClF,OAAO,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE;SAChD,CAAC;IACJ,CAAC;IAED,IAAa,SAAS;QACpB,OAAO;YACL,GAAG,IAAI,CAAC,QAAQ;YAChB,IAAI,EAAE,IAAI,CAAC,SAAS;YACpB,MAAM,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;SACnC,CAAC;IACJ,CAAC;CACF;AApDD,oDAoDC"}
|
||||
@ -100,7 +100,7 @@ class PreloadScript {
|
||||
target: cdpTarget,
|
||||
preloadScriptId: addCdpPreloadScriptResult.identifier,
|
||||
});
|
||||
this.#targetIds.add(cdpTarget.targetId);
|
||||
this.#targetIds.add(cdpTarget.id);
|
||||
}
|
||||
/**
|
||||
* Removes this script from all CDP targets.
|
||||
@ -116,7 +116,7 @@ class PreloadScript {
|
||||
}
|
||||
/** Removes the provided cdp target from the list of cdp preload scripts. */
|
||||
dispose(cdpTargetId) {
|
||||
this.#cdpPreloadScripts = this.#cdpPreloadScripts.filter((cdpPreloadScript) => cdpPreloadScript.target?.targetId !== cdpTargetId);
|
||||
this.#cdpPreloadScripts = this.#cdpPreloadScripts.filter((cdpPreloadScript) => cdpPreloadScript.target?.id !== cdpTargetId);
|
||||
this.#targetIds.delete(cdpTargetId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"PreloadScript.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/PreloadScript.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAMH,oDAA8C;AAG9C,uDAA+C;AAS/C;;;;;;;;;GASG;AACH,MAAa,aAAa;IACxB,gDAAgD;IACvC,GAAG,GAAW,IAAA,gBAAM,GAAE,CAAC;IAChC,2BAA2B;IAC3B,kBAAkB,GAAuB,EAAE,CAAC;IAC5C,2EAA2E;IAClE,oBAAoB,CAAS;IACtC,2DAA2D;IAClD,UAAU,GAAG,IAAI,GAAG,EAA4B,CAAC;IAC1D,gEAAgE;IACvD,SAAS,CAAiB;IACnC,uCAAuC;IAC9B,QAAQ,CAAU;IAC3B,uEAAuE;IAC9D,SAAS,CAAqC;IAEvD,IAAI,EAAE;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,YAAY,MAAyC,EAAE,MAAiB;QACtE,IAAI,CAAC,SAAS;YACZ,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,C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AAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC3B,MAAM,EAAE,SAAS;YACjB,eAAe,EAAE,yBAAyB,CAAC,UAAU;SACtD,CAAC,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM;QACV,KAAK,MAAM,gBAAgB,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACvD,MAAM,SAAS,GAAG,gBAAgB,CAAC,MAAM,CAAC;YAC1C,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,CAAC;YAC5D,MAAM,SAAS,CAAC,SAAS,CAAC,WAAW,CACnC,0CAA0C,EAC1C;gBACE,UAAU,EAAE,kBAAkB;aAC/B,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,4EAA4E;IAC5E,OAAO,CAAC,WAAqC;QAC3C,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CACtD,CAAC,gBAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,EAAE,QAAQ,KAAK,WAAW,CACxE,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CACF;AApHD,sCAoHC"}
|
||||
{"version":3,"file":"PreloadScript.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/PreloadScript.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAMH,oDAA8C;AAG9C,uDAA+C;AAS/C;;;;;;;;;GASG;AACH,MAAa,aAAa;IACxB,gDAAgD;IACvC,GAAG,GAAW,IAAA,gBAAM,GAAE,CAAC;IAChC,2BAA2B;IAC3B,kBAAkB,GAAuB,EAAE,CAAC;IAC5C,2EAA2E;IAClE,oBAAoB,CAAS;IACtC,2DAA2D;IAClD,UAAU,GAAG,IAAI,GAAG,EAA4B,CAAC;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} from '../context/CdpTarget.js';
|
||||
import type { PreloadScript } from './PreloadScript.js';
|
||||
/** PreloadScripts can be filtered by BiDi ID or target ID. */
|
||||
export type PreloadScriptFilter = Partial<Pick<PreloadScript, 'id'> & Pick<CdpTarget, 'targetId'> & {
|
||||
export type PreloadScriptFilter = Partial<{
|
||||
id: PreloadScript['id'];
|
||||
targetId: CdpTarget['id'];
|
||||
global: boolean;
|
||||
}>;
|
||||
/**
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"PreloadScriptStorage.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/PreloadScriptStorage.ts"],"names":[],"mappings":";;;AA4BA;;GAEG;AACH,MAAa,oBAAoB;IAC/B,wCAAwC;IAC/B,QAAQ,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE7C,qDAAqD;IACrD,IAAI,CAAC,MAA4B;QAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1C,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC;gBACvD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IACE,MAAM,CAAC,QAAQ,KAAK,SAAS;gBAC7B,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EACtC,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IACE,MAAM,CAAC,MAAM,KAAK,SAAS;gBAC3B,kCAAkC;gBAClC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC;oBAC/C,0CAA0C;oBAC1C,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,EACpD,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,aAA4B;QAC9B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED,2EAA2E;IAC3E,MAAM,CAAC,MAA4B;QACjC,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AA3CD,oDA2CC"}
|
||||
{"version":3,"file":"PreloadScriptStorage.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/PreloadScriptStorage.ts"],"names":[],"mappings":";;;AA2BA;;GAEG;AACH,MAAa,oBAAoB;IAC/B,wCAAwC;IAC/B,QAAQ,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE7C,qDAAqD;IACrD,IAAI,CAAC,MAA4B;QAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;QAED,OAAO,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;YAC1C,IAAI,MAAM,CAAC,EAAE,KAAK,SAAS,IAAI,MAAM,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC;gBACvD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IACE,MAAM,CAAC,QAAQ,KAAK,SAAS;gBAC7B,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,EACtC,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,IACE,MAAM,CAAC,MAAM,KAAK,SAAS;gBAC3B,kCAAkC;gBAClC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC;oBAC/C,0CAA0C;oBAC1C,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,EACpD,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED,GAAG,CAAC,aAA4B;QAC9B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED,2EAA2E;IAC3E,MAAM,CAAC,MAA4B;QACjC,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF;AA3CD,oDA2CC"}
|
||||
38
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/Realm.d.ts
generated
vendored
38
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/Realm.d.ts
generated
vendored
@ -15,26 +15,39 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Protocol } from 'devtools-protocol';
|
||||
import type { ICdpClient } from '../../../cdp/CdpClient.js';
|
||||
import { type BrowsingContext, Script } from '../../../protocol/protocol.js';
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import { Script } from '../../../protocol/protocol.js';
|
||||
import { type LoggerFn } from '../../../utils/log.js';
|
||||
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { BrowsingContextImpl } from '../context/BrowsingContextImpl.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import type { RealmStorage } from './RealmStorage.js';
|
||||
export declare class Realm {
|
||||
export declare abstract class Realm {
|
||||
#private;
|
||||
readonly sandbox?: string;
|
||||
constructor(realmStorage: RealmStorage, browsingContextStorage: BrowsingContextStorage, realmId: Script.Realm, browsingContextId: BrowsingContext.BrowsingContext, executionContextId: Protocol.Runtime.ExecutionContextId, origin: string, type: Script.RealmType, sandbox: string | undefined, cdpClient: ICdpClient, eventManager: EventManager, logger?: LoggerFn);
|
||||
constructor(cdpClient: CdpClient, eventManager: EventManager, executionContextId: Protocol.Runtime.ExecutionContextId, logger: LoggerFn | undefined, origin: string, realmId: Script.Realm, realmStorage: RealmStorage);
|
||||
cdpToBidiValue(cdpValue: Protocol.Runtime.CallFunctionOnResponse | Protocol.Runtime.EvaluateResponse, resultOwnership: Script.ResultOwnership): Script.RemoteValue;
|
||||
/**
|
||||
* Relies on the CDP to implement proper BiDi serialization, except:
|
||||
* * CDP integer property `backendNodeId` is replaced with `sharedId` of
|
||||
* `{documentId}_element_{backendNodeId}`;
|
||||
* * CDP integer property `weakLocalObjectReference` is replaced with UUID `internalId`
|
||||
* using unique-per serialization `internalIdMap`.
|
||||
* * CDP type `platformobject` is replaced with `object`.
|
||||
* @param deepSerializedValue - CDP value to be converted to BiDi.
|
||||
* @param internalIdMap - Map from CDP integer `weakLocalObjectReference` to BiDi UUID
|
||||
* `internalId`.
|
||||
*/
|
||||
protected serializeForBiDi(deepSerializedValue: Protocol.Runtime.DeepSerializedValue, internalIdMap: Map<number, string>): Script.RemoteValue;
|
||||
get realmId(): Script.Realm;
|
||||
get navigableId(): string;
|
||||
get browsingContextId(): BrowsingContext.BrowsingContext;
|
||||
get executionContextId(): Protocol.Runtime.ExecutionContextId;
|
||||
get origin(): string;
|
||||
get type(): Script.RealmType;
|
||||
get cdpClient(): ICdpClient;
|
||||
get realmInfo(): Script.RealmInfo;
|
||||
get source(): Script.Source;
|
||||
get cdpClient(): CdpClient;
|
||||
abstract get associatedBrowsingContexts(): BrowsingContextImpl[];
|
||||
abstract get realmType(): Script.RealmType;
|
||||
protected get baseInfo(): Script.BaseRealmInfo;
|
||||
abstract get realmInfo(): Script.RealmInfo;
|
||||
evaluate(expression: string, awaitPromise: boolean, resultOwnership: Script.ResultOwnership, serializationOptions: Script.SerializationOptions, userActivation?: boolean): Promise<Script.EvaluateResult>;
|
||||
protected initialize(): void;
|
||||
/**
|
||||
* Serializes a given CDP object into BiDi, keeping references in the
|
||||
* target's `globalThis`.
|
||||
@ -46,6 +59,7 @@ export declare class Realm {
|
||||
*/
|
||||
stringifyObject(cdpRemoteObject: Protocol.Runtime.RemoteObject): Promise<string>;
|
||||
callFunction(functionDeclaration: string, thisLocalValue: Script.LocalValue, argumentsLocalValues: Script.LocalValue[], awaitPromise: boolean, resultOwnership: Script.ResultOwnership, serializationOptions: Script.SerializationOptions, userActivation?: boolean): Promise<Script.EvaluateResult>;
|
||||
deserializeForCdp(localValue: Script.LocalValue): Promise<Protocol.Runtime.CallArgument>;
|
||||
disown(handle: Script.Handle): Promise<void>;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
173
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/Realm.js
generated
vendored
173
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/Realm.js
generated
vendored
@ -5,40 +5,26 @@ const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const log_js_1 = require("../../../utils/log.js");
|
||||
const uuid_js_1 = require("../../../utils/uuid.js");
|
||||
const ChannelProxy_js_1 = require("./ChannelProxy.js");
|
||||
const SHARED_ID_DIVIDER = '_element_';
|
||||
class Realm {
|
||||
#realmStorage;
|
||||
#browsingContextStorage;
|
||||
#realmId;
|
||||
#browsingContextId;
|
||||
#executionContextId;
|
||||
#origin;
|
||||
#type;
|
||||
#cdpClient;
|
||||
#eventManager;
|
||||
sandbox;
|
||||
#executionContextId;
|
||||
#logger;
|
||||
constructor(realmStorage, browsingContextStorage, realmId, browsingContextId, executionContextId, origin, type, sandbox, cdpClient, eventManager, logger) {
|
||||
this.#realmId = realmId;
|
||||
this.#browsingContextId = browsingContextId;
|
||||
this.#executionContextId = executionContextId;
|
||||
this.sandbox = sandbox;
|
||||
this.#origin = origin;
|
||||
this.#type = type;
|
||||
#origin;
|
||||
#realmId;
|
||||
#realmStorage;
|
||||
constructor(cdpClient, eventManager, executionContextId, logger, origin, realmId, realmStorage) {
|
||||
this.#cdpClient = cdpClient;
|
||||
this.#realmStorage = realmStorage;
|
||||
this.#browsingContextStorage = browsingContextStorage;
|
||||
this.#eventManager = eventManager;
|
||||
this.#executionContextId = executionContextId;
|
||||
this.#logger = logger;
|
||||
this.#origin = origin;
|
||||
this.#realmId = realmId;
|
||||
this.#realmStorage = realmStorage;
|
||||
this.#realmStorage.addRealm(this);
|
||||
this.#eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Script.EventNames.RealmCreated,
|
||||
params: this.realmInfo,
|
||||
}, this.browsingContextId);
|
||||
}
|
||||
cdpToBidiValue(cdpValue, resultOwnership) {
|
||||
const bidiValue = this.#deepSerializedToBiDi(cdpValue.result.deepSerializedValue, new Map());
|
||||
const bidiValue = this.serializeForBiDi(cdpValue.result.deepSerializedValue, new Map());
|
||||
if (cdpValue.result.objectId) {
|
||||
const objectId = cdpValue.result.objectId;
|
||||
if (resultOwnership === "root" /* Script.ResultOwnership.Root */) {
|
||||
@ -77,7 +63,7 @@ class Realm {
|
||||
* @param internalIdMap - Map from CDP integer `weakLocalObjectReference` to BiDi UUID
|
||||
* `internalId`.
|
||||
*/
|
||||
#deepSerializedToBiDi(deepSerializedValue, internalIdMap) {
|
||||
serializeForBiDi(deepSerializedValue, internalIdMap) {
|
||||
if (Object.hasOwn(deepSerializedValue, 'weakLocalObjectReference')) {
|
||||
const weakLocalObjectReference = deepSerializedValue.weakLocalObjectReference;
|
||||
if (!internalIdMap.has(weakLocalObjectReference)) {
|
||||
@ -95,37 +81,17 @@ class Realm {
|
||||
if (bidiValue === undefined) {
|
||||
return deepSerializedValue;
|
||||
}
|
||||
if (deepSerializedValue.type === 'node') {
|
||||
if (Object.hasOwn(bidiValue, 'backendNodeId')) {
|
||||
deepSerializedValue.sharedId =
|
||||
`${this.navigableId}${SHARED_ID_DIVIDER}${bidiValue.backendNodeId}`;
|
||||
delete bidiValue['backendNodeId'];
|
||||
}
|
||||
if (Object.hasOwn(bidiValue, 'children')) {
|
||||
for (const i in bidiValue.children) {
|
||||
bidiValue.children[i] = this.#deepSerializedToBiDi(bidiValue.children[i], internalIdMap);
|
||||
}
|
||||
}
|
||||
if (Object.hasOwn(bidiValue, 'shadowRoot') &&
|
||||
bidiValue.shadowRoot !== null) {
|
||||
bidiValue.shadowRoot = this.#deepSerializedToBiDi(bidiValue.shadowRoot, internalIdMap);
|
||||
}
|
||||
// `namespaceURI` can be is either `null` or non-empty string.
|
||||
if (bidiValue.namespaceURI === '') {
|
||||
bidiValue.namespaceURI = null;
|
||||
}
|
||||
}
|
||||
// Recursively update the nested values.
|
||||
if (['array', 'set', 'htmlcollection', 'nodelist'].includes(deepSerializedValue.type)) {
|
||||
for (const i in bidiValue) {
|
||||
bidiValue[i] = this.#deepSerializedToBiDi(bidiValue[i], internalIdMap);
|
||||
bidiValue[i] = this.serializeForBiDi(bidiValue[i], internalIdMap);
|
||||
}
|
||||
}
|
||||
if (['object', 'map'].includes(deepSerializedValue.type)) {
|
||||
for (const i in bidiValue) {
|
||||
bidiValue[i] = [
|
||||
this.#deepSerializedToBiDi(bidiValue[i][0], internalIdMap),
|
||||
this.#deepSerializedToBiDi(bidiValue[i][1], internalIdMap),
|
||||
this.serializeForBiDi(bidiValue[i][0], internalIdMap),
|
||||
this.serializeForBiDi(bidiValue[i][1], internalIdMap),
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -134,49 +100,27 @@ class Realm {
|
||||
get realmId() {
|
||||
return this.#realmId;
|
||||
}
|
||||
get navigableId() {
|
||||
return ((this.browsingContextId &&
|
||||
this.#browsingContextStorage.findContext(this.browsingContextId)
|
||||
?.navigableId) ??
|
||||
'UNKNOWN');
|
||||
}
|
||||
get browsingContextId() {
|
||||
return this.#browsingContextId;
|
||||
}
|
||||
get executionContextId() {
|
||||
return this.#executionContextId;
|
||||
}
|
||||
get origin() {
|
||||
return this.#origin;
|
||||
}
|
||||
get type() {
|
||||
return this.#type;
|
||||
get source() {
|
||||
return {
|
||||
realm: this.realmId,
|
||||
};
|
||||
}
|
||||
get cdpClient() {
|
||||
return this.#cdpClient;
|
||||
}
|
||||
get realmInfo() {
|
||||
switch (this.type) {
|
||||
case 'window':
|
||||
return {
|
||||
realm: this.realmId,
|
||||
origin: this.origin,
|
||||
type: this.type,
|
||||
context: this.browsingContextId,
|
||||
...(this.sandbox === undefined ? {} : { sandbox: this.sandbox }),
|
||||
};
|
||||
default:
|
||||
return {
|
||||
realm: this.realmId,
|
||||
origin: this.origin,
|
||||
type: this.type,
|
||||
};
|
||||
}
|
||||
get baseInfo() {
|
||||
return {
|
||||
realm: this.realmId,
|
||||
origin: this.origin,
|
||||
};
|
||||
}
|
||||
async evaluate(expression, awaitPromise, resultOwnership, serializationOptions, userActivation = false) {
|
||||
await this.#browsingContextStorage
|
||||
.getContext(this.browsingContextId)
|
||||
.targetUnblockedOrThrow();
|
||||
const cdpEvaluateResult = await this.cdpClient.sendCommand('Runtime.evaluate', {
|
||||
contextId: this.executionContextId,
|
||||
expression,
|
||||
@ -193,6 +137,15 @@ class Realm {
|
||||
type: 'success',
|
||||
};
|
||||
}
|
||||
initialize() {
|
||||
for (const browsingContext of this.associatedBrowsingContexts) {
|
||||
this.#eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Script.EventNames.RealmCreated,
|
||||
params: this.realmInfo,
|
||||
}, browsingContext.id);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Serializes a given CDP object into BiDi, keeping references in the
|
||||
* target's `globalThis`.
|
||||
@ -243,16 +196,16 @@ class Realm {
|
||||
}
|
||||
else {
|
||||
// Key is a serialized value.
|
||||
keyArg = await this.#deserializeToCdpArg(key);
|
||||
keyArg = await this.deserializeForCdp(key);
|
||||
}
|
||||
const valueArg = await this.#deserializeToCdpArg(value);
|
||||
const valueArg = await this.deserializeForCdp(value);
|
||||
keyValueArray.push(keyArg);
|
||||
keyValueArray.push(valueArg);
|
||||
}
|
||||
return keyValueArray;
|
||||
}
|
||||
async #flattenValueList(listLocalValue) {
|
||||
return await Promise.all(listLocalValue.map((localValue) => this.#deserializeToCdpArg(localValue)));
|
||||
return await Promise.all(listLocalValue.map((localValue) => this.deserializeForCdp(localValue)));
|
||||
}
|
||||
async #serializeCdpExceptionDetails(cdpExceptionDetails, lineOffset, resultOwnership) {
|
||||
const callFrames = cdpExceptionDetails.stackTrace?.callFrames.map((frame) => ({
|
||||
@ -274,9 +227,6 @@ class Realm {
|
||||
};
|
||||
}
|
||||
async callFunction(functionDeclaration, thisLocalValue, argumentsLocalValues, awaitPromise, resultOwnership, serializationOptions, userActivation = false) {
|
||||
await this.#browsingContextStorage
|
||||
.getContext(this.browsingContextId)
|
||||
.targetUnblockedOrThrow();
|
||||
const callFunctionAndSerializeScript = `(...args) => {
|
||||
function callFunction(f, args) {
|
||||
const deserializedThis = args.shift();
|
||||
@ -288,8 +238,8 @@ class Realm {
|
||||
), args);
|
||||
}`;
|
||||
const thisAndArgumentsList = [
|
||||
await this.#deserializeToCdpArg(thisLocalValue),
|
||||
...(await Promise.all(argumentsLocalValues.map(async (argumentLocalValue) => await this.#deserializeToCdpArg(argumentLocalValue)))),
|
||||
await this.deserializeForCdp(thisLocalValue),
|
||||
...(await Promise.all(argumentsLocalValues.map(async (argumentLocalValue) => await this.deserializeForCdp(argumentLocalValue)))),
|
||||
];
|
||||
let cdpCallFunctionResult;
|
||||
try {
|
||||
@ -325,37 +275,8 @@ class Realm {
|
||||
realm: this.realmId,
|
||||
};
|
||||
}
|
||||
async #deserializeToCdpArg(localValue) {
|
||||
if ('sharedId' in localValue && localValue.sharedId) {
|
||||
const [navigableId, rawBackendNodeId] = localValue.sharedId.split(SHARED_ID_DIVIDER);
|
||||
const backendNodeId = parseInt(rawBackendNodeId ?? '');
|
||||
if (isNaN(backendNodeId) ||
|
||||
backendNodeId === undefined ||
|
||||
navigableId === undefined) {
|
||||
throw new protocol_js_1.NoSuchNodeException(`SharedId "${localValue.sharedId}" was not found.`);
|
||||
}
|
||||
if (this.navigableId !== navigableId) {
|
||||
throw new protocol_js_1.NoSuchNodeException(`SharedId "${localValue.sharedId}" belongs to different document. Current document is ${this.navigableId}.`);
|
||||
}
|
||||
try {
|
||||
const { object } = await this.cdpClient.sendCommand('DOM.resolveNode', {
|
||||
backendNodeId,
|
||||
executionContextId: this.executionContextId,
|
||||
});
|
||||
// TODO(#375): Release `obj.object.objectId` after using.
|
||||
return { objectId: object.objectId };
|
||||
}
|
||||
catch (error) {
|
||||
// Heuristic to detect "no such node" exception. Based on the specific
|
||||
// CDP implementation.
|
||||
if (error.code === -32000 /* CdpErrorConstants.GENERIC_ERROR */ &&
|
||||
error.message === 'No node with given id found') {
|
||||
throw new protocol_js_1.NoSuchNodeException(`SharedId "${localValue.sharedId}" was not found.`);
|
||||
}
|
||||
throw new protocol_js_1.UnknownErrorException(error.message, error.stack);
|
||||
}
|
||||
}
|
||||
else if ('handle' in localValue && localValue.handle) {
|
||||
async deserializeForCdp(localValue) {
|
||||
if ('handle' in localValue && localValue.handle) {
|
||||
return { objectId: localValue.handle };
|
||||
// We tried to find a handle value but failed
|
||||
// This allows us to have exhaustive switch on `localValue.type`
|
||||
@ -538,13 +459,15 @@ class Realm {
|
||||
this.#realmStorage.knownHandlesToRealmMap.delete(handle);
|
||||
}
|
||||
dispose() {
|
||||
this.#eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Script.EventNames.RealmDestroyed,
|
||||
params: {
|
||||
realm: this.realmId,
|
||||
},
|
||||
}, this.browsingContextId);
|
||||
for (const browsingContext of this.associatedBrowsingContexts) {
|
||||
this.#eventManager.registerEvent({
|
||||
type: 'event',
|
||||
method: protocol_js_1.ChromiumBidi.Script.EventNames.RealmDestroyed,
|
||||
params: {
|
||||
realm: this.realmId,
|
||||
},
|
||||
}, browsingContext.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Realm = Realm;
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/Realm.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/Realm.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -15,12 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import { type Script, type BrowsingContext } from '../../../protocol/protocol.js';
|
||||
import { type BrowsingContext, type Script } from '../../../protocol/protocol.js';
|
||||
import type { Realm } from './Realm.js';
|
||||
type RealmFilter = {
|
||||
realmId?: Script.Realm;
|
||||
browsingContextId?: BrowsingContext.BrowsingContext;
|
||||
navigableId?: string;
|
||||
executionContextId?: Protocol.Runtime.ExecutionContextId;
|
||||
origin?: string;
|
||||
type?: Script.RealmType;
|
||||
|
||||
14
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/RealmStorage.js
generated
vendored
14
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/RealmStorage.js
generated
vendored
@ -2,6 +2,7 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RealmStorage = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const WindowRealm_js_1 = require("./WindowRealm.js");
|
||||
/** Container class for browsing realms. */
|
||||
class RealmStorage {
|
||||
/** Tracks handles and their realms sent to the client. */
|
||||
@ -21,11 +22,13 @@ class RealmStorage {
|
||||
return false;
|
||||
}
|
||||
if (filter.browsingContextId !== undefined &&
|
||||
filter.browsingContextId !== realm.browsingContextId) {
|
||||
!realm.associatedBrowsingContexts
|
||||
.map((browsingContext) => browsingContext.id)
|
||||
.includes(filter.browsingContextId)) {
|
||||
return false;
|
||||
}
|
||||
if (filter.navigableId !== undefined &&
|
||||
filter.navigableId !== realm.navigableId) {
|
||||
if (filter.sandbox !== undefined &&
|
||||
(!(realm instanceof WindowRealm_js_1.WindowRealm) || filter.sandbox !== realm.sandbox)) {
|
||||
return false;
|
||||
}
|
||||
if (filter.executionContextId !== undefined &&
|
||||
@ -35,10 +38,7 @@ class RealmStorage {
|
||||
if (filter.origin !== undefined && filter.origin !== realm.origin) {
|
||||
return false;
|
||||
}
|
||||
if (filter.type !== undefined && filter.type !== realm.type) {
|
||||
return false;
|
||||
}
|
||||
if (filter.sandbox !== undefined && filter.sandbox !== realm.sandbox) {
|
||||
if (filter.type !== undefined && filter.type !== realm.realmType) {
|
||||
return false;
|
||||
}
|
||||
if (filter.cdpSessionId !== undefined &&
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"RealmStorage.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/RealmStorage.ts"],"names":[],"mappings":";;;AAkBA,+DAIuC;AAevC,2CAA2C;AAC3C,MAAa,YAAY;IACvB,0DAA0D;IACjD,uBAAuB,GAAG,IAAI,GAAG,EAGvC,CAAC;IAEJ,kCAAkC;IACzB,SAAS,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEpD,IAAI,sBAAsB;QACxB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;IAED,QAAQ,CAAC,KAAY;QACnB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,oDAAoD;IACpD,UAAU,CAAC,MAAmB;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YAC1D,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC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AAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjE,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,SAAS,CAAC,MAAkC;QAC1C,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACjC,kCAAkC;YAClC,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1D,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa;aAC9B,UAAU,CAAC;YACV,iBAAiB,EAAE,MAAM,CAAC,OAAO;YACjC,IAAI,EAAE,MAAM,CAAC,IAAI;SAClB,CAAC;aACD,GAAG,CAAC,CAAC,KAAY,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1C,OAAO,EAAC,MAAM,EAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAqB;QACnC,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;gBACjC,OAAO,EAAE,MAAM,CAAC,KAAK;aACtB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxE,OAAO,MAAM,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAlJD,0CAkJC"}
|
||||
{"version":3,"file":"ScriptProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/ScriptProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,yDAKoC;AAMpC,mDAA8C;AAK9C,MAAa,eAAe;IACjB,uBAAuB,CAAyB;IAChD,aAAa,CAAe;IAC5B,qBAAqB,CAAC;IACtB,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;QACnC,OAAO,EAAC,MAAM,EAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,MAAqB;QACnC,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;gBACjC,OAAO,EAAE,MAAM,CAAC,KAAK;aACtB,CAAC,CAAC;QACL,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACxE,OAAO,MAAM,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AAlJD,0CAkJC"}
|
||||
6
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/SharedId.d.ts
generated
vendored
Normal file
6
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/SharedId.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export declare function getSharedId(frameId: string, documentId: string, backendNodeId: number, sharedIdWithFrame: boolean): string;
|
||||
export declare function parseSharedId(sharedId: string): {
|
||||
frameId: string | undefined;
|
||||
documentId: string;
|
||||
backendNodeId: number;
|
||||
} | null;
|
||||
80
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/SharedId.js
generated
vendored
Normal file
80
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/SharedId.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
/*
|
||||
* Copyright 2023 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.parseSharedId = exports.getSharedId = void 0;
|
||||
const SHARED_ID_DIVIDER = '_element_';
|
||||
function getSharedId(frameId, documentId, backendNodeId, sharedIdWithFrame) {
|
||||
if (sharedIdWithFrame) {
|
||||
return `f.${frameId}.d.${documentId}.e.${backendNodeId}`;
|
||||
}
|
||||
// TODO: remove once ChromeDriver accepts sharedId in the new format:
|
||||
// http://go/chromedriver:weak-map
|
||||
return `${documentId}${SHARED_ID_DIVIDER}${backendNodeId}`;
|
||||
}
|
||||
exports.getSharedId = getSharedId;
|
||||
function parseLegacySharedId(sharedId) {
|
||||
const match = sharedId.match(new RegExp(`(.*)${SHARED_ID_DIVIDER}(.*)`));
|
||||
if (!match) {
|
||||
// SharedId is incorrectly formatted.
|
||||
return null;
|
||||
}
|
||||
const documentId = match[1];
|
||||
const elementId = match[2];
|
||||
if (documentId === undefined || elementId === undefined) {
|
||||
return null;
|
||||
}
|
||||
const backendNodeId = parseInt(elementId ?? '');
|
||||
if (isNaN(backendNodeId)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
documentId,
|
||||
backendNodeId,
|
||||
};
|
||||
}
|
||||
function parseSharedId(sharedId) {
|
||||
// TODO: remove legacy check once ChromeDriver provides sharedId in the new format.
|
||||
const legacyFormattedSharedId = parseLegacySharedId(sharedId);
|
||||
if (legacyFormattedSharedId !== null) {
|
||||
return { ...legacyFormattedSharedId, frameId: undefined };
|
||||
}
|
||||
const match = sharedId.match(/f\.(.*)\.d\.(.*)\.e\.([0-9]*)/);
|
||||
if (!match) {
|
||||
// SharedId is incorrectly formatted.
|
||||
return null;
|
||||
}
|
||||
const frameId = match[1];
|
||||
const documentId = match[2];
|
||||
const elementId = match[3];
|
||||
if (frameId === undefined ||
|
||||
documentId === undefined ||
|
||||
elementId === undefined) {
|
||||
return null;
|
||||
}
|
||||
const backendNodeId = parseInt(elementId ?? '');
|
||||
if (isNaN(backendNodeId)) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
frameId,
|
||||
documentId,
|
||||
backendNodeId,
|
||||
};
|
||||
}
|
||||
exports.parseSharedId = parseSharedId;
|
||||
//# sourceMappingURL=SharedId.js.map
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/SharedId.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/SharedId.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"SharedId.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/SharedId.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAEtC,SAAgB,WAAW,CACzB,OAAe,EACf,UAAkB,EAClB,aAAqB,EACrB,iBAA0B;IAE1B,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,KAAK,OAAO,MAAM,UAAU,MAAM,aAAa,EAAE,CAAC;IAC3D,CAAC;IACD,qEAAqE;IACrE,mCAAmC;IACnC,OAAO,GAAG,UAAU,GAAG,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAC7D,CAAC;AAZD,kCAYC;AAED,SAAS,mBAAmB,CAAC,QAAgB;IAI3C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,iBAAiB,MAAM,CAAC,CAAC,CAAC;IACzE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,qCAAqC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,IAAI,UAAU,KAAK,SAAS,IAAI,SAAS,KA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d.ts
generated
vendored
Normal file
39
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/WindowRealm.d.ts
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import { type BrowsingContext, type Script } from '../../../protocol/protocol.js';
|
||||
import type { LoggerFn } from '../../../utils/log.js';
|
||||
import type { BrowsingContextImpl } from '../context/BrowsingContextImpl.js';
|
||||
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
|
||||
import type { EventManager } from '../session/EventManager.js';
|
||||
import { Realm } from './Realm.js';
|
||||
import type { RealmStorage } from './RealmStorage.js';
|
||||
export declare class WindowRealm extends Realm {
|
||||
#private;
|
||||
readonly sandbox: string | undefined;
|
||||
constructor(browsingContextId: BrowsingContext.BrowsingContext, browsingContextStorage: BrowsingContextStorage, cdpClient: CdpClient, eventManager: EventManager, executionContextId: Protocol.Runtime.ExecutionContextId, logger: LoggerFn | undefined, origin: string, realmId: Script.Realm, realmStorage: RealmStorage, sandbox: string | undefined, sharedIdWithFrame: boolean);
|
||||
get browsingContext(): BrowsingContextImpl;
|
||||
get associatedBrowsingContexts(): [BrowsingContextImpl];
|
||||
get realmType(): 'window';
|
||||
get realmInfo(): Script.WindowRealmInfo;
|
||||
get source(): Script.Source;
|
||||
serializeForBiDi(deepSerializedValue: Protocol.Runtime.DeepSerializedValue, internalIdMap: Map<number, string>): Script.RemoteValue;
|
||||
deserializeForCdp(localValue: Script.LocalValue): Promise<Protocol.Runtime.CallArgument>;
|
||||
evaluate(expression: string, awaitPromise: boolean, resultOwnership: Script.ResultOwnership, serializationOptions: Script.SerializationOptions, userActivation?: boolean): Promise<Script.EvaluateResult>;
|
||||
callFunction(functionDeclaration: string, thisLocalValue: Script.LocalValue, argumentsLocalValues: Script.LocalValue[], awaitPromise: boolean, resultOwnership: Script.ResultOwnership, serializationOptions: Script.SerializationOptions, userActivation?: boolean): Promise<Script.EvaluateResult>;
|
||||
}
|
||||
142
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/WindowRealm.js
generated
vendored
Normal file
142
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/WindowRealm.js
generated
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
"use strict";
|
||||
/**
|
||||
* Copyright 2024 Google LLC.
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WindowRealm = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const Realm_js_1 = require("./Realm.js");
|
||||
const SharedId_js_1 = require("./SharedId.js");
|
||||
class WindowRealm extends Realm_js_1.Realm {
|
||||
#browsingContextId;
|
||||
#browsingContextStorage;
|
||||
#sharedIdWithFrame;
|
||||
sandbox;
|
||||
constructor(browsingContextId, browsingContextStorage, cdpClient, eventManager, executionContextId, logger, origin, realmId, realmStorage, sandbox, sharedIdWithFrame) {
|
||||
super(cdpClient, eventManager, executionContextId, logger, origin, realmId, realmStorage);
|
||||
this.#browsingContextId = browsingContextId;
|
||||
this.#browsingContextStorage = browsingContextStorage;
|
||||
this.#sharedIdWithFrame = sharedIdWithFrame;
|
||||
this.sandbox = sandbox;
|
||||
this.initialize();
|
||||
}
|
||||
#getBrowsingContextId(navigableId) {
|
||||
const maybeBrowsingContext = this.#browsingContextStorage
|
||||
.getAllContexts()
|
||||
.find((context) => context.navigableId === navigableId);
|
||||
return maybeBrowsingContext?.id ?? 'UNKNOWN';
|
||||
}
|
||||
get browsingContext() {
|
||||
return this.#browsingContextStorage.getContext(this.#browsingContextId);
|
||||
}
|
||||
get associatedBrowsingContexts() {
|
||||
return [this.browsingContext];
|
||||
}
|
||||
get realmType() {
|
||||
return 'window';
|
||||
}
|
||||
get realmInfo() {
|
||||
return {
|
||||
...this.baseInfo,
|
||||
type: this.realmType,
|
||||
context: this.#browsingContextId,
|
||||
sandbox: this.sandbox,
|
||||
};
|
||||
}
|
||||
get source() {
|
||||
return {
|
||||
realm: this.realmId,
|
||||
context: this.browsingContext.id,
|
||||
};
|
||||
}
|
||||
serializeForBiDi(deepSerializedValue, internalIdMap) {
|
||||
const bidiValue = deepSerializedValue.value;
|
||||
if (deepSerializedValue.type === 'node') {
|
||||
if (Object.hasOwn(bidiValue, 'backendNodeId')) {
|
||||
let navigableId = this.browsingContext.navigableId ?? 'UNKNOWN';
|
||||
if (Object.hasOwn(bidiValue, 'loaderId')) {
|
||||
// `loaderId` should be always there after ~2024-03-05, when
|
||||
// https://crrev.com/c/5116240 reaches stable.
|
||||
// TODO: remove the check after the date.
|
||||
navigableId = bidiValue.loaderId;
|
||||
delete bidiValue['loaderId'];
|
||||
}
|
||||
deepSerializedValue.sharedId =
|
||||
(0, SharedId_js_1.getSharedId)(this.#getBrowsingContextId(navigableId), navigableId, bidiValue.backendNodeId, this.#sharedIdWithFrame);
|
||||
delete bidiValue['backendNodeId'];
|
||||
}
|
||||
if (Object.hasOwn(bidiValue, 'children')) {
|
||||
for (const i in bidiValue.children) {
|
||||
bidiValue.children[i] = this.serializeForBiDi(bidiValue.children[i], internalIdMap);
|
||||
}
|
||||
}
|
||||
if (Object.hasOwn(bidiValue, 'shadowRoot') &&
|
||||
bidiValue.shadowRoot !== null) {
|
||||
bidiValue.shadowRoot = this.serializeForBiDi(bidiValue.shadowRoot, internalIdMap);
|
||||
}
|
||||
// `namespaceURI` can be is either `null` or non-empty string.
|
||||
if (bidiValue.namespaceURI === '') {
|
||||
bidiValue.namespaceURI = null;
|
||||
}
|
||||
}
|
||||
return super.serializeForBiDi(deepSerializedValue, internalIdMap);
|
||||
}
|
||||
async deserializeForCdp(localValue) {
|
||||
if ('sharedId' in localValue && localValue.sharedId) {
|
||||
const parsedSharedId = (0, SharedId_js_1.parseSharedId)(localValue.sharedId);
|
||||
if (parsedSharedId === null) {
|
||||
throw new protocol_js_1.NoSuchNodeException(`SharedId "${localValue.sharedId}" was not found.`);
|
||||
}
|
||||
const { documentId, backendNodeId } = parsedSharedId;
|
||||
// TODO: add proper validation if the element is accessible from the current realm.
|
||||
if (this.browsingContext.navigableId !== documentId) {
|
||||
throw new protocol_js_1.NoSuchNodeException(`SharedId "${localValue.sharedId}" belongs to different document. Current document is ${this.browsingContext.navigableId}.`);
|
||||
}
|
||||
try {
|
||||
const { object } = await this.cdpClient.sendCommand('DOM.resolveNode', {
|
||||
backendNodeId,
|
||||
executionContextId: this.executionContextId,
|
||||
});
|
||||
// TODO(#375): Release `obj.object.objectId` after using.
|
||||
return { objectId: object.objectId };
|
||||
}
|
||||
catch (error) {
|
||||
// Heuristic to detect "no such node" exception. Based on the specific
|
||||
// CDP implementation.
|
||||
if (error.code === -32000 /* CdpErrorConstants.GENERIC_ERROR */ &&
|
||||
error.message === 'No node with given id found') {
|
||||
throw new protocol_js_1.NoSuchNodeException(`SharedId "${localValue.sharedId}" was not found.`);
|
||||
}
|
||||
throw new protocol_js_1.UnknownErrorException(error.message, error.stack);
|
||||
}
|
||||
}
|
||||
return await super.deserializeForCdp(localValue);
|
||||
}
|
||||
async evaluate(expression, awaitPromise, resultOwnership, serializationOptions, userActivation) {
|
||||
await this.#browsingContextStorage
|
||||
.getContext(this.#browsingContextId)
|
||||
.targetUnblockedOrThrow();
|
||||
return await super.evaluate(expression, awaitPromise, resultOwnership, serializationOptions, userActivation);
|
||||
}
|
||||
async callFunction(functionDeclaration, thisLocalValue, argumentsLocalValues, awaitPromise, resultOwnership, serializationOptions, userActivation) {
|
||||
await this.#browsingContextStorage
|
||||
.getContext(this.#browsingContextId)
|
||||
.targetUnblockedOrThrow();
|
||||
return await super.callFunction(functionDeclaration, thisLocalValue, argumentsLocalValues, awaitPromise, resultOwnership, serializationOptions, userActivation);
|
||||
}
|
||||
}
|
||||
exports.WindowRealm = WindowRealm;
|
||||
//# sourceMappingURL=WindowRealm.js.map
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/WindowRealm.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/script/WindowRealm.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"WindowRealm.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/script/WindowRealm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAKH,+DAKuC;AAOvC,yCAAiC;AAEjC,+CAAyD;AAEzD,MAAa,WAAY,SAAQ,gBAAK;IAC3B,kBAAkB,CAAkC;IACpD,uBAAuB,CAAyB;IAChD,kBAAkB,CAAU;IAC5B,OAAO,CAAqB;IAErC,YACE,iBAAkD,EAClD,sBAA8C,EAC9C,SAAoB,EACpB,YAA0B,EAC1B,kBAAuD,EACvD,MAA4B,EAC5B,MAAc,EACd,OAAqB,EACrB,YAA0B,EAC1B,OAA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CAAmB,CAC3B,aAAa,UAAU,CAAC,QAAQ,kBAAkB,CACnD,CAAC;gBACJ,CAAC;gBACD,MAAM,IAAI,mCAAqB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;QACD,OAAO,MAAM,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAEQ,KAAK,CAAC,QAAQ,CACrB,UAAkB,EAClB,YAAqB,EACrB,eAAuC,EACvC,oBAAiD,EACjD,cAAwB;QAExB,MAAM,IAAI,CAAC,uBAAuB;aAC/B,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC;aACnC,sBAAsB,EAAE,CAAC;QAE5B,OAAO,MAAM,KAAK,CAAC,QAAQ,CACzB,UAAU,EACV,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,CACf,CAAC;IACJ,CAAC;IAEQ,KAAK,CAAC,YAAY,CACzB,mBAA2B,EAC3B,cAAiC,EACjC,oBAAyC,EACzC,YAAqB,EACrB,eAAuC,EACvC,oBAAiD,EACjD,cAAwB;QAExB,MAAM,IAAI,CAAC,uBAAuB;aAC/B,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC;aACnC,sBAAsB,EAAE,CAAC;QAE5B,OAAO,MAAM,KAAK,CAAC,YAAY,CAC7B,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,cAAc,CACf,CAAC;IACJ,CAAC;CACF;AA9MD,kCA8MC"}
|
||||
@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BidiPlusChannel } from '../../../protocol/chromium-bidi.js';
|
||||
import { ChromiumBidi, type BrowsingContext } from '../../../protocol/protocol.js';
|
||||
import { EventEmitter } from '../../../utils/EventEmitter.js';
|
||||
import type { Result } from '../../../utils/result.js';
|
||||
@ -33,7 +34,7 @@ export declare class EventManager extends EventEmitter<EventManagerEventsMap> {
|
||||
constructor(browsingContextStorage: BrowsingContextStorage);
|
||||
registerEvent(event: ChromiumBidi.Event, contextId: BrowsingContext.BrowsingContext | null): void;
|
||||
registerPromiseEvent(event: Promise<Result<ChromiumBidi.Event>>, contextId: BrowsingContext.BrowsingContext | null, eventName: ChromiumBidi.EventNames): void;
|
||||
subscribe(eventNames: ChromiumBidi.EventNames[], contextIds: (BrowsingContext.BrowsingContext | null)[], channel: string | null): void;
|
||||
unsubscribe(eventNames: ChromiumBidi.EventNames[], contextIds: (BrowsingContext.BrowsingContext | null)[], channel: string | null): void;
|
||||
subscribe(eventNames: ChromiumBidi.EventNames[], contextIds: (BrowsingContext.BrowsingContext | null)[], channel: BidiPlusChannel): void;
|
||||
unsubscribe(eventNames: ChromiumBidi.EventNames[], contextIds: (BrowsingContext.BrowsingContext | null)[], channel: BidiPlusChannel): void;
|
||||
}
|
||||
export {};
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/session/EventManager.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/session/EventManager.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -14,12 +14,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BidiPlusChannel } from '../../../protocol/chromium-bidi.js';
|
||||
import type { EmptyResult, Session } from '../../../protocol/protocol.js';
|
||||
import type { EventManager } from '../events/EventManager.js';
|
||||
import type { EventManager } from './EventManager.js';
|
||||
export declare class SessionProcessor {
|
||||
#private;
|
||||
constructor(eventManager: EventManager);
|
||||
status(): Session.StatusResult;
|
||||
subscribe(params: Session.SubscriptionRequest, channel?: string | null): EmptyResult;
|
||||
unsubscribe(params: Session.SubscriptionRequest, channel?: string | null): EmptyResult;
|
||||
subscribe(params: Session.SubscriptionRequest, channel?: BidiPlusChannel): EmptyResult;
|
||||
unsubscribe(params: Session.SubscriptionRequest, channel?: BidiPlusChannel): EmptyResult;
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"SessionProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/session/SessionProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AASH,MAAa,gBAAgB;IAC3B,aAAa,CAAe;IAE5B,YAAY,YAA0B;QACpC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAED,MAAM;QACJ,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAC,CAAC;IACtD,CAAC;IAED,SAAS,CACP,MAAmC,EACnC,UAAyB,IAAI;QAE7B,IAAI,CAAC,aAAa,CAAC,SAAS,CAC1B,MAAM,CAAC,MAAmC,EAC1C,MAAM,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EACzB,OAAO,CACR,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,WAAW,CACT,MAAmC,EACnC,UAAyB,IAAI;QAE7B,IAAI,CAAC,aAAa,CAAC,WAAW,CAC5B,MAAM,CAAC,MAAmC,EAC1C,MAAM,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EACzB,OAAO,CACR,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAlCD,4CAkCC"}
|
||||
{"version":3,"file":"SessionProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/session/SessionProcessor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAWH,MAAa,gBAAgB;IAC3B,aAAa,CAAe;IAE5B,YAAY,YAA0B;QACpC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAED,MAAM;QACJ,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAC,CAAC;IACtD,CAAC;IAED,SAAS,CACP,MAAmC,EACnC,UAA2B,IAAI;QAE/B,IAAI,CAAC,aAAa,CAAC,SAAS,CAC1B,MAAM,CAAC,MAAmC,EAC1C,MAAM,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EACzB,OAAO,CACR,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,WAAW,CACT,MAAmC,EACnC,UAA2B,IAAI;QAE/B,IAAI,CAAC,aAAa,CAAC,WAAW,CAC5B,MAAM,CAAC,MAAmC,EAC1C,MAAM,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,EACzB,OAAO,CACR,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAlCD,4CAkCC"}
|
||||
@ -14,6 +14,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { BidiPlusChannel } from '../../../protocol/chromium-bidi.js';
|
||||
import { ChromiumBidi, type BrowsingContext } from '../../../protocol/protocol.js';
|
||||
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
|
||||
/**
|
||||
@ -28,15 +29,15 @@ export declare function unrollEvents(events: ChromiumBidi.EventNames[]): Chromiu
|
||||
export declare class SubscriptionManager {
|
||||
#private;
|
||||
constructor(browsingContextStorage: BrowsingContextStorage);
|
||||
getChannelsSubscribedToEvent(eventMethod: ChromiumBidi.EventNames, contextId: BrowsingContext.BrowsingContext | null): (string | null)[];
|
||||
subscribe(event: ChromiumBidi.EventNames, contextId: BrowsingContext.BrowsingContext | null, channel: string | null): void;
|
||||
getChannelsSubscribedToEvent(eventMethod: ChromiumBidi.EventNames, contextId: BrowsingContext.BrowsingContext | null): BidiPlusChannel[];
|
||||
subscribe(event: ChromiumBidi.EventNames, contextId: BrowsingContext.BrowsingContext | null, channel: BidiPlusChannel): void;
|
||||
/**
|
||||
* Unsubscribes atomically from all events in the given contexts and channel.
|
||||
*/
|
||||
unsubscribeAll(events: ChromiumBidi.EventNames[], contextIds: (BrowsingContext.BrowsingContext | null)[], channel: string | null): void;
|
||||
unsubscribeAll(events: ChromiumBidi.EventNames[], contextIds: (BrowsingContext.BrowsingContext | null)[], channel: BidiPlusChannel): void;
|
||||
/**
|
||||
* Unsubscribes from the event in the given context and channel.
|
||||
* Syntactic sugar for "unsubscribeAll".
|
||||
*/
|
||||
unsubscribe(eventName: ChromiumBidi.EventNames, contextId: BrowsingContext.BrowsingContext | null, channel: string | null): void;
|
||||
unsubscribe(eventName: ChromiumBidi.EventNames, contextId: BrowsingContext.BrowsingContext | null, channel: BidiPlusChannel): void;
|
||||
}
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/session/SubscriptionManager.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/session/SubscriptionManager.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/session/events.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/session/events.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/session/events.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;GAeG;AACH,+DAGuC;AAEvC;;;GAGG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,0BAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CACxE,CAAC;AACJ,CAAC;AAJD,gCAIC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,IAAY;IAEZ,IAAI,CAAC,0BAAY,CAAC,WAAW,CAAC,GAAG,CAAC,IAAa,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,MAAM,IAAI,sCAAwB,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAND,oDAMC"}
|
||||
13
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/storage/StorageProcessor.d.ts
generated
vendored
Normal file
13
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/storage/StorageProcessor.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import type { CdpClient } from '../../../cdp/CdpClient.js';
|
||||
import type { Storage } from '../../../protocol/protocol.js';
|
||||
import type { LoggerFn } from '../../../utils/log.js';
|
||||
import type { BrowsingContextStorage } from '../context/BrowsingContextStorage.js';
|
||||
/**
|
||||
* Responsible for handling the `storage` domain.
|
||||
*/
|
||||
export declare class StorageProcessor {
|
||||
#private;
|
||||
constructor(browserCdpClient: CdpClient, browsingContextStorage: BrowsingContextStorage, logger: LoggerFn | undefined);
|
||||
getCookies(params: Storage.GetCookiesParameters): Promise<Storage.GetCookiesResult>;
|
||||
setCookie(params: Storage.SetCookieParameters): Promise<Storage.SetCookieResult>;
|
||||
}
|
||||
132
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/storage/StorageProcessor.js
generated
vendored
Normal file
132
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/storage/StorageProcessor.js
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StorageProcessor = void 0;
|
||||
const protocol_js_1 = require("../../../protocol/protocol.js");
|
||||
const assert_js_1 = require("../../../utils/assert.js");
|
||||
const log_js_1 = require("../../../utils/log.js");
|
||||
const NetworkProcessor_js_1 = require("../network/NetworkProcessor.js");
|
||||
const NetworkUtils_js_1 = require("../network/NetworkUtils.js");
|
||||
/**
|
||||
* Responsible for handling the `storage` domain.
|
||||
*/
|
||||
class StorageProcessor {
|
||||
#browserCdpClient;
|
||||
#browsingContextStorage;
|
||||
#logger;
|
||||
constructor(browserCdpClient, browsingContextStorage, logger) {
|
||||
this.#browsingContextStorage = browsingContextStorage;
|
||||
this.#browserCdpClient = browserCdpClient;
|
||||
this.#logger = logger;
|
||||
}
|
||||
async getCookies(params) {
|
||||
const partitionKey = this.#expandStoragePartitionSpec(params.partition);
|
||||
const cdpResponse = await this.#browserCdpClient.sendCommand('Storage.getCookies', {
|
||||
browserContextId: partitionKey.userContext,
|
||||
});
|
||||
const filteredBiDiCookies = cdpResponse.cookies
|
||||
.filter(
|
||||
// CDP's partition key is the source origin. If the request specifies the
|
||||
// `sourceOrigin` partition key, only cookies with the requested source origin
|
||||
// are returned.
|
||||
(c) => partitionKey.sourceOrigin === undefined ||
|
||||
c.partitionKey === partitionKey.sourceOrigin)
|
||||
.map((c) => (0, NetworkUtils_js_1.cdpToBiDiCookie)(c))
|
||||
.filter((c) => this.#matchCookie(c, params.filter));
|
||||
return {
|
||||
cookies: filteredBiDiCookies,
|
||||
partitionKey,
|
||||
};
|
||||
}
|
||||
async setCookie(params) {
|
||||
const partitionKey = this.#expandStoragePartitionSpec(params.partition);
|
||||
const cdpCookie = (0, NetworkUtils_js_1.bidiToCdpCookie)(params, partitionKey);
|
||||
try {
|
||||
await this.#browserCdpClient.sendCommand('Storage.setCookies', {
|
||||
cookies: [cdpCookie],
|
||||
browserContextId: partitionKey.userContext,
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
this.#logger?.(log_js_1.LogType.debugError, e);
|
||||
throw new protocol_js_1.UnableToSetCookieException(e.toString());
|
||||
}
|
||||
return {
|
||||
partitionKey,
|
||||
};
|
||||
}
|
||||
#expandStoragePartitionSpecByBrowsingContext(descriptor) {
|
||||
const browsingContextId = descriptor.context;
|
||||
const browsingContext = this.#browsingContextStorage.getContext(browsingContextId);
|
||||
// https://w3c.github.io/webdriver-bidi/#associated-storage-partition.
|
||||
// Each browsing context also has an associated storage partition, which is the
|
||||
// storage partition it uses to persist data. In Chromium it's a `BrowserContext`
|
||||
// which maps to BiDi `UserContext`.
|
||||
return {
|
||||
userContext: browsingContext.userContext === 'default'
|
||||
? undefined
|
||||
: browsingContext.userContext,
|
||||
};
|
||||
}
|
||||
#expandStoragePartitionSpecByStorageKey(descriptor) {
|
||||
const unsupportedPartitionKeys = new Map();
|
||||
let sourceOrigin = descriptor.sourceOrigin;
|
||||
if (sourceOrigin !== undefined) {
|
||||
const url = NetworkProcessor_js_1.NetworkProcessor.parseUrlString(sourceOrigin);
|
||||
if (url.origin === 'null') {
|
||||
// Origin `null` is a special case for local pages.
|
||||
sourceOrigin = url.origin;
|
||||
}
|
||||
else {
|
||||
// Port is not supported in CDP Cookie's `partitionKey`, so it should be stripped
|
||||
// from the requested source origin.
|
||||
sourceOrigin = `${url.protocol}//${url.hostname}`;
|
||||
}
|
||||
}
|
||||
const userContext = descriptor.userContext === 'default' ? undefined : descriptor.userContext;
|
||||
// Partition spec is a storage partition.
|
||||
// Let partition key be partition spec.
|
||||
for (const [key, value] of Object.entries(descriptor)) {
|
||||
if (key !== undefined &&
|
||||
value !== undefined &&
|
||||
!['type', 'sourceOrigin', 'userContext'].includes(key)) {
|
||||
unsupportedPartitionKeys.set(key, value);
|
||||
}
|
||||
}
|
||||
if (unsupportedPartitionKeys.size > 0) {
|
||||
this.#logger?.(log_js_1.LogType.debugInfo, `Unsupported partition keys: ${JSON.stringify(Object.fromEntries(unsupportedPartitionKeys))}`);
|
||||
}
|
||||
return {
|
||||
...(sourceOrigin === undefined ? {} : { sourceOrigin }),
|
||||
...(userContext === undefined ? {} : { userContext }),
|
||||
};
|
||||
}
|
||||
#expandStoragePartitionSpec(partitionSpec) {
|
||||
if (partitionSpec === undefined) {
|
||||
return {};
|
||||
}
|
||||
if (partitionSpec.type === 'context') {
|
||||
return this.#expandStoragePartitionSpecByBrowsingContext(partitionSpec);
|
||||
}
|
||||
(0, assert_js_1.assert)(partitionSpec.type === 'storageKey', 'Unknown partition type');
|
||||
return this.#expandStoragePartitionSpecByStorageKey(partitionSpec);
|
||||
}
|
||||
#matchCookie(cookie, filter) {
|
||||
if (filter === undefined) {
|
||||
return true;
|
||||
}
|
||||
return ((filter.domain === undefined || filter.domain === cookie.domain) &&
|
||||
(filter.name === undefined || filter.name === cookie.name) &&
|
||||
// `value` contains fields `type` and `value`.
|
||||
(filter.value === undefined ||
|
||||
(filter.value.type === cookie.value.type &&
|
||||
filter.value.value === cookie.value.value)) &&
|
||||
(filter.path === undefined || filter.path === cookie.path) &&
|
||||
(filter.size === undefined || filter.size === cookie.size) &&
|
||||
(filter.httpOnly === undefined || filter.httpOnly === cookie.httpOnly) &&
|
||||
(filter.secure === undefined || filter.secure === cookie.secure) &&
|
||||
(filter.sameSite === undefined || filter.sameSite === cookie.sameSite) &&
|
||||
(filter.expiry === undefined || filter.expiry === cookie.expiry));
|
||||
}
|
||||
}
|
||||
exports.StorageProcessor = StorageProcessor;
|
||||
//# sourceMappingURL=StorageProcessor.js.map
|
||||
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/storage/StorageProcessor.js.map
generated
vendored
Normal file
1
Scripts/node_modules/chromium-bidi/lib/cjs/bidiMapper/domains/storage/StorageProcessor.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"StorageProcessor.js","sourceRoot":"","sources":["../../../../../src/bidiMapper/domains/storage/StorageProcessor.ts"],"names":[],"mappings":";;;AAiBA,+DAAyE;AAEzE,wDAAgD;AAEhD,kDAA8C;AAE9C,wEAAgE;AAChE,gEAA4E;AAE5E;;GAEG;AACH,MAAa,gBAAgB;IAClB,iBAAiB,CAAY;IAC7B,uBAAuB,CAAyB;IAChD,OAAO,CAAuB;IAEvC,YACE,gBAA2B,EAC3B,sBAA8C,EAC9C,MAA4B;QAE5B,IAAI,CAAC,uBAAuB,GAAG,sBAAsB,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,gBAAgB,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,UAAU,CACd,MAA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MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC;YAChE,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;YAC1D,8CAA8C;YAC9C,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS;gBACzB,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI;oBACtC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC/C,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;YAC1D,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC;YAC1D,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC;YACtE,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC;YAChE,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,CAAC;YACtE,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,CACjE,CAAC;IACJ,CAAC;CACF;AAlKD,4CAkKC"}
|
||||
4
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/BrowserInstance.d.ts
generated
vendored
4
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/BrowserInstance.d.ts
generated
vendored
@ -1,6 +1,6 @@
|
||||
import { type ChromeReleaseChannel, type Process } from '@puppeteer/browsers';
|
||||
import type { MapperOptions } from '../bidiMapper/BidiServer.js';
|
||||
import { MapperCdpConnection } from './MapperCdpConnection.js';
|
||||
import { MapperServerCdpConnection } from './MapperCdpConnection.js';
|
||||
import type { SimpleTransport } from './SimpleTransport.js';
|
||||
type ChromeOptions = {
|
||||
chromeArgs: string[];
|
||||
@ -20,7 +20,7 @@ type ChromeOptions = {
|
||||
export declare class BrowserInstance {
|
||||
#private;
|
||||
static run(chromeOptions: ChromeOptions, mapperOptions: MapperOptions, verbose: boolean): Promise<BrowserInstance>;
|
||||
constructor(mapperCdpConnection: MapperCdpConnection, browserProcess: Process);
|
||||
constructor(mapperCdpConnection: MapperServerCdpConnection, browserProcess: Process);
|
||||
close(): Promise<void>;
|
||||
bidiSession(): SimpleTransport;
|
||||
}
|
||||
|
||||
5
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/BrowserInstance.js
generated
vendored
5
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/BrowserInstance.js
generated
vendored
@ -83,6 +83,7 @@ class BrowserInstance {
|
||||
const browserProcess = (0, browsers_1.launch)({
|
||||
executablePath,
|
||||
args: chromeArguments,
|
||||
env: process.env,
|
||||
});
|
||||
const cdpEndpoint = await browserProcess.waitForLineOutput(browsers_1.CDP_WEBSOCKET_ENDPOINT_REGEX);
|
||||
// There is a conflict between prettier and eslint here.
|
||||
@ -91,7 +92,7 @@ class BrowserInstance {
|
||||
// 2. Get `BiDi-CDP` mapper JS binaries.
|
||||
const mapperTabSource = await (0, reader_js_1.getMapperTabSource)();
|
||||
// 3. Run `BiDi-CDP` mapper in launched browser using `MapperRunner`.
|
||||
const mapperCdpConnection = await MapperCdpConnection_js_1.MapperCdpConnection.create(cdpConnection, mapperTabSource, verbose, mapperOptions);
|
||||
const mapperCdpConnection = await MapperCdpConnection_js_1.MapperServerCdpConnection.create(cdpConnection, mapperTabSource, verbose, mapperOptions);
|
||||
return new BrowserInstance(mapperCdpConnection, browserProcess);
|
||||
}
|
||||
constructor(mapperCdpConnection, browserProcess) {
|
||||
@ -115,7 +116,7 @@ class BrowserInstance {
|
||||
ws.on('open', () => {
|
||||
debugInternal('Session established.');
|
||||
const transport = new WebsocketTransport_js_1.WebSocketTransport(ws);
|
||||
const connection = new CdpConnection_js_1.CdpConnection(transport);
|
||||
const connection = new CdpConnection_js_1.MapperCdpConnection(transport);
|
||||
resolve(connection);
|
||||
});
|
||||
});
|
||||
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/BrowserInstance.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/BrowserInstance.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"BrowserInstance.js","sourceRoot":"","sources":["../../../src/bidiServer/BrowserInstance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;AAEH,0CAAoC;AACpC,4CAAoB;AACpB,gDAAwB;AAExB,kDAO6B;AAC7B,kDAA0B;AAC1B,4CAA2B;AAG3B,8DAAsD;AACtD,0EAAkE;AAElE,qEAA6D;AAC7D,2CAA+C;AAG/C,MAAM,aAAa,GAAG,IAAA,eAAK,EAAC,sBAAsB,CAAC,CAAC;AASpD;;;;;;;;GAQG;AACH,MAAa,eAAe;IAC1B,oBAAoB,CAAsB;IAC1C,eAAe,CAAU;IAEzB,MAAM,CAAC,KAAK,CAAC,GAAG,CACd,aAA4B,EAC5B,aAA4B,EAC5B,OAAgB;QAEhB,MAAM,UAAU,GAAG,MAAM,IAAA,kBAAO,EAC9B,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,MAAM,EAAE,EAAE,yBAAyB,CAAC,CAClD,CAAC;QACF,+FAA+F;QAC/F,MAAM,eAAe,GAAG;YACtB,GAAG,CAAC,aAAa,CAAC,QAAQ;gBACxB,CAAC,CAAC,CAAC,YAAY,EAAE,mBAAmB,EAAE,cAAc,CAAC;gBACrD,CAAC,CAAC,EAAE,CAAC;YACP,oBAAoB;YACpB,8BAA8B;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,CAAC;YAEjC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAEzB,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBACjB,aAAa,CAAC,sBAAsB,CAAC,CAAC;gBAEtC,MAAM,SAAS,GAAG,IAAI,0CAAkB,CAAC,EAAE,CAAC,CAAC;gBAC7C,MAAM,UAAU,GAAG,IAAI,sCAAmB,CAAC,SAAS,CAAC,CAAC;gBACtD,OAAO,CAAC,UAAU,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvHD,0CAuHC"}
|
||||
6
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/MapperCdpConnection.d.ts
generated
vendored
6
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/MapperCdpConnection.d.ts
generated
vendored
@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import type { MapperOptions } from '../bidiMapper/BidiServer.js';
|
||||
import type { CdpConnection } from '../cdp/CdpConnection.js';
|
||||
import type { MapperCdpConnection } from '../cdp/CdpConnection.js';
|
||||
import { SimpleTransport } from './SimpleTransport.js';
|
||||
export declare class MapperCdpConnection {
|
||||
export declare class MapperServerCdpConnection {
|
||||
#private;
|
||||
static create(cdpConnection: CdpConnection, mapperTabSource: string, verbose: boolean, mapperOptions: MapperOptions): Promise<MapperCdpConnection>;
|
||||
static create(cdpConnection: MapperCdpConnection, mapperTabSource: string, verbose: boolean, mapperOptions: MapperOptions): Promise<MapperServerCdpConnection>;
|
||||
private constructor();
|
||||
close(): void;
|
||||
bidiSession(): SimpleTransport;
|
||||
|
||||
43
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/MapperCdpConnection.js
generated
vendored
43
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/MapperCdpConnection.js
generated
vendored
@ -19,7 +19,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MapperCdpConnection = void 0;
|
||||
exports.MapperServerCdpConnection = void 0;
|
||||
const debug_1 = __importDefault(require("debug"));
|
||||
const SimpleTransport_js_1 = require("./SimpleTransport.js");
|
||||
const debugInternal = (0, debug_1.default)('bidi:mapper:internal');
|
||||
@ -36,32 +36,26 @@ const getLogger = (type) => {
|
||||
}
|
||||
return logger;
|
||||
};
|
||||
class MapperCdpConnection {
|
||||
class MapperServerCdpConnection {
|
||||
#cdpConnection;
|
||||
#mapperCdpClient;
|
||||
#bidiSession;
|
||||
static async create(cdpConnection, mapperTabSource, verbose, mapperOptions) {
|
||||
try {
|
||||
const mapperCdpClient = await this.#initMapper(cdpConnection, mapperTabSource, verbose, mapperOptions);
|
||||
return new MapperCdpConnection(cdpConnection, mapperCdpClient);
|
||||
const bidiSession = await this.#initMapper(cdpConnection, mapperTabSource, verbose, mapperOptions);
|
||||
return new MapperServerCdpConnection(cdpConnection, bidiSession);
|
||||
}
|
||||
catch (e) {
|
||||
cdpConnection.close();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
constructor(cdpConnection, mapperCdpClient) {
|
||||
constructor(cdpConnection, bidiSession) {
|
||||
this.#cdpConnection = cdpConnection;
|
||||
this.#mapperCdpClient = mapperCdpClient;
|
||||
this.#bidiSession = new SimpleTransport_js_1.SimpleTransport(async (message) => await this.#sendMessage(message));
|
||||
this.#mapperCdpClient.on('Runtime.bindingCalled', this.#onBindingCalled);
|
||||
this.#mapperCdpClient.on('Runtime.consoleAPICalled', this.#onConsoleAPICalled);
|
||||
// Catch unhandled exceptions in the mapper.
|
||||
this.#mapperCdpClient.on('Runtime.exceptionThrown', this.#onRuntimeExceptionThrown);
|
||||
this.#bidiSession = bidiSession;
|
||||
}
|
||||
async #sendMessage(message) {
|
||||
static async #sendMessage(mapperCdpClient, message) {
|
||||
try {
|
||||
await this.#mapperCdpClient.sendCommand('Runtime.evaluate', {
|
||||
await mapperCdpClient.sendCommand('Runtime.evaluate', {
|
||||
expression: `onBidiMessage(${JSON.stringify(message)})`,
|
||||
});
|
||||
}
|
||||
@ -75,15 +69,15 @@ class MapperCdpConnection {
|
||||
bidiSession() {
|
||||
return this.#bidiSession;
|
||||
}
|
||||
#onBindingCalled = (params) => {
|
||||
static #onBindingCalled = (params, bidiSession) => {
|
||||
if (params.name === 'sendBidiResponse') {
|
||||
this.#bidiSession.emit('message', params.payload);
|
||||
bidiSession.emit('message', params.payload);
|
||||
}
|
||||
else if (params.name === 'sendDebugMessage') {
|
||||
this.#onDebugMessage(params.payload);
|
||||
}
|
||||
};
|
||||
#onDebugMessage = (json) => {
|
||||
static #onDebugMessage = (json) => {
|
||||
try {
|
||||
const log = JSON.parse(json);
|
||||
if (log.logType !== undefined && log.messages !== undefined) {
|
||||
@ -96,10 +90,10 @@ class MapperCdpConnection {
|
||||
debugOthers(json);
|
||||
}
|
||||
};
|
||||
#onConsoleAPICalled = (params) => {
|
||||
static #onConsoleAPICalled = (params) => {
|
||||
debugInfo('consoleAPICalled: %s %O', params.type, params.args.map((arg) => arg.value));
|
||||
};
|
||||
#onRuntimeExceptionThrown = (params) => {
|
||||
static #onRuntimeExceptionThrown = (params) => {
|
||||
debugInfo('exceptionThrown:', params);
|
||||
};
|
||||
static async #initMapper(cdpConnection, mapperTabSource, verbose, mapperOptions) {
|
||||
@ -110,6 +104,13 @@ class MapperCdpConnection {
|
||||
});
|
||||
const { sessionId: mapperSessionId } = await browserClient.sendCommand('Target.attachToTarget', { targetId: mapperTabTargetId, flatten: true });
|
||||
const mapperCdpClient = cdpConnection.getCdpClient(mapperSessionId);
|
||||
const bidiSession = new SimpleTransport_js_1.SimpleTransport(async (message) => await this.#sendMessage(mapperCdpClient, message));
|
||||
// Process responses from the mapper tab.
|
||||
mapperCdpClient.on('Runtime.bindingCalled', (params) => this.#onBindingCalled(params, bidiSession));
|
||||
// Forward console messages from the mapper tab.
|
||||
mapperCdpClient.on('Runtime.consoleAPICalled', this.#onConsoleAPICalled);
|
||||
// Catch unhandled exceptions in the mapper.
|
||||
mapperCdpClient.on('Runtime.exceptionThrown', this.#onRuntimeExceptionThrown);
|
||||
await mapperCdpClient.sendCommand('Runtime.enable');
|
||||
await browserClient.sendCommand('Target.exposeDevToolsProtocol', {
|
||||
bindingName: 'cdp',
|
||||
@ -133,8 +134,8 @@ class MapperCdpConnection {
|
||||
awaitPromise: true,
|
||||
});
|
||||
debugInternal('Mapper is launched!');
|
||||
return mapperCdpClient;
|
||||
return bidiSession;
|
||||
}
|
||||
}
|
||||
exports.MapperCdpConnection = MapperCdpConnection;
|
||||
exports.MapperServerCdpConnection = MapperServerCdpConnection;
|
||||
//# sourceMappingURL=MapperCdpConnection.js.map
|
||||
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/MapperCdpConnection.js.map
generated
vendored
2
Scripts/node_modules/chromium-bidi/lib/cjs/bidiServer/MapperCdpConnection.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"MapperCdpConnection.js","sourceRoot":"","sources":["../../../src/bidiServer/MapperCdpConnection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;AAEH,kDAA2C;AAQ3C,6DAAqD;AAErD,MAAM,aAAa,GAAG,IAAA,eAAK,EAAC,sBAAsB,CAAC,CAAC;AACpD,MAAM,SAAS,GAAG,IAAA,eAAK,EAAC,kBAAkB,CAAC,CAAC;AAC5C,MAAM,WAAW,GAAG,IAAA,eAAK,EAAC,0BAA0B,CAAC,CAAC;AACtD,6BAA6B;AAC7B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAoB,CAAC;AAC5C,MAAM,SAAS,GAAG,CAAC,IAAe,EAAE,EAAE;IACpC,MAAM,MAAM,GAAG,eAAe,IAAI,EAAE,CAAC;IACrC,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,M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E;gBACtD,IAAI,EAAE,kBAAkB;aACzB,CAAC,CAAC;QACL,CAAC;QAED,0CAA0C;QAC1C,MAAM,eAAe,CAAC,WAAW,CAAC,kBAAkB,EAAE;YACpD,UAAU,EAAE,eAAe;SAC5B,CAAC,CAAC;QAEH,MAAM,eAAe,CAAC,WAAW,CAAC,kBAAkB,EAAE;YACpD,UAAU,EAAE,6BAA6B,iBAAiB,MAAM,IAAI,CAAC,SAAS,CAC5E,aAAa,CACd,GAAG;YACJ,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;QAEH,aAAa,CAAC,qBAAqB,CAAC,CAAC;QACrC,OAAO,WAAW,CAAC;IACrB,CAAC;;AAxKH,8DAyKC"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user