AdBlock module has been taken from quigybo into a dedicated repository: AdBlock for Luakit. Also available in luakit-plugins set.
Written in Lua, it works like the original AdBlock Plus, but does not hide the elements blocked.
Some grains of code were taken from the
bookmarks.lua which provides the Bookmarks page, and now AdBlock for luakit can show its own infopage styled like the Bookmarks page.
You need either git (or any git GUI instrument suitable for your system) installed or to visit the project page and download files
git clone https://github.com/Plaque-fcc/luakit-adblock/
Using a GUI git application, you simply create new clone of
~/.config/luakit/rc.lua file you may want to add
require "adblock" to enable AdBlock and
require "adblock_chrome" to enable AdBlock chrome page luakit://adblock/ like bookmarks luakit://bookmarks/ and downloads luakit://downloads/ have.
Downloading the file manually or cloning it from git, you put file adblock.lua in your ~/.config/luakit/ directory (or where your configuration files for luakit are being stored).
This AdBlock module loads blocking and allowing rules from files
~/.local/luakit/adblock/*.txt (normal mode) or (in simple mode) from
~/.local/luakit/easylist.txt file. The only diffrerence is that if you want to use several files of rules (at least, to update the original
easylist.txt and store your own rules in
user-custom.txt), you have to store them all in
Once you've obtained and installed adblock.lua and any rules-containing standard AdBlock files (
easylist.txtcan be downloaded and installed by running
adblock-update.sh script provided by the git repository above), you should (re-)start your luakit and (having installed adblock_chrome) visit
luakit://adblock/ internal information page for further configuration.
The infopage can be reached via hitting
gA (navigate to luakit://adblock/ in the current tab or open a new one, accordingly).
You should see if AdBlock is enabled or disabled; to enable use
:adblock-enable, to disable use
:adblock-disable or their acronyms:
:abd. By default, every file not yet registered will be DISABLED, so you'll need to enable it explicitly.
Also, you may see which mode AdBlock is in: is it simple or normal mode.
Normal mode is when there is ~/.local/luakit/adblock/ directory, and there is any *.txt file supposed to be rules list.
Simple mode is otherwise, and there must be ~/.local/luakit/easylist.txt file.
In all modes AdBlock should say how many blacklisting/whitelisting rules it has loaded, so you can roughly estimate how safe are you ads-protected.
When in normal mode, you may see every rules files found and which of them are enabled and disabled. Enable or disable them using
:adblock-list-enable ListID and
:adblock-list-disable ListID or their acronyms:
:able ListID and
:abld ListID, where "ListID" is the number you can see in the right against the list name.
In normal mode, there also will be shown how many whitelisting/blacklisting rules each enabled file contains in "(bNNN/wNNN)" format.
You can discover all commands used by the module typing
:ad and pressing the Tab key to scroll thru all of them. For instance, among the variants you'll find
:adblock-reload which reloads all the rules and have its acronym shortcut:
You can find
~/.local/luakit/adblock/subscriptions file where AdBlock stores its configuration related to the files found in the lists directory.
The module is still in its development stage. Your feedback like bugreports and features proposal will be greatly appreciated.
Last edited by nmeum,