Skip to content

how to add adblocker #550

@noname29

Description

@noname29

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: {}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions