feat: playwright adblocker

This commit is contained in:
karishmas6
2024-07-20 06:01:35 +05:30
parent b1c9caa2a1
commit 0087252270

View File

@@ -13,6 +13,8 @@ import { InterpreterSettings, RemoteBrowserOptions } from "../../types";
import { WorkflowGenerator } from "../../workflow-management/classes/Generator";
import { WorkflowInterpreter } from "../../workflow-management/classes/Interpreter";
/**
* This class represents a remote browser instance.
* It is used to allow a variety of interaction with the Playwright's browser instance.
@@ -90,6 +92,7 @@ export class RemoteBrowser {
this.browser = <Browser>(await options.browser.launch(options.launchOptions));
const context = await this.browser.newContext();
this.currentPage = await context.newPage();
const blocker = await PlaywrightBlocker.fromPrebuiltAdsAndTracking(fetch);
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
};