hero icon indicating copy to clipboard operation
hero copied to clipboard

Block site ads and annoyances

Open VoidMonk opened this issue 11 months ago • 2 comments

Hi, is there a plugin or another way in Hero to blocks ads (based on public lists of URLs) and cosmetic annoyances (e.g. cookie banners etc.) via automatic URL filtering and CSS injection, like done by Ghostery Adblocker[1] for Puppeteer?

I suppose Adblocker's standalone JS lib can be use to match a resource URL and somehow reject/abort requests before they're made, but I can't find a way or event in Hero (or a Tab) to hook into and reject/abort requests dynamically (i.e. without presetting with blockedResourceUrls or interceptedResources).

[1] https://github.com/ghostery/adblocker

VoidMonk avatar Feb 17 '25 02:02 VoidMonk

@VoidMonk What is the use case for that in an automation/scraping tool?

vikito755 avatar Oct 14 '25 00:10 vikito755

You can install uBlock as a chrome extension like this: https://github.com/ulixee/hero/issues/266#issuecomment-3517172601 I imagine that you can pretty easily add your own filters to that as well.

jensmogens avatar Nov 11 '25 15:11 jensmogens