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

[FR]: Replace AdBlock with uBlock Origin. #410

Closed
WhyIsEvery4thYearAlwaysBad opened this issue May 3, 2021 · 19 comments
Closed

[FR]: Replace AdBlock with uBlock Origin. #410

WhyIsEvery4thYearAlwaysBad opened this issue May 3, 2021 · 19 comments
Assignees
Labels
Component-AdBlock Status-Fixed Ticket is resolved. Type-Enhancement This is request for brand new feature.
Milestone

Comments

@WhyIsEvery4thYearAlwaysBad

Brief description of the feature request.

AdBlock is slower and inefficient compared to uBO (or even AdBlock Plus) and can cause some issues (such as triggering BlockAdBlock) when trying to get RSS updates, due to injecting all filters by default.[1][2][3][4][5][6] I have verified that there are no copyright issues with incorporating uBO's source code into other programs.[1][2]

@WhyIsEvery4thYearAlwaysBad WhyIsEvery4thYearAlwaysBad added the Type-Enhancement This is request for brand new feature. label May 3, 2021
@WhyIsEvery4thYearAlwaysBad WhyIsEvery4thYearAlwaysBad changed the title [FR]: Replace AdBlock with uBlo. [FR]: Replace AdBlock with uBlock Origin. May 3, 2021
@martinrotter
Copy link
Owner

@WhyIsEvery4thYearAlwaysBad

uBlock origin (and pretty much every other adblock implementation) uses JavaScript as its primary runtime (V8) and is pretty much impossible to integrate withing RSS Guard. RSS Guard uses pretty much the same implementation as for example Falkon.

can cause some issues (such as triggering BlockAdBlock) when trying to get RSS updates

Does this happen to you? It should not, because adblocking in RSS Guard is NEVER used when downloading feeds/messages. It is literally used only when browsing web pages with internal web browser.

there are no copyright issues with incorporating uBO's source code into other programs

Legally, it is okay. Technically, pretty hardcore. You are welcomed to create nicely structured PR.

@martinrotter
Copy link
Owner

martinrotter commented May 3, 2021

What about allowing user to somehow call 3rd-party user JavaScript code (nodejs) from RSS Guard? If allowed, you could probably use this.

@martinrotter
Copy link
Owner

martinrotter commented May 3, 2021

For me:

  • Replace C++ implementation of Adblock with modern nodejs-based implementation.
  • Remove redundant C++ adblocking classes.
  • Check if/how element hiding rules works.
  • Tweak adblocking GUI dialog and add "Test" button to check if needed node modules are installed. Also add button with link to separate wiki article with adblock.

@martinrotter
Copy link
Owner

@WhyIsEvery4thYearAlwaysBad The solution proposed in my above replies is good, I started implementing it for RSS Guard 4.0.0. Change will be very nice and quite a lot of code could be now removed from RSS Guard as well, while keeping basically almost all previous features and gaining robust, stable and faster implementation.

@martinrotter
Copy link
Owner

@WhyIsEvery4thYearAlwaysBad
Copy link
Author

The node.js implementation should work fine. What should be included in adblock/uBO though?

@martinrotter
Copy link
Owner

What do you mean with:

What should be included in adblock/uBO though

?

@WhyIsEvery4thYearAlwaysBad
Copy link
Author

What do you mean with:

What should be included in adblock/uBO though

I was just saying what features should be included.

@martinrotter martinrotter added this to the 4.0.0 milestone May 7, 2021
martinrotter pushed a commit that referenced this issue May 11, 2021
@martinrotter
Copy link
Owner

@WhyIsEvery4thYearAlwaysBad Could you please do some testing of latest development build (compiled in 10 minutes)? The feature should be there and is working pretty nicely.

I will implement adblock query caching to speed it up even more and then close the ticket as done.

@barolo
Copy link

barolo commented Sep 5, 2021

The amount of setup that needs to be done by end-user for it to work is insane, I have no idea how it ended being acceptable solution.
Possible example of tech bubble blindness.
There's rust-adblock which got recently integrated into qutebrowser [qtwebengine] via https://github.com/ArniDagur/python-adblock and made by Brave Browser folks
qutebrowser/qutebrowser#5317

@martinrotter
Copy link
Owner

martinrotter commented Sep 6, 2021

Hello @barolo.

I have no idea how it ended being acceptable solution.

Sure you don't, everyone can submit PRs by the way.

