2 * (C) Copyright 2008 Jeremy Maitin-Shepard
4 * Use, modification, and distribution are subject to the terms specified in the
8 interactive("adblockplus-settings",
9 "Show the Adblock Plus settings dialog.",
11 if (! ("@adblockplus.org/abp/public;1" in Cc))
12 throw interactive_error("Adblock Plus not found");
13 make_chrome_window("chrome://adblockplus/content/ui/settings.xul");
16 interactive("adblockplus-filters",
17 "Show the Adblock Plus filter settings dialog.",
19 if (! ("@adblockplus.org/abp/public;1" in Cc))
20 throw interactive_error("Adblock Plus not found");
21 make_chrome_window("chrome://adblockplus/content/ui/filters.xul");
24 interactive("adblockplus-add",
25 "Add a pattern to Adblock Plus.",
27 if (! ("@adblockplus.org/abp/public;1" in Cc))
28 throw interactive_error("Adblock Plus not found");
30 // Access the API per the instructions here:
31 // https://adblockplus.org/en/IAdblockPlus
32 var abpURL = Components.classes["@adblockplus.org/abp/public;1"]
33 .getService(Components.interfaces.nsIURI);
34 var AdblockPlus = Components.utils.import(abpURL.spec, null).AdblockPlus;
36 var element = yield read_browser_object(I);
37 var spec = load_spec(element);
38 var pattern = yield I.minibuffer.read_url(
40 $initial_value = load_spec_uri_string(spec),
42 AdblockPlus.addPatterns([load_spec_uri_string(pattern)]);
43 I.buffer.web_navigation.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE);
45 $browser_object = browser_object_images,
48 provide("adblockplus");