fix: add await to enable blocker

This commit is contained in:
karishmas6
2024-07-20 06:10:37 +05:30
parent 4a35dc7663
commit f7b19ee2cf

View File

@@ -93,7 +93,7 @@ export class RemoteBrowser {
const context = await this.browser.newContext();
this.currentPage = await context.newPage();
const blocker = await PlaywrightBlocker.fromPrebuiltAdsAndTracking(fetch);
blocker.enableBlockingInPage(this.currentPage);
await blocker.enableBlockingInPage(this.currentPage);
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
await blocker.disableBlockingInPage(this.currentPage);
};