You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
If I switch useFingerprint to false everything fires as expected
node -v: 17.7.0
OS: windows server 2022 standard 21H2
The text was updated successfully, but these errors were encountered: