Allow addblocking via webextension
It would be nice to allow the user to block requests based on a blacklist of regular expressions. I think for a first attempt it's enought to follow the blacklisting approach. The blacklist could be one or more files in $XDG_CONFIG_HOME/vimb[/PROFILE]/adblock/*-blacklist (*-whitelist might be useful in future too) that contains the regular expressions applied to the requested URIs, one per line. Then we must give the path to the directory to the webextension so that the extension can load it.
I think this could be done more effectively by a proxy like Polipo, see http://rightfootin.blogspot.ca/2009/11/ad-blocking-with-polipo.html
@devlinzed I had used privoxy for filtering in the past. But by the nature of proxies these can't filter content/requests over secure connection like https (except of host only pattern). So there is a real use case to do the filtering in the browser.
Ok, I wrote this little script for lariza browser. It downloads the three biggest list and but it in one file. This with a cronjob, or on every start will create a good list.
#!/bin/bash
cd ~/.config/lariza/
wget -O 1.txt https://easylist-downloads.adblockplus.org/easylist.txt
wget -O 2.txt https://raw.githubusercontent.com/zpacman/Blockzilla/master/Blockzilla.txt
wget -O 3.txt https://easylist-downloads.adblockplus.org/fanboy-annoyance.txt
cat 1.txt > adblock.black
cat 2.txt >> adblock.black
cat 3.txt >> adblock.black
rm 1.txt
rm 2.txt
rm 3.txt
@beli3ver Thank you for the script. But as I can see lariza uses regex balcklisting for requested URL. So I think there is a lot of stuff that can be removed from the lists because it's special syntax for adblock like the following.
@@||phncdn.com/www-static/js/widgets-rating-like-fav.js$script
This works with vimb https://github.com/jun7/wyebadblock
Maybe it can be integrated/improved for vimb.
I did implement it like this after installing wyebadblock (from above link)
sudo ln -s /lib/wyebrowser/adblock.so /lib/vimb
vimb_adblock
#!/bin/sh
notify-send --urgency=normal "updating adblock"
wget https://easylist.to/easylist/easylist.txt -O .config/wyebadblock/easylist.txt && notify-send --urgency=normal "adblock update done"
in vimb config file
nmap <C-U> :sh! vimb_adblock<CR>
Hello. I hope it's okay that I'm hijacking this rather old thread. I'm working on an improved alternative to wyebadblock that supports dynamic cosmetic filtering, automatic filter lists updating, simple GUI and element picker/zapper. Everything seems to be working fine, but I would love to hear some feedback from vimb users. Thank you! https://github.com/dudik/blockit