2 * (C) Copyright 2008 Jeremy Maitin-Shepard
4 * Use, modification, and distribution are subject to the terms specified in the
8 require("extension.js");
10 if (!extension_is_enabled("{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}"))
11 throw skip_module_load;
14 var adblockplus_service = Cc["@mozilla.org/adblockplus;1"]
15 .createInstance().wrappedJSObject;
18 function adblockplus_settings (buffer, uri_string) {
21 frame = buffer.top_frame;
22 adblockplus_service.openSettingsDialog(frame, uri_string);
24 interactive("adblockplus-settings",
25 "Show the Adblock Plus settings dialog.",
26 function (I) { adblockplus_settings(I.buffer); });
29 interactive("adblockplus-add",
30 "Add a pattern to Adblock Plus.",
32 var element = yield read_browser_object(I);
33 var spec = load_spec(element);
34 var pattern = yield I.minibuffer.read_url(
36 $initial_value = load_spec_uri_string(spec),
38 adblockplus_service.addPatterns([load_spec_uri_string(pattern)]);
39 I.buffer.web_navigation.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE);
41 $browser_object = browser_object_images,