Jense5 / electron-ad-blocker

Blocks advertisements in an electron browser window
Mozilla Public License 2.0
53 stars 8 forks source link

AdBlocker doesn't block ads #8

Open B-0-B-B-Y opened 5 years ago

B-0-B-B-Y commented 5 years ago

The package in it's current state will fail to build. Using the fork from ErraticFox/electron-ad-blocker#master passes the build, but upon starting the electron app, the ads are still present. There are no errors in the console.

electron version: 5.0.2

The website containing the ads is loaded through a <webview> tag. Please see the code snippets below for more context on the implementation.


main.js

adFreeWindow.loadURL('file://' + __dirname + '/app/index.html')

    const options = {
      verbose: true,
      logger: console,
    }

blockWindowAds(adFreeWindow, options)

app/index.html

<div id="player">
    <webview src="https://www.youtube.com/"></webview>
</div>

I would like to resolve the issues with this package, because before it broke it worked perfectly, and was exactly what I needed. If you have any ideas on possible causes/solutions, I would love to help fix the problem.

B-0-B-B-Y commented 5 years ago

@ErraticFox Do you have any ideas regarding this issue too?

ErraticFox commented 5 years ago

This uses the brave ad blocking "engine" and iirc, ad blocking is a little tricky to do from a webview tag (or I could totally be thinking of something else), but there's a hunch for now. I'm not currently able to test this and won't be able to for a bit as my plate is quite full right now.

remusao commented 4 years ago

Hey @B-0-B-B-Y,

If you're looking for an alternative I am actively maintaining one at https://github.com/cliqz-oss/adblocker/tree/master/packages/adblocker-electron#usage Feel free to have a look! Also it's pure JavaScript so no build step is required.

Cheers,

B-0-B-B-Y commented 4 years ago

Hey @remusao , I've had a quick look through the repo and this looks great! Will try it later and will get back to you, thank you for the suggestion!

B-0-B-B-Y commented 4 years ago

Hi @remusao , Just had a chance to try out your package, works great, thank you! :star: from me :+1:

I'll keep the issue open here as this package still has the issue of ads not being blocked