-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Ad blocking #7
Comments
I recently added adblock at browserless. You could use It also addresses #11 In fact, the default rules lists are easylist + uBlock + cookies banners 🙂 Just need some urls to target to see if it's working as expected |
This could be implemented with request interceptors: const blocklist = [...];
page.on('request', (request) => {
// psuedo-code, regex or domain checks likely required
if (blocklist.includes(request.url())) {
request.abort();
}
request.continue();
}); With this implementation, |
@brandon93s How were you able to integrate this with
|
Would be awesome to have some kind of ad blocking to reduce noise in screenshots.
The best solution would be to use an existing ad blocker Chrome extension, like uBlock Origin, but it seems it's only possible to load extension when not in headless mode (
{headless: false}
), so the Chrome window would show for a few seconds.https://gist.github.com/sindresorhus/bca2f7d0c8b31205fa3c9f328d548c70
https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#working-with-chrome-extensions
We could potentially make it opt-in and let the user know the downside.
The text was updated successfully, but these errors were encountered: