2 * (C) Copyright 2008 Jeremy Maitin-Shepard
4 * Use, modification, and distribution are subject to the terms specified in the
10 require("extension.js");
12 if (!extension_is_enabled("{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}"))
13 throw skip_module_load;
16 var adblockplus_service = Cc["@mozilla.org/adblockplus;1"]
17 .createInstance().wrappedJSObject;
20 function adblockplus_settings (buffer, uri_string) {
23 frame = buffer.top_frame;
24 adblockplus_service.openSettingsDialog(frame, uri_string);
26 interactive("adblockplus-settings",
27 "Show the Adblock Plus settings dialog.",
28 function (I) { adblockplus_settings(I.buffer); });
31 interactive("adblockplus-add",
32 "Add a pattern to Adblock Plus.",
34 var element = yield read_browser_object(I);
35 var spec = load_spec(element);
36 var pattern = yield I.minibuffer.read_url(
38 $initial_value = load_spec_uri_string(spec),
40 adblockplus_service.addPatterns([load_spec_uri_string(pattern)]);
41 I.buffer.web_navigation.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE);
43 $browser_object = browser_object_images,
46 provide("adblockplus");