Module adblock
Simple URI-based content filter
This is a simple, fast ad blocker module that works by blocking requests to domains that only serve advertisements. It does not currently do any form of cosmetic ad blocking (i.e. element hiding with CSS).
Usage
- Add
require "adblock"
andrequire "adblock_chrome"
to yourconfig.rc
. - Download AdblockPlus-compatible filter lists to
$XDG_DATA_HOME/luakit/adblock
. Multiple lists are supported. EasyList is the most popular Adblock Plus filter list, and can be downloaded from https://easylist.to/. - Filterlists need to be updated regularly (~weekly), use cron!
Functions
adblock.load (reload, single_list, no_sync)
Load filter list files, and refresh any adblock pages that are open.
Parameters
-
reloadType: boolean
true
if all subscriptions already loaded should be fully reloaded. -
single_listType: stringSingle list file.
-
no_syncType: boolean
true
if subscriptions should not be synchronized to the web process.
adblock.list_set_enabled (a, enabled)
Enable or disable an adblock filter list.
Parameters
-
aType: number or stringThe number of the list to enable or disable.
-
enabledType: boolean
true
to enable,false
to disable.
Fields
adblock.subscriptions
Type: table
Read-only
The set of ad blocking subscriptions that are active.
adblock.rules
Type: table
Read-only
String patterns to filter URIs with.
adblock.enabled
Type: boolean
Default:
true
Read-write
Whether ad blocking is enabled. Modifying this value will modify adblock
state; setting it to
true
will enable ad blocking, while setting it to
false
will disable ad blocking.
Attribution
Authors
Copyright
- 2010 Chris van Dijk (quigybo)
- 2010 Mason Larobina (mason-l)
- 2012 Plaque FCC
- 2010 Mason Larobina (mason-l)