feat: playwright adblocker
This commit is contained in:
@@ -13,6 +13,8 @@ import { InterpreterSettings, RemoteBrowserOptions } from "../../types";
|
|||||||
import { WorkflowGenerator } from "../../workflow-management/classes/Generator";
|
import { WorkflowGenerator } from "../../workflow-management/classes/Generator";
|
||||||
import { WorkflowInterpreter } from "../../workflow-management/classes/Interpreter";
|
import { WorkflowInterpreter } from "../../workflow-management/classes/Interpreter";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a remote browser instance.
|
* This class represents a remote browser instance.
|
||||||
* It is used to allow a variety of interaction with the Playwright's 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));
|
this.browser = <Browser>(await options.browser.launch(options.launchOptions));
|
||||||
const context = await this.browser.newContext();
|
const context = await this.browser.newContext();
|
||||||
this.currentPage = await context.newPage();
|
this.currentPage = await context.newPage();
|
||||||
|
const blocker = await PlaywrightBlocker.fromPrebuiltAdsAndTracking(fetch);
|
||||||
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
|
this.client = await this.currentPage.context().newCDPSession(this.currentPage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user