fix(browser): update browser context creation for current Puppeteer API and refresh build configuration
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user