Closed ghost closed 9 years ago
I add it to the todo list though this one might be very hard.
I suggest to implement a blacklist-mode blocking mechanism, this should be easier to implement and is fair towards publishers of free and/or open source content/services/software who handle advertising in a fair way. (Many of them are running only on advertising and donations.)
I don't know about webcat internals but I could imagine something like
I'd just borrow the adblocking from arora (formerly known as the qwebkit demo browser): https://github.com/icefox/arora/tree/master/src/adblock
it is pretty straightforward, and uses the normal adblock style files.
I'll see if I find time for implementing this myself.
Today I have made this script: https://github.com/Dax89/harbour-webpirate/blob/master/qml/js/helpers/AdBlock.js
Tecnically it isn't an AdBlocking system but a simple blacklist one, it's still in its infancy, but it blocks some unwanted ads, currently the rules are hardcoded.
It's sufficient to call __wp_adblock__.blockAds() (you can change the prefix, if you want :P) when the page is loaded and the ads will be hidden, the commented code contains an object that allows to intercept Ajax requests done by the webpage, but it is untested.
Thx I will take a look at it. Main problem I see currently is the scalability. So the bigger the adblocking lists are the more ram the browser needs and the slower it will get. Maybe taking the lighter approach only blocking some ads (most of the annoying ones) is better here. Let's see :)
I agree with you! It's not possible to make a full fledged AdBlock without using a lot of ram.
The filters should be less as possible and they should detect the most common/annoying (as you said) ads
Thx Dax89. Due to your excellent work I was also able to ad a simple adblocker to webcat. I added some more default rules to block some nasty ads I encountered on some sites.
If you don't want to hardcode the rules, there is also the editor :)
C++ Side: https://github.com/Dax89/harbour-webpirate/tree/master/src/adblock
Qml Side: https://github.com/Dax89/harbour-webpirate/tree/master/qml/pages/adblock
Thanks again will take a look at it and maybe implement it. I rather want to keep this feature as simple and basic as possible though as I know from experience if you give users the chance to edit those filters they will add a whole lot of that with the potential to make the browser slow as hell :)
Some websites have so much advertises that it's hard to find the actual content. It would be very nice to have an adblocker in the browser.