Socket
Socket
Sign inDemoInstall

puppeteer-core

Package Overview
Dependencies
Maintainers
2
Versions
238
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-core - npm Package Compare versions

Comparing version 22.4.0 to 22.4.1

lib/cjs/puppeteer/cdp/BrowserContext.d.ts

20

lib/cjs/puppeteer/cdp/Browser.d.ts

@@ -9,6 +9,6 @@ /**

import type { DebugInfo } from '../api/Browser.js';
import { Browser as BrowserBase, type BrowserCloseCallback, type BrowserContextOptions, type IsPageTargetCallback, type Permission, type TargetFilterCallback } from '../api/Browser.js';
import { BrowserContext } from '../api/BrowserContext.js';
import { Browser as BrowserBase, type BrowserCloseCallback, type BrowserContextOptions, type IsPageTargetCallback, type TargetFilterCallback } from '../api/Browser.js';
import type { Page } from '../api/Page.js';
import type { Viewport } from '../common/Viewport.js';
import { CdpBrowserContext } from './BrowserContext.js';
import type { Connection } from './Connection.js';

@@ -46,18 +46,2 @@ import { type CdpTarget } from './Target.js';

}
/**
* @internal
*/
export declare class CdpBrowserContext extends BrowserContext {
#private;
constructor(connection: Connection, browser: CdpBrowser, contextId?: string);
get id(): string | undefined;
targets(): CdpTarget[];
pages(): Promise<Page[]>;
isIncognito(): boolean;
overridePermissions(origin: string, permissions: Permission[]): Promise<void>;
clearPermissionOverrides(): Promise<void>;
newPage(): Promise<Page>;
browser(): CdpBrowser;
close(): Promise<void>;
}
//# sourceMappingURL=Browser.d.ts.map

@@ -8,7 +8,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.CdpBrowserContext = exports.CdpBrowser = void 0;
exports.CdpBrowser = void 0;
const Browser_js_1 = require("../api/Browser.js");
const BrowserContext_js_1 = require("../api/BrowserContext.js");
const CDPSession_js_1 = require("../api/CDPSession.js");
const assert_js_1 = require("../util/assert.js");
const BrowserContext_js_1 = require("./BrowserContext.js");
const ChromeTargetManager_js_1 = require("./ChromeTargetManager.js");

@@ -57,5 +56,5 @@ const FirefoxTargetManager_js_1 = require("./FirefoxTargetManager.js");

}
this.#defaultContext = new CdpBrowserContext(this.#connection, this);
this.#defaultContext = new BrowserContext_js_1.CdpBrowserContext(this.#connection, this);
for (const contextId of contextIds) {
this.#contexts.set(contextId, new CdpBrowserContext(this.#connection, this, contextId));
this.#contexts.set(contextId, new BrowserContext_js_1.CdpBrowserContext(this.#connection, this, contextId));
}

@@ -105,3 +104,3 @@ }

});
const context = new CdpBrowserContext(this.#connection, this, browserContextId);
const context = new BrowserContext_js_1.CdpBrowserContext(this.#connection, this, browserContextId);
this.#contexts.set(browserContextId, context);

@@ -248,71 +247,2 @@ return context;

exports.CdpBrowser = CdpBrowser;
/**
* @internal
*/
class CdpBrowserContext extends BrowserContext_js_1.BrowserContext {
#connection;
#browser;
#id;
constructor(connection, browser, contextId) {
super();
this.#connection = connection;
this.#browser = browser;
this.#id = contextId;
}
get id() {
return this.#id;
}
targets() {
return this.#browser.targets().filter(target => {
return target.browserContext() === this;
});
}
async pages() {
const pages = await Promise.all(this.targets()
.filter(target => {
return (target.type() === 'page' ||
(target.type() === 'other' &&
this.#browser._getIsPageTargetCallback()?.(target)));
})
.map(target => {
return target.page();
}));
return pages.filter((page) => {
return !!page;
});
}
isIncognito() {
return !!this.#id;
}
async overridePermissions(origin, permissions) {
const protocolPermissions = permissions.map(permission => {
const protocolPermission = Browser_js_1.WEB_PERMISSION_TO_PROTOCOL_PERMISSION.get(permission);
if (!protocolPermission) {
throw new Error('Unknown permission: ' + permission);
}
return protocolPermission;
});
await this.#connection.send('Browser.grantPermissions', {
origin,
browserContextId: this.#id || undefined,
permissions: protocolPermissions,
});
}
async clearPermissionOverrides() {
await this.#connection.send('Browser.resetPermissions', {
browserContextId: this.#id || undefined,
});
}
newPage() {
return this.#browser._createPageInContext(this.#id);
}
browser() {
return this.#browser;
}
async close() {
(0, assert_js_1.assert)(this.#id, 'Non-incognito profiles cannot be closed!');
await this.#browser._disposeContext(this.#id);
}
}
exports.CdpBrowserContext = CdpBrowserContext;
//# sourceMappingURL=Browser.js.map

