User Tools

Site Tools


uzbl-ab

UZBL-ab is simple ad blocker written in JS. It allows to remove or alter some dom nodes matched by Xpath expressions.

Download

git clone git://github.com/pawelz/uzbl-ab.git

Adding new rules

To add new rule for UZBL-ab, create new file in your @scripts_dir, lets say mylist.js with following content:

ab_s['example.com']=
ab_s['example.net']=
ab_s['de']=
function(){
    ab_killByXpath("xpath of element to kill");
    ab_killByXpath("xpath of other element to kill");
    ab_applyByXpath("xpath of element to alter", function(a){code that alters a});
}

and bind this file to LOAD_COMMIT event, see config file for examples.

“ab_s['example.com']=” means that UZBL-ab following function will apply to all domains that ends with 'example.com'. So it will work with 'example.com', 'www.example.com', 'some.long.subdomain.example.com'. If there are more rules that matches current document.domain, shorter rule will take precedence. So if you define runction for ab_s['net'], and some other function for ab_s['example.net'], and then you go to www.example.net, uzbl will execute 'net' rule first, and then 'example.net' rule.

uzbl-ab.txt · Last modified: 2016/08/31 14:10 (external edit)