Closed as not planned
Description
I can't seem to block any Ads using Stagehand and Ghostery playwright. I'm able to block Ads successfully using puppeteer with the same setup.
import { Page, BrowserContext, Stagehand } from "@browserbasehq/stagehand";
import { PlaywrightBlocker } from '@ghostery/adblocker-playwright';
import fetch from 'cross-fetch';
import dotenv from "dotenv";
dotenv.config();
export async function main({
page,
context,
stagehand,
}: {
page: Page; // Playwright Page with act, extract, and observe methods
context: BrowserContext; // Playwright BrowserContext
stagehand: Stagehand; // Stagehand instance
}) {
const blocker = await PlaywrightBlocker.fromLists(fetch, [
'https://easylist.to/easylist/easylist.txt',
'https://raw.githubusercontent.com/uBlockOrigin/uAssets/refs/heads/master/filters/annoyances-others.txt',
'https://raw.githubusercontent.com/uBlockOrigin/uAssets/refs/heads/master/filters/filters-2025.txt',
]);
await blocker.enableBlockingInPage(page);
await page.goto("https://www.cineby.app/movie/1064213");
}
Metadata
Metadata
Assignees
Labels
No labels