@@ -102,3 +102,3 @@ /**

*
* Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESSS_HELL_DOWNLOAD`.
* Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD`.
*/

@@ -105,0 +105,0 @@ skipChromeHeadlessShellDownload?: boolean;

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

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

*/
exports.packageVersion = '22.4.0';
exports.packageVersion = '22.4.1';
//# sourceMappingURL=version.js.map

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

customQuerySelectors: {
"__#51267@#selectors": Map<string, CustomQuerySelectors.CustomQuerySelector>;
"__#51273@#selectors": Map<string, CustomQuerySelectors.CustomQuerySelector>;
register(name: string, handler: import("../puppeteer-core.js").CustomQueryHandler): void;

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

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

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

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

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

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

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

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

@@ -9,6 +9,6 @@ /**

import type { DebugInfo } from '../api/Browser.js';
import { Browser as BrowserBase, type BrowserCloseCallback, type BrowserContextOptions, type IsPageTargetCallback, type Permission, type TargetFilterCallback } from '../api/Browser.js';
import { BrowserContext } from '../api/BrowserContext.js';
import { Browser as BrowserBase, type BrowserCloseCallback, type BrowserContextOptions, type IsPageTargetCallback, type TargetFilterCallback } from '../api/Browser.js';
import type { Page } from '../api/Page.js';
import type { Viewport } from '../common/Viewport.js';
import { CdpBrowserContext } from './BrowserContext.js';
import type { Connection } from './Connection.js';

@@ -46,18 +46,2 @@ import { type CdpTarget } from './Target.js';

}
/**
* @internal
*/
export declare class CdpBrowserContext extends BrowserContext {
#private;
constructor(connection: Connection, browser: CdpBrowser, contextId?: string);
get id(): string | undefined;
targets(): CdpTarget[];
pages(): Promise<Page[]>;
isIncognito(): boolean;
overridePermissions(origin: string, permissions: Permission[]): Promise<void>;
clearPermissionOverrides(): Promise<void>;
newPage(): Promise<Page>;
browser(): CdpBrowser;
close(): Promise<void>;
}
//# sourceMappingURL=Browser.d.ts.map

@@ -6,6 +6,5 @@ /**

*/
import { Browser as BrowserBase, WEB_PERMISSION_TO_PROTOCOL_PERMISSION, } from '../api/Browser.js';
import { BrowserContext } from '../api/BrowserContext.js';
import { Browser as BrowserBase, } from '../api/Browser.js';
import { CDPSessionEvent } from '../api/CDPSession.js';
import { assert } from '../util/assert.js';
import { CdpBrowserContext } from './BrowserContext.js';
import { ChromeTargetManager } from './ChromeTargetManager.js';

@@ -242,70 +241,2 @@ import { FirefoxTargetManager } from './FirefoxTargetManager.js';

}
/**
* @internal
*/
export class CdpBrowserContext extends BrowserContext {
#connection;
#browser;
#id;
constructor(connection, browser, contextId) {
super();
this.#connection = connection;
this.#browser = browser;
this.#id = contextId;
}
get id() {
return this.#id;
}
targets() {
return this.#browser.targets().filter(target => {
return target.browserContext() === this;
});
}
async pages() {
const pages = await Promise.all(this.targets()
.filter(target => {
return (target.type() === 'page' ||
(target.type() === 'other' &&
this.#browser._getIsPageTargetCallback()?.(target)));
})
.map(target => {
return target.page();
}));
return pages.filter((page) => {
return !!page;
});
}
isIncognito() {
return !!this.#id;
}
async overridePermissions(origin, permissions) {
const protocolPermissions = permissions.map(permission => {
const protocolPermission = WEB_PERMISSION_TO_PROTOCOL_PERMISSION.get(permission);
if (!protocolPermission) {
throw new Error('Unknown permission: ' + permission);
}
return protocolPermission;
});
await this.#connection.send('Browser.grantPermissions', {
origin,
browserContextId: this.#id || undefined,
permissions: protocolPermissions,
});
}
async clearPermissionOverrides() {
await this.#connection.send('Browser.resetPermissions', {
browserContextId: this.#id || undefined,
});
}
newPage() {
return this.#browser._createPageInContext(this.#id);
}
browser() {
return this.#browser;
}
async close() {
assert(this.#id, 'Non-incognito profiles cannot be closed!');
await this.#browser._disposeContext(this.#id);
}
}
//# sourceMappingURL=Browser.js.map

@@ -102,3 +102,3 @@ /**

*
* Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESSS_HELL_DOWNLOAD`.
* Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD`.
*/

@@ -105,0 +105,0 @@ skipChromeHeadlessShellDownload?: boolean;

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

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

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

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

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

@@ -5,0 +5,0 @@ "keywords": [

@@ -15,10 +15,8 @@ /**

BrowserEvent,
WEB_PERMISSION_TO_PROTOCOL_PERMISSION,
type BrowserCloseCallback,
type BrowserContextOptions,
type IsPageTargetCallback,
type Permission,
type TargetFilterCallback,
} from '../api/Browser.js';
import {BrowserContext, BrowserContextEvent} from '../api/BrowserContext.js';
import {BrowserContextEvent} from '../api/BrowserContext.js';
import {CDPSessionEvent, type CDPSession} from '../api/CDPSession.js';

@@ -28,4 +26,4 @@ import type {Page} from '../api/Page.js';

import type {Viewport} from '../common/Viewport.js';
import {assert} from '../util/assert.js';
import {CdpBrowserContext} from './BrowserContext.js';
import {ChromeTargetManager} from './ChromeTargetManager.js';

@@ -429,88 +427,1 @@ import type {Connection} from './Connection.js';

}
/**
* @internal
*/
export class CdpBrowserContext extends BrowserContext {
#connection: Connection;
#browser: CdpBrowser;
#id?: string;
constructor(connection: Connection, browser: CdpBrowser, contextId?: string) {
super();
this.#connection = connection;
this.#browser = browser;
this.#id = contextId;
}
override get id(): string | undefined {
return this.#id;
}
override targets(): CdpTarget[] {
return this.#browser.targets().filter(target => {
return target.browserContext() === this;
});
}
override async pages(): Promise<Page[]> {
const pages = await Promise.all(
this.targets()
.filter(target => {
return (
target.type() === 'page' ||
(target.type() === 'other' &&
this.#browser._getIsPageTargetCallback()?.(target))
);
})
.map(target => {
return target.page();
})
);
return pages.filter((page): page is Page => {
return !!page;
});
}
override isIncognito(): boolean {
return !!this.#id;
}
override async overridePermissions(
origin: string,
permissions: Permission[]
): Promise<void> {
const protocolPermissions = permissions.map(permission => {
const protocolPermission =
WEB_PERMISSION_TO_PROTOCOL_PERMISSION.get(permission);
if (!protocolPermission) {
throw new Error('Unknown permission: ' + permission);
}
return protocolPermission;
});
await this.#connection.send('Browser.grantPermissions', {
origin,
browserContextId: this.#id || undefined,
permissions: protocolPermissions,
});
}
override async clearPermissionOverrides(): Promise<void> {
await this.#connection.send('Browser.resetPermissions', {
browserContextId: this.#id || undefined,
});
}
override newPage(): Promise<Page> {
return this.#browser._createPageInContext(this.#id);
}
override browser(): CdpBrowser {
return this.#browser;
}
override async close(): Promise<void> {
assert(this.#id, 'Non-incognito profiles cannot be closed!');
await this.#browser._disposeContext(this.#id);
}
}

@@ -105,3 +105,3 @@ /**

*
* Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESSS_HELL_DOWNLOAD`.
* Can be overridden by `PUPPETEER_SKIP_CHROME_HEADLESS_SHELL_DOWNLOAD`.
*/

@@ -108,0 +108,0 @@ skipChromeHeadlessShellDownload?: boolean;

/**
* @internal
*/
export const packageVersion = '22.4.0';
export const packageVersion = '22.4.1';

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

export const PUPPETEER_REVISIONS = Object.freeze({
chrome: '122.0.6261.94',
'chrome-headless-shell': '122.0.6261.94',
chrome: '122.0.6261.111',
'chrome-headless-shell': '122.0.6261.111',
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 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc