fix(browser): update browser context creation for current Puppeteer API and refresh build configuration

This commit is contained in:
2026-05-01 16:26:59 +00:00
parent 5b8eb43181
commit 24aa17f6bc
11 changed files with 3530 additions and 5764 deletions
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartpuppeteer',
version: '2.0.5',
version: '2.0.6',
description: 'Provides simplified access to Puppeteer for automation and testing purposes.'
}
@@ -55,14 +55,12 @@ export class IncognitoBrowser {
/**
* Returns a new incognito browser context.
* This uses Puppeteer's createIncognitoBrowserContext() API, which is the
* correct method for creating isolated sessions.
* This uses Puppeteer's current createBrowserContext() API for isolated sessions.
*/
public async getNewIncognitoContext(): Promise<plugins.puppeteer.BrowserContext> {
if (!this.browser) {
throw new Error('You need to start the IncognitoBrowser instance first');
}
// @ts-ignore
return this.browser.createIncognitoBrowserContext();
return this.browser.createBrowserContext();
}
}
}
+2 -2
View File
@@ -43,10 +43,10 @@ export const getEnvAwareBrowserInstance = async (
const headlessBrowser = await plugins.puppeteer.launch({
args: chromeArgs,
pipe: options.usePipe !== undefined ? options.usePipe : true,
pipe: options.usePipe ?? true,
headless: true,
...executablePathOptions,
});
return headlessBrowser;
};
};