Skip to content

Commit

Permalink
Fix adblockplus glue code to work with recent version of the extension.
Browse files Browse the repository at this point in the history
adblockplus-settings doesn't work anymore, but the settings can be
accessed from the extension manager.
  • Loading branch information
jbms committed May 12, 2015
1 parent dcec9f5 commit 9548dff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/extensions/adblockplus.js
Expand Up @@ -8,25 +8,31 @@
interactive("adblockplus-settings",
"Show the Adblock Plus settings dialog.",
function (I) {
if (! ("@adblockplus.org/abp/startup;1" in Cc))
if (! ("@adblockplus.org/abp/public;1" in Cc))
throw interactive_error("Adblock Plus not found");
make_chrome_window("chrome://adblockplus/content/ui/settings.xul");
});

interactive("adblockplus-filters",
"Show the Adblock Plus filter settings dialog.",
function (I) {
if (! ("@adblockplus.org/abp/startup;1" in Cc))
if (! ("@adblockplus.org/abp/public;1" in Cc))
throw interactive_error("Adblock Plus not found");
make_chrome_window("chrome://adblockplus/content/ui/filters.xul");
});

interactive("adblockplus-add",
"Add a pattern to Adblock Plus.",
function (I) {
if (! ("@adblockplus.org/abp/startup;1" in Cc))
if (! ("@adblockplus.org/abp/public;1" in Cc))
throw interactive_error("Adblock Plus not found");
Components.utils.import("chrome://adblockplus-modules/content/Public.jsm");

// Access the API per the instructions here:
// https://adblockplus.org/en/IAdblockPlus
var abpURL = Components.classes["@adblockplus.org/abp/public;1"]
.getService(Components.interfaces.nsIURI);
var AdblockPlus = Components.utils.import(abpURL.spec, null).AdblockPlus;

var element = yield read_browser_object(I);
var spec = load_spec(element);
var pattern = yield I.minibuffer.read_url(
Expand Down

0 comments on commit 9548dff

Please sign in to comment.