Skip to content
New issue

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

how to add adblocker #550

Open
noname29 opened this issue Dec 6, 2024 · 0 comments
Open

how to add adblocker #550

noname29 opened this issue Dec 6, 2024 · 0 comments

Comments

@noname29
Copy link

noname29 commented Dec 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant