-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Steps to reproduce:
- Run example code taken from doc
import { BrowserPool, PlaywrightPlugin } from "browser-pool";
import playwright from "playwright";
const browserPool = new BrowserPool({
browserPlugins: [new PlaywrightPlugin(playwright.chromium)],
useFingerprints: false,
preLaunchHooks: [(pageId, launchContext) => {
// do something before a browser gets launched
launchContext.launchOptions.headless = false;
}],
postLaunchHooks: [(pageId, browserController) => {
// manipulate the browser right after launch
//console.dir(browserController.browser.contexts());
}],
prePageCreateHooks: [(pageId, browserController) => {
if (pageId === 'my-page') {
// make changes right before a specific page is created
}
}],
postPageCreateHooks: [async (page, browserController) => {
// update some or all new pages
console.log('postPageCreateHooks fired');
await page.evaluate(() => {
// now all pages will have 'foo'
window.foo = 'bar'
})
}],
prePageCloseHooks: [async (page, browserController) => {
// collect information just before a page closes
// await page.screenshot();
}],
postPageCloseHooks: [(pageId, browserController) => {
// clean up or log after a job is done
console.log('Page closed: ', pageId)
}]
});
await browserPool.newPageInNewBrowser();
await browserPool.newPage();
- set argument useFingerprints: true,
- expected: text to be printed to console 'postPageCreateHooks fired' however it does not get triggered.
If I switch useFingerprint to false everything fires as expected
node -v: 17.7.0
OS: windows server 2022 standard 21H2
pocesar
Metadata
Metadata
Assignees
Labels
No labels