Possible example of tech bubble blindness.

Everyone can submit PRs.

At this point, these are the literal steps to have adblock working:

  1. Download Nodejs installer, install (it installs NPM too).
  2. COPY-PASTE four command line commands into command line.
  3. That's it.

The amount of setup that needs to be done by end-user for it to work is insane,

Are you kidding me?

There's rust-adblock which got recently integrated into qutebrowser

OK so with your suggestion, proposed steps to install your suggested adblock solution would be:

  1. Download Python installer, install it.
  2. COPY-PASTE some command line commands into command line (pip3 install python-adblock).
  3. ? Install rust crate adblock ?
  4. That's it.

WHAT A GREAT improvement over current situation!

@barolo
Copy link

barolo commented Sep 6, 2021

Not everyone is using Windows, it's worse than tech-bubble blindness it's a Windows-bubble blindness. Python is already a part of the system on non-Windows platforms, while node is not [ and for a good reason ]

The only step needed would be the second one as rust-adblock is already part of the wheel

@remusao
Copy link

remusao commented Sep 6, 2021

Not everyone is using Windows, it's worse than tech-bubble blindness it's a Windows-bubble blindness. Python is already a part of the system on non-Windows platforms.

Is Rust also part of the system on non-Windows platforms?

@barolo
Copy link

barolo commented Sep 6, 2021

Not everyone is using Windows, it's worse than tech-bubble blindness it's a Windows-bubble blindness. Python is already a part of the system on non-Windows platforms.

Is Rust also part of the system on non-Windows platforms?

Depends on the distro.
Why are we talking about rust dependency anyway? python-adblock wheel already contains adblock-rust.
Unless you expect end-user to play dev and build everything from source.

@martinrotter
Copy link
Owner

martinrotter commented Sep 7, 2021

Not everyone is using Windows, it's worse than tech-bubble blindness it's a Windows-bubble blindness. Python is already a part of the system on non-Windows platforms

No, generally it is not. It is not a part of OS/2, it is not a part of all Linux distros, for example Arch (which I use). This is not really valid argument on why python-adblock should be used. Nodejs is one command (or click away).

and for a good reason

Made my day. I am not advocating neither Python nor nodejs.

Anyway, RSS Guard is open-source project, anyone can provide pull request, if you want to provide (switchable) alternative, I will be more than happy to merge it, few things that your implementation must take into account:

  1. Make new sub-feature switchable with default to nodejs adblocking, so that backwards compatibility with 4.0.0 is kept. GUI part must be implemented into existing "AdBlock" configuration dialog, possibly with QComboBox with values cliqz/adblocker (Node.js) and brave/adblock (Python.
  2. Implement clone of adblock server file (name it for example adblock-server.py and make sure it provides same API as existing nodejs-based implementation.
  3. Update relevant parts of documentation.

EDIT: Look, I am not saying nodejs is great and Python is bad (I actually use Python for many example scrapers within rssguard repository). All I am saying is that the argument that python-based adblock is somehow easier to install is just not valid. Both nodejs and python based adblock can be installed with fairly similar number of command line commands.

@sakkamade
Copy link
Contributor

Python is already a part of the system on non-Windows platforms, while node is not [ and for a good reason ]

The only step needed would be the second one as rust-adblock is already part of the wheel

You are forgetting that the pip is also must be installed, or are you saying that it is also a part of the non-Windows systems?

@martinrotter
Copy link
Owner

Python is already a part of the system on non-Windows platforms, while node is not [ and for a good reason ]
The only step needed would be the second one as rust-adblock is already part of the wheel

You are forgetting that the pip is also must be installed, or are you saying that it is also a part of the non-Windows systems?

It is not - on Arch it is separate package.

All people, take my above comment into account.

@sakkamade
Copy link
Contributor

sakkamade commented Sep 7, 2021

It is not - on Arch it is separate package.

Yes, I know, it was a rhetorical question. (On ubuntu too.)

@barolo
Copy link

barolo commented Sep 8, 2021

It is not - on Arch it is separate package.

Yes, I know, it was a rhetorical question. (On ubuntu too.)

python-adblock is in my distro's repo, so no pip is needed
It's also in Arch's repo
One of the obvious benefits of this would be that it gets updated with the rest of the system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component-AdBlock Status-Fixed Ticket is resolved. Type-Enhancement This is request for brand new feature.
Projects
None yet
Development

No branches or pull requests

5 participants