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

Add ad-blocker to chrome / chromium #872

Open
rhaist opened this issue May 3, 2024 · 2 comments
Open

Add ad-blocker to chrome / chromium #872

rhaist opened this issue May 3, 2024 · 2 comments
Labels
chromium enhancement New feature or request

Comments

@rhaist
Copy link

rhaist commented May 3, 2024

I have an unconventional proposal to the following issue that might be true for a lot of users of /convert/url.

Issue

When converting websites, blogs etc. that have a GDPR cookie banner they not always respect MediaType print and the resulting PDF contains an overlay with the cookie banner.

Proposal

Offer a gotenberg docker image where chrome/chromium includes an open source ad-blocker (e.g. ublock origin), getting rid of many potentially unwanted elements in the website that is about to be converted to a PDF.

References

Thorium is doing this with a special config file:
https://github.com/Alex313031/thorium/blob/590b88abe61be659e5e705d8d8cdf72c14cf24bf/infra/default_apps/external_extensions.json#L8

Information in the official chrome documentation:
https://developer.chrome.com/docs/extensions/how-to/distribute/install-extensions?hl=de#preference-linux

@gulien gulien added enhancement New feature or request chromium labels May 3, 2024
@rhaist
Copy link
Author

rhaist commented May 5, 2024

I did try and come up with a PR for this today but unfortunately after some extensive research into chromedp and the way it currently implements headless mode does not support extensions. chromedevtools now have experimental support for that so we might want to either nudge the chromedp people to support this or wait for this to become stable.

https://chromedevtools.github.io/devtools-protocol/tot/Extensions/

@gulien
Copy link
Collaborator

gulien commented May 5, 2024

Thanks for the investigation @rhaist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chromium enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants