puppeteer-cluster icon indicating copy to clipboard operation
puppeteer-cluster copied to clipboard

how to add adblocker

Open noname29 opened this issue 10 months ago • 0 comments

I can add adblocker like this to my puppeteer

const puppeteer = require('puppeteer-extra')

// Add adblocker plugin, which will transparently block ads in all pages you
// create using puppeteer.
const { DEFAULT_INTERCEPT_RESOLUTION_PRIORITY } = require('puppeteer')
const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker')
puppeteer.use(
  AdblockerPlugin({
    // Optionally enable Cooperative Mode for several request interceptors
    interceptResolutionPriority: DEFAULT_INTERCEPT_RESOLUTION_PRIORITY
  })
)

with puppeteer cluster how can I puppeteer.use() to use such features?

with page

await cluster.queue({url someURL})
await cluster.task(async ({ page, data }) => { })

or with puppeteerOptions ? const cluster = await Cluster.launch({puppeteerOptions: {}})

noname29 avatar Dec 06 '24 13:12 noname29