Socket
Socket
Sign inDemoInstall

puppeteer-core

Package Overview
Dependencies
92
Maintainers
2
Versions
222
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 22.10.1 to 22.11.0

5

lib/cjs/puppeteer/api/Frame.d.ts

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

import type { Page, QueryOptions, WaitForSelectorOptions, WaitTimeoutOptions } from '../api/Page.js';
import type { Accessibility } from '../cdp/Accessibility.js';
import type { DeviceRequestPrompt } from '../cdp/DeviceRequestPrompt.js';

@@ -328,2 +329,6 @@ import type { PuppeteerLifeCycleEvent } from '../cdp/LifecycleWatcher.js';

*/
abstract get accessibility(): Accessibility;
/**
* @internal
*/
abstract mainRealm(): Realm;

@@ -330,0 +335,0 @@ /**

@@ -255,2 +255,8 @@ "use strict";

}
/**
* {@inheritDoc Accessibility}
*/
get accessibility() {
return this.mainFrame().accessibility;
}
locator(selectorOrFunc) {

@@ -257,0 +263,0 @@ if (typeof selectorOrFunc === 'string') {

2

lib/cjs/puppeteer/bidi/Frame.d.ts

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

import { Frame, type GoToOptions, type WaitForOptions } from '../api/Frame.js';
import { Accessibility } from '../cdp/Accessibility.js';
import type { TimeoutSettings } from '../common/TimeoutSettings.js';

@@ -29,2 +30,3 @@ import type { Awaitable } from '../common/types.js';

readonly client: BidiCdpSession;
readonly accessibility: Accessibility;
private constructor();

@@ -31,0 +33,0 @@ get timeoutSettings(): TimeoutSettings;

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

const Frame_js_1 = require("../api/Frame.js");
const Accessibility_js_1 = require("../cdp/Accessibility.js");
const ConsoleMessage_js_1 = require("../common/ConsoleMessage.js");

@@ -183,2 +184,3 @@ const Errors_js_1 = require("../common/Errors.js");

client;
accessibility;
constructor(parent, browsingContext) {

@@ -194,2 +196,3 @@ super();

};
this.accessibility = new Accessibility_js_1.Accessibility(this.realms.default);
}

@@ -196,0 +199,0 @@ #initialize() {

2

lib/cjs/puppeteer/bidi/Page.d.ts

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

import { Page, type NewDocumentScriptEvaluation, type ScreenshotOptions } from '../api/Page.js';
import { Accessibility } from '../cdp/Accessibility.js';
import { Coverage } from '../cdp/Coverage.js';

@@ -43,3 +42,2 @@ import { Tracing } from '../cdp/Tracing.js';

readonly touchscreen: BidiTouchscreen;
readonly accessibility: Accessibility;
readonly tracing: Tracing;

@@ -46,0 +44,0 @@ readonly coverage: Coverage;

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

const Page_js_1 = require("../api/Page.js");
const Accessibility_js_1 = require("../cdp/Accessibility.js");
const Coverage_js_1 = require("../cdp/Coverage.js");

@@ -136,3 +135,2 @@ const EmulationManager_js_1 = require("../cdp/EmulationManager.js");

touchscreen;
accessibility;
tracing;

@@ -149,3 +147,2 @@ coverage;

this.#cdpEmulationManager = new EmulationManager_js_1.EmulationManager(this.#frame.client);
this.accessibility = new Accessibility_js_1.Accessibility(this.#frame.client);
this.tracing = new Tracing_js_1.Tracing(this.#frame.client);

@@ -152,0 +149,0 @@ this.coverage = new Coverage_js_1.Coverage(this.#frame.client);

@@ -6,4 +6,4 @@ /**

*/
import type { CDPSession } from '../api/CDPSession.js';
import type { ElementHandle } from '../api/ElementHandle.js';
import type { Realm } from '../api/Realm.js';
/**

@@ -80,2 +80,9 @@ * Represents a Node and the properties of it that are relevant to Accessibility.

children?: SerializedAXNode[];
/**
* Get an ElementHandle for this AXNode if available.
*
* If the underlying DOM element has been disposed, the method might return an
* error.
*/
elementHandle(): Promise<ElementHandle | null>;
}

@@ -124,8 +131,4 @@ /**

*/
constructor(client: CDPSession);
constructor(realm: Realm);
/**
* @internal
*/
updateClient(client: CDPSession): void;
/**
* Captures the current state of the accessibility tree.

@@ -132,0 +135,0 @@ * The returned object represents the root accessible node of the page.

@@ -32,16 +32,10 @@ "use strict";

class Accessibility {
#client;
#realm;
/**
* @internal
*/
constructor(client) {
this.#client = client;
constructor(realm) {
this.#realm = realm;
}
/**
* @internal
*/
updateClient(client) {
this.#client = client;
}
/**
* Captures the current state of the accessibility tree.

@@ -87,6 +81,6 @@ * The returned object represents the root accessible node of the page.

const { interestingOnly = true, root = null } = options;
const { nodes } = await this.#client.send('Accessibility.getFullAXTree');
const { nodes } = await this.#realm.environment.client.send('Accessibility.getFullAXTree');
let backendNodeId;
if (root) {
const { node } = await this.#client.send('DOM.describeNode', {
const { node } = await this.#realm.environment.client.send('DOM.describeNode', {
objectId: root.id,

@@ -96,3 +90,3 @@ });

}
const defaultRoot = AXNode.createTree(nodes);
const defaultRoot = AXNode.createTree(this.#realm, nodes);
let needle = defaultRoot;

@@ -156,3 +150,4 @@ if (backendNodeId) {

#cachedHasFocusableChild;
constructor(payload) {
#realm;
constructor(realm, payload) {
this.payload = payload;

@@ -162,2 +157,3 @@ this.#name = this.payload.name ? this.payload.name.value : '';

this.#ignored = this.payload.ignored;
this.#realm = realm;
for (const property of this.payload.properties || []) {

@@ -319,2 +315,8 @@ if (property.name === 'editable') {

role: this.#role,
elementHandle: async () => {
if (!this.payload.backendDOMNodeId) {
return null;
}
return (await this.#realm.adoptBackendNode(this.payload.backendDOMNodeId));
},
};

@@ -406,6 +408,6 @@ const userStringProperties = [

}
static createTree(payloads) {
static createTree(realm, payloads) {
const nodeById = new Map();
for (const payload of payloads) {
nodeById.set(payload.nodeId, new AXNode(payload));
nodeById.set(payload.nodeId, new AXNode(realm, payload));
}

@@ -412,0 +414,0 @@ for (const node of nodeById.values()) {

@@ -78,5 +78,9 @@ "use strict";

const targetForFilter = new Target_js_1.CdpTarget(targetInfo, undefined, undefined, this, undefined);
// Targets that will not be auto-attached. Therefore, we should
// not add them to #targetsIdsForInit.
const skipTarget = targetInfo.type === 'browser' ||
targetInfo.url.startsWith('chrome-extension://');
if ((!this.#targetFilterCallback ||
this.#targetFilterCallback(targetForFilter)) &&
targetInfo.type !== 'browser') {
!skipTarget) {
this.#targetsIdsForInit.add(targetId);

@@ -83,0 +87,0 @@ }

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

import { disposeSymbol } from '../util/disposable.js';
import { Accessibility } from './Accessibility.js';
import type { DeviceRequestPrompt } from './DeviceRequestPrompt.js';

@@ -29,2 +30,3 @@ import type { FrameManager } from './FrameManager.js';

_parentId?: string;
accessibility: Accessibility;
worlds: IsolatedWorldChart;

@@ -31,0 +33,0 @@ constructor(frameManager: FrameManager, frameId: string, parentFrameId: string | undefined, client: CDPSession);

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

const ErrorLike_js_1 = require("../util/ErrorLike.js");
const Accessibility_js_1 = require("./Accessibility.js");
const FrameManagerEvents_js_1 = require("./FrameManagerEvents.js");

@@ -80,2 +81,3 @@ const IsolatedWorld_js_1 = require("./IsolatedWorld.js");

_parentId;
accessibility;
worlds;

@@ -95,2 +97,3 @@ constructor(frameManager, frameId, parentFrameId, client) {

};
this.accessibility = new Accessibility_js_1.Accessibility(this.worlds[IsolatedWorlds_js_1.MAIN_WORLD]);
this.on(Frame_js_1.FrameEvent.FrameSwappedByActivation, () => {

@@ -97,0 +100,0 @@ // Emulate loading process for swapped frames.

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

import type { Viewport } from '../common/Viewport.js';
import { Accessibility } from './Accessibility.js';
import { Coverage } from './Coverage.js';

@@ -51,3 +50,2 @@ import type { DeviceRequestPrompt } from './DeviceRequestPrompt.js';

get tracing(): Tracing;
get accessibility(): Accessibility;
frames(): Frame[];

@@ -54,0 +52,0 @@ workers(): CdpWebWorker[];

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

const ErrorLike_js_1 = require("../util/ErrorLike.js");
const Accessibility_js_1 = require("./Accessibility.js");
const Binding_js_1 = require("./Binding.js");

@@ -122,3 +121,2 @@ const CDPSession_js_2 = require("./CDPSession.js");

#touchscreen;
#accessibility;
#frameManager;

@@ -226,3 +224,2 @@ #emulationManager;

this.#touchscreen = new Input_js_1.CdpTouchscreen(client, this.#keyboard);
this.#accessibility = new Accessibility_js_1.Accessibility(client);
this.#frameManager = new FrameManager_js_1.FrameManager(client, this, this._timeoutSettings);

@@ -267,3 +264,2 @@ this.#emulationManager = new EmulationManager_js_1.EmulationManager(client);

this.#touchscreen.updateClient(newSession);
this.#accessibility.updateClient(newSession);
this.#emulationManager.updateClient(newSession);

@@ -435,5 +431,2 @@ this.#tracing.updateClient(newSession);

}
get accessibility() {
return this.#accessibility;
}
frames() {

@@ -440,0 +433,0 @@ return this.#frameManager.frames();

/**
* @internal
*/
export declare const packageVersion = "22.10.1";
export declare const packageVersion = "22.11.0";
//# sourceMappingURL=version.d.ts.map

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

*/
exports.packageVersion = '22.10.1';
exports.packageVersion = '22.11.0';
//# sourceMappingURL=version.js.map

@@ -34,3 +34,3 @@ /**

customQuerySelectors: {
"__#54844@#selectors": Map<string, CustomQuerySelectors.CustomQuerySelector>;
"__#54774@#selectors": Map<string, CustomQuerySelectors.CustomQuerySelector>;
register(name: string, handler: import("../index.js").CustomQueryHandler): void;

@@ -37,0 +37,0 @@ unregister(name: string): void;

@@ -10,6 +10,6 @@ /**

export declare const PUPPETEER_REVISIONS: Readonly<{
chrome: "125.0.6422.141";
'chrome-headless-shell': "125.0.6422.141";
chrome: "126.0.6478.55";
'chrome-headless-shell': "126.0.6478.55";
firefox: "latest";
}>;
//# sourceMappingURL=revisions.d.ts.map

@@ -13,6 +13,6 @@ "use strict";

exports.PUPPETEER_REVISIONS = Object.freeze({
chrome: '125.0.6422.141',
'chrome-headless-shell': '125.0.6422.141',
chrome: '126.0.6478.55',
'chrome-headless-shell': '126.0.6478.55',
firefox: 'latest',
});
//# sourceMappingURL=revisions.js.map

@@ -9,3 +9,3 @@ import { disposeSymbol } from './disposable.js';

new (mutex: Mutex): {
"__#54834@#mutex": Mutex;
"__#54764@#mutex": Mutex;
[Symbol.dispose](): void;

@@ -12,0 +12,0 @@ };

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

import type { Page, QueryOptions, WaitForSelectorOptions, WaitTimeoutOptions } from '../api/Page.js';
import type { Accessibility } from '../cdp/Accessibility.js';
import type { DeviceRequestPrompt } from '../cdp/DeviceRequestPrompt.js';

@@ -328,2 +329,6 @@ import type { PuppeteerLifeCycleEvent } from '../cdp/LifecycleWatcher.js';

*/
abstract get accessibility(): Accessibility;
/**
* @internal
*/
abstract mainRealm(): Realm;

@@ -330,0 +335,0 @@ /**

@@ -228,2 +228,8 @@ /**

}
/**
* {@inheritDoc Accessibility}
*/
get accessibility() {
return this.mainFrame().accessibility;
}
locator(selectorOrFunc) {

@@ -230,0 +236,0 @@ if (typeof selectorOrFunc === 'string') {

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

import { Frame, type GoToOptions, type WaitForOptions } from '../api/Frame.js';
import { Accessibility } from '../cdp/Accessibility.js';
import type { TimeoutSettings } from '../common/TimeoutSettings.js';

@@ -29,2 +30,3 @@ import type { Awaitable } from '../common/types.js';

readonly client: BidiCdpSession;
readonly accessibility: Accessibility;
private constructor();

@@ -31,0 +33,0 @@ get timeoutSettings(): TimeoutSettings;

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

import { Frame, throwIfDetached, } from '../api/Frame.js';
import { Accessibility } from '../cdp/Accessibility.js';
import { ConsoleMessage, } from '../common/ConsoleMessage.js';

@@ -157,2 +158,3 @@ import { TargetCloseError, UnsupportedOperation } from '../common/Errors.js';

client;
accessibility;
constructor(parent, browsingContext) {

@@ -168,2 +170,3 @@ super();

};
this.accessibility = new Accessibility(this.realms.default);
}

@@ -170,0 +173,0 @@ #initialize() {

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

import { Page, type NewDocumentScriptEvaluation, type ScreenshotOptions } from '../api/Page.js';
import { Accessibility } from '../cdp/Accessibility.js';
import { Coverage } from '../cdp/Coverage.js';

@@ -43,3 +42,2 @@ import { Tracing } from '../cdp/Tracing.js';

readonly touchscreen: BidiTouchscreen;
readonly accessibility: Accessibility;
readonly tracing: Tracing;

@@ -46,0 +44,0 @@ readonly coverage: Coverage;

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

import { Page, } from '../api/Page.js';
import { Accessibility } from '../cdp/Accessibility.js';
import { Coverage } from '../cdp/Coverage.js';

@@ -133,3 +132,2 @@ import { EmulationManager } from '../cdp/EmulationManager.js';

touchscreen;
accessibility;
tracing;

@@ -146,3 +144,2 @@ coverage;

this.#cdpEmulationManager = new EmulationManager(this.#frame.client);
this.accessibility = new Accessibility(this.#frame.client);
this.tracing = new Tracing(this.#frame.client);

@@ -149,0 +146,0 @@ this.coverage = new Coverage(this.#frame.client);

@@ -6,4 +6,4 @@ /**

*/
import type { CDPSession } from '../api/CDPSession.js';
import type { ElementHandle } from '../api/ElementHandle.js';
import type { Realm } from '../api/Realm.js';
/**

@@ -80,2 +80,9 @@ * Represents a Node and the properties of it that are relevant to Accessibility.

children?: SerializedAXNode[];
/**
* Get an ElementHandle for this AXNode if available.
*
* If the underlying DOM element has been disposed, the method might return an
* error.
*/
elementHandle(): Promise<ElementHandle | null>;
}

@@ -124,8 +131,4 @@ /**

*/
constructor(client: CDPSession);
constructor(realm: Realm);
/**
* @internal
*/
updateClient(client: CDPSession): void;
/**
* Captures the current state of the accessibility tree.

@@ -132,0 +135,0 @@ * The returned object represents the root accessible node of the page.

@@ -29,16 +29,10 @@ /**

export class Accessibility {
#client;
#realm;
/**
* @internal
*/
constructor(client) {
this.#client = client;
constructor(realm) {
this.#realm = realm;
}
/**
* @internal
*/
updateClient(client) {
this.#client = client;
}
/**
* Captures the current state of the accessibility tree.

@@ -84,6 +78,6 @@ * The returned object represents the root accessible node of the page.

const { interestingOnly = true, root = null } = options;
const { nodes } = await this.#client.send('Accessibility.getFullAXTree');
const { nodes } = await this.#realm.environment.client.send('Accessibility.getFullAXTree');
let backendNodeId;
if (root) {
const { node } = await this.#client.send('DOM.describeNode', {
const { node } = await this.#realm.environment.client.send('DOM.describeNode', {
objectId: root.id,

@@ -93,3 +87,3 @@ });

}
const defaultRoot = AXNode.createTree(nodes);
const defaultRoot = AXNode.createTree(this.#realm, nodes);
let needle = defaultRoot;

@@ -152,3 +146,4 @@ if (backendNodeId) {

#cachedHasFocusableChild;
constructor(payload) {
#realm;
constructor(realm, payload) {
this.payload = payload;

@@ -158,2 +153,3 @@ this.#name = this.payload.name ? this.payload.name.value : '';

this.#ignored = this.payload.ignored;
this.#realm = realm;
for (const property of this.payload.properties || []) {

@@ -315,2 +311,8 @@ if (property.name === 'editable') {

role: this.#role,
elementHandle: async () => {
if (!this.payload.backendDOMNodeId) {
return null;
}
return (await this.#realm.adoptBackendNode(this.payload.backendDOMNodeId));
},
};

@@ -402,6 +404,6 @@ const userStringProperties = [

}
static createTree(payloads) {
static createTree(realm, payloads) {
const nodeById = new Map();
for (const payload of payloads) {
nodeById.set(payload.nodeId, new AXNode(payload));
nodeById.set(payload.nodeId, new AXNode(realm, payload));
}

@@ -408,0 +410,0 @@ for (const node of nodeById.values()) {

@@ -75,5 +75,9 @@ /**

const targetForFilter = new CdpTarget(targetInfo, undefined, undefined, this, undefined);
// Targets that will not be auto-attached. Therefore, we should
// not add them to #targetsIdsForInit.
const skipTarget = targetInfo.type === 'browser' ||
targetInfo.url.startsWith('chrome-extension://');
if ((!this.#targetFilterCallback ||
this.#targetFilterCallback(targetForFilter)) &&
targetInfo.type !== 'browser') {
!skipTarget) {
this.#targetsIdsForInit.add(targetId);

@@ -80,0 +84,0 @@ }

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

import { disposeSymbol } from '../util/disposable.js';
import { Accessibility } from './Accessibility.js';
import type { DeviceRequestPrompt } from './DeviceRequestPrompt.js';

@@ -29,2 +30,3 @@ import type { FrameManager } from './FrameManager.js';

_parentId?: string;
accessibility: Accessibility;
worlds: IsolatedWorldChart;

@@ -31,0 +33,0 @@ constructor(frameManager: FrameManager, frameId: string, parentFrameId: string | undefined, client: CDPSession);

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

import { isErrorLike } from '../util/ErrorLike.js';
import { Accessibility } from './Accessibility.js';
import { FrameManagerEvent } from './FrameManagerEvents.js';

@@ -77,2 +78,3 @@ import { IsolatedWorld } from './IsolatedWorld.js';

_parentId;
accessibility;
worlds;

@@ -92,2 +94,3 @@ constructor(frameManager, frameId, parentFrameId, client) {

};
this.accessibility = new Accessibility(this.worlds[MAIN_WORLD]);
this.on(FrameEvent.FrameSwappedByActivation, () => {

@@ -94,0 +97,0 @@ // Emulate loading process for swapped frames.

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

import type { Viewport } from '../common/Viewport.js';
import { Accessibility } from './Accessibility.js';
import { Coverage } from './Coverage.js';

@@ -51,3 +50,2 @@ import type { DeviceRequestPrompt } from './DeviceRequestPrompt.js';

get tracing(): Tracing;
get accessibility(): Accessibility;
frames(): Frame[];

@@ -54,0 +52,0 @@ workers(): CdpWebWorker[];

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

import { isErrorLike } from '../util/ErrorLike.js';
import { Accessibility } from './Accessibility.js';
import { Binding } from './Binding.js';

@@ -119,3 +118,2 @@ import { CdpCDPSession } from './CDPSession.js';

#touchscreen;
#accessibility;
#frameManager;

@@ -223,3 +221,2 @@ #emulationManager;

this.#touchscreen = new CdpTouchscreen(client, this.#keyboard);
this.#accessibility = new Accessibility(client);
this.#frameManager = new FrameManager(client, this, this._timeoutSettings);

@@ -264,3 +261,2 @@ this.#emulationManager = new EmulationManager(client);

this.#touchscreen.updateClient(newSession);
this.#accessibility.updateClient(newSession);
this.#emulationManager.updateClient(newSession);

@@ -432,5 +428,2 @@ this.#tracing.updateClient(newSession);

}
get accessibility() {
return this.#accessibility;
}
frames() {

@@ -437,0 +430,0 @@ return this.#frameManager.frames();

/**
* @internal
*/
export declare const packageVersion = "22.10.1";
export declare const packageVersion = "22.11.0";
//# sourceMappingURL=version.d.ts.map
/**
* @internal
*/
export const packageVersion = '22.10.1';
export const packageVersion = '22.11.0';
//# sourceMappingURL=version.js.map

@@ -10,6 +10,6 @@ /**

export declare const PUPPETEER_REVISIONS: Readonly<{
chrome: "125.0.6422.141";
'chrome-headless-shell': "125.0.6422.141";
chrome: "126.0.6478.55";
'chrome-headless-shell': "126.0.6478.55";
firefox: "latest";
}>;
//# sourceMappingURL=revisions.d.ts.map

@@ -10,6 +10,6 @@ /**

export const PUPPETEER_REVISIONS = Object.freeze({
chrome: '125.0.6422.141',
'chrome-headless-shell': '125.0.6422.141',
chrome: '126.0.6478.55',
'chrome-headless-shell': '126.0.6478.55',
firefox: 'latest',
});
//# sourceMappingURL=revisions.js.map
{
"name": "puppeteer-core",
"version": "22.10.1",
"version": "22.11.0",
"description": "A high-level API to control headless Chrome over the DevTools Protocol",

@@ -125,3 +125,3 @@ "keywords": [

"debug": "4.3.5",
"devtools-protocol": "0.0.1286932",
"devtools-protocol": "0.0.1299070",
"ws": "8.17.0"

@@ -128,0 +128,0 @@ },

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

} from '../api/Page.js';
import type {Accessibility} from '../cdp/Accessibility.js';
import type {DeviceRequestPrompt} from '../cdp/DeviceRequestPrompt.js';

@@ -386,2 +387,7 @@ import type {PuppeteerLifeCycleEvent} from '../cdp/LifecycleWatcher.js';

*/
abstract get accessibility(): Accessibility;
/**
* @internal
*/
abstract mainRealm(): Realm;

@@ -388,0 +394,0 @@

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

import {PageEvent} from '../api/Page.js';
import {Accessibility} from '../cdp/Accessibility.js';
import {

@@ -75,2 +76,3 @@ ConsoleMessage,

override readonly client: BidiCdpSession;
override readonly accessibility: Accessibility;

@@ -96,2 +98,3 @@ private constructor(

};
this.accessibility = new Accessibility(this.realms.default);
}

@@ -98,0 +101,0 @@

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

} from '../api/Page.js';
import {Accessibility} from '../cdp/Accessibility.js';
import {Coverage} from '../cdp/Coverage.js';

@@ -90,3 +89,2 @@ import {EmulationManager} from '../cdp/EmulationManager.js';

readonly touchscreen: BidiTouchscreen;
readonly accessibility: Accessibility;
readonly tracing: Tracing;

@@ -109,3 +107,2 @@ readonly coverage: Coverage;

this.#cdpEmulationManager = new EmulationManager(this.#frame.client);
this.accessibility = new Accessibility(this.#frame.client);
this.tracing = new Tracing(this.#frame.client);

@@ -112,0 +109,0 @@ this.coverage = new Coverage(this.#frame.client);

@@ -9,4 +9,4 @@ /**

import type {CDPSession} from '../api/CDPSession.js';
import type {ElementHandle} from '../api/ElementHandle.js';
import type {Realm} from '../api/Realm.js';

@@ -84,2 +84,10 @@ /**

children?: SerializedAXNode[];
/**
* Get an ElementHandle for this AXNode if available.
*
* If the underlying DOM element has been disposed, the method might return an
* error.
*/
elementHandle(): Promise<ElementHandle | null>;
}

@@ -126,3 +134,3 @@

export class Accessibility {
#client: CDPSession;
#realm: Realm;

@@ -132,14 +140,7 @@ /**

*/
constructor(client: CDPSession) {
this.#client = client;
constructor(realm: Realm) {
this.#realm = realm;
}
/**
* @internal
*/
updateClient(client: CDPSession): void {
this.#client = client;
}
/**
* Captures the current state of the accessibility tree.

@@ -187,11 +188,16 @@ * The returned object represents the root accessible node of the page.

const {interestingOnly = true, root = null} = options;
const {nodes} = await this.#client.send('Accessibility.getFullAXTree');
const {nodes} = await this.#realm.environment.client.send(
'Accessibility.getFullAXTree'
);
let backendNodeId: number | undefined;
if (root) {
const {node} = await this.#client.send('DOM.describeNode', {
objectId: root.id,
});
const {node} = await this.#realm.environment.client.send(
'DOM.describeNode',
{
objectId: root.id,
}
);
backendNodeId = node.backendNodeId;
}
const defaultRoot = AXNode.createTree(nodes);
const defaultRoot = AXNode.createTree(this.#realm, nodes);
let needle: AXNode | null = defaultRoot;

@@ -268,4 +274,5 @@ if (backendNodeId) {

#cachedHasFocusableChild?: boolean;
#realm: Realm;
constructor(payload: Protocol.Accessibility.AXNode) {
constructor(realm: Realm, payload: Protocol.Accessibility.AXNode) {
this.payload = payload;

@@ -275,3 +282,3 @@ this.#name = this.payload.name ? this.payload.name.value : '';

this.#ignored = this.payload.ignored;
this.#realm = realm;
for (const property of this.payload.properties || []) {

@@ -451,2 +458,10 @@ if (property.name === 'editable') {

role: this.#role,
elementHandle: async (): Promise<ElementHandle | null> => {
if (!this.payload.backendDOMNodeId) {
return null;
}
return (await this.#realm.adoptBackendNode(
this.payload.backendDOMNodeId
)) as ElementHandle<Element>;
},
};

@@ -572,6 +587,9 @@

public static createTree(payloads: Protocol.Accessibility.AXNode[]): AXNode {
public static createTree(
realm: Realm,
payloads: Protocol.Accessibility.AXNode[]
): AXNode {
const nodeById = new Map<string, AXNode>();
for (const payload of payloads) {
nodeById.set(payload.nodeId, new AXNode(payload));
nodeById.set(payload.nodeId, new AXNode(realm, payload));
}

@@ -578,0 +596,0 @@ for (const node of nodeById.values()) {

@@ -125,6 +125,11 @@ /**

);
// Targets that will not be auto-attached. Therefore, we should
// not add them to #targetsIdsForInit.
const skipTarget =
targetInfo.type === 'browser' ||
targetInfo.url.startsWith('chrome-extension://');
if (
(!this.#targetFilterCallback ||
this.#targetFilterCallback(targetForFilter)) &&
targetInfo.type !== 'browser'
!skipTarget
) {

@@ -131,0 +136,0 @@ this.#targetsIdsForInit.add(targetId);

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

import {Accessibility} from './Accessibility.js';
import type {

@@ -48,2 +49,3 @@ DeviceRequestPrompt,

override _parentId?: string;
override accessibility: Accessibility;

@@ -75,2 +77,4 @@ worlds: IsolatedWorldChart;

this.accessibility = new Accessibility(this.worlds[MAIN_WORLD]);
this.on(FrameEvent.FrameSwappedByActivation, () => {

@@ -77,0 +81,0 @@ // Emulate loading process for swapped frames.

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

import {Accessibility} from './Accessibility.js';
import {Binding} from './Binding.js';

@@ -132,3 +131,2 @@ import {CdpCDPSession} from './CDPSession.js';

#touchscreen: CdpTouchscreen;
#accessibility: Accessibility;
#frameManager: FrameManager;

@@ -242,3 +240,2 @@ #emulationManager: EmulationManager;

this.#touchscreen = new CdpTouchscreen(client, this.#keyboard);
this.#accessibility = new Accessibility(client);
this.#frameManager = new FrameManager(client, this, this._timeoutSettings);

@@ -321,3 +318,2 @@ this.#emulationManager = new EmulationManager(client);

this.#touchscreen.updateClient(newSession);
this.#accessibility.updateClient(newSession);
this.#emulationManager.updateClient(newSession);

@@ -530,6 +526,2 @@ this.#tracing.updateClient(newSession);

override get accessibility(): Accessibility {
return this.#accessibility;
}
override frames(): Frame[] {

@@ -536,0 +528,0 @@ return this.#frameManager.frames();

/**
* @internal
*/
export const packageVersion = '22.10.1';
export const packageVersion = '22.11.0';

@@ -11,5 +11,5 @@ /**

export const PUPPETEER_REVISIONS = Object.freeze({
chrome: '125.0.6422.141',
'chrome-headless-shell': '125.0.6422.141',
chrome: '126.0.6478.55',
'chrome-headless-shell': '126.0.6478.55',
firefox: 'latest',
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc