mime-type-override: use js object for table instead of string_hashmap
[conkeror.git] / modules / extensions / adblockplus.js
blobaa10fd9c2c943107837f2c12b7d836f635ecf9cb
1 /**
2  * (C) Copyright 2008 Jeremy Maitin-Shepard
3  *
4  * Use, modification, and distribution are subject to the terms specified in the
5  * COPYING file.
6 **/
8 function adblockplus_settings (uri_string) {
9     if (! ("@adblockplus.org/abp/startup;1" in Cc))
10         throw interactive_error("Adblock Plus not found");
11     Components.utils.import("chrome://adblockplus-modules/content/Utils.jsm");
12     Utils.openSettingsDialog(uri_string);
14 interactive("adblockplus-settings",
15     "Show the Adblock Plus settings dialog.",
16     function (I) { adblockplus_settings(); });
19 interactive("adblockplus-add",
20     "Add a pattern to Adblock Plus.",
21     function (I) {
22         if (! ("@adblockplus.org/abp/startup;1" in Cc))
23             throw interactive_error("Adblock Plus not found");
24         Components.utils.import("chrome://adblockplus-modules/content/Public.jsm");
25         var element = yield read_browser_object(I);
26         var spec = load_spec(element);
27         var pattern = yield I.minibuffer.read_url(
28             $prompt = "Adblock:",
29             $initial_value = load_spec_uri_string(spec),
30             $history = "url");
31         AdblockPlus.addPatterns([load_spec_uri_string(pattern)]);
32         I.buffer.web_navigation.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE);
33     },
34     $browser_object = browser_object_images,
35     $prompt = "Adblock");
37 provide("adblockplus");