We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does adding multiple puppeteer blockers on single puppeteer page object work
Example both
await PuppeteerBlocker.fromLists(fetch, [ 'https://secure.fanboy.co.nz/fanboy-annoyance.txt' ]).then(async (blocker) => { await blocker.enableBlockingInPage(page); }); await PuppeteerBlocker.fromPrebuiltAdsOnly(fetch).then(async (blocker) => { await blocker.enableBlockingInPage(page); });
Not sure if its similar issue as #4133
The text was updated successfully, but these errors were encountered:
Hi @teammakdi ,
We don't support putting multiple blocker instances into the single page. In other words, we don't know about the side-effects of doing so.
Also, the "context" created by "PuppeteerBlocker" for the "page" will be discarded when you bind another blocker to the "page".
Best
Sorry, something went wrong.
@seia-soto Now since #4133 has been merged
import puppeteer from 'puppeteer' import fetch from 'cross-fetch' import { PuppeteerBlocker } from '@cliqz/adblocker-puppeteer' const url = 'https://www.rightmove.co.uk' const browser = await puppeteer.launch() const page = await browser.newPage() await page.setViewport({ width: 1080, height: 1024 }) const adsAndTrackingEngine = await PuppeteerBlocker.fromPrebuiltAdsAndTracking(fetch); const cookieEngine = await PuppeteerBlocker.fromLists(fetch, [ 'https://secure.fanboy.co.nz/fanboy-cookiemonster.txt', 'https://raw.githubusercontent.com/cliqz-oss/adblocker/master/packages/adblocker/assets/easylist/easylist-cookie.txt', 'https://raw.githubusercontent.com/cliqz-oss/adblocker/master/packages/adblocker/assets/ublock-origin/annoyances-cookies.txt' ]) const mergedEngine = PuppeteerBlocker.merge([adsAndTrackingEngine, cookieEngine]); await mergedEngine.enableBlockingInPage(page) await page.goto(url) await page.screenshot({ path: 'screenshot.jpg' }) await browser.close()
should work as expected right.
No branches or pull requests
Does adding multiple puppeteer blockers on single puppeteer page object work
Example both
Not sure if its similar issue as #4133
The text was updated successfully, but these errors were encountered: