Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: adblockplus/Api.jsm

Issue 6302236728623104: Add Adblock Plus API (Closed)
Left Patch Set: Nit: Requires ordered alphabetically by module name Created March 13, 2015, 10:26 p.m.
Right Patch Set: Rebase after change in http://codereview.adblockplus.org/5924365505921024 Created March 17, 2015, 3:30 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | adblockplus/build.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 16 matching lines...) Expand all
27 function require(module) 27 function require(module)
28 { 28 {
29 let result = {}; 29 let result = {};
30 result.wrappedJSObject = result; 30 result.wrappedJSObject = result;
31 Services.obs.notifyObservers(result, "adblockplus-require", module); 31 Services.obs.notifyObservers(result, "adblockplus-require", module);
32 return result.exports; 32 return result.exports;
33 } 33 }
34 34
35 let {FilterStorage} = require("filterStorage"); 35 let {FilterStorage} = require("filterStorage");
36 let {Prefs} = require("prefs"); 36 let {Prefs} = require("prefs");
37 let {DownloadableSubscription} = require("subscriptionClasses");
38 let {UI} = require("ui"); 37 let {UI} = require("ui");
39 38
40 var AdblockPlusApi = 39 var AdblockPlusApi =
41 { 40 {
42 get acceptableAdsEnabled() 41 get acceptableAdsEnabled()
43 { 42 {
44 return FilterStorage.subscriptions.some( 43 return FilterStorage.subscriptions.some(
45 (subscription) => subscription instanceof DownloadableSubscription && 44 (subscription) => subscription.url == Prefs.subscriptions_exceptionsurl);
Wladimir Palant 2015/03/14 19:53:04 Checking subscription.url is sufficient (this prop
Felix Dahlke 2015/03/14 22:56:11 Hm, true, every Subscription object has the url pr
46 subscription.url == Prefs.subscriptions_exceptionsurl);
47 }, 45 },
48 set acceptableAdsEnabled(acceptableAdsEnabled) 46 set acceptableAdsEnabled(acceptableAdsEnabled)
49 { 47 {
50 if (acceptableAdsEnabled === AdblockPlusApi.acceptableAdsEnabled) 48 if (acceptableAdsEnabled != AdblockPlusApi.acceptableAdsEnabled)
51 return; 49 UI.toggleAcceptableAds();
52 UI.toggleAcceptableAds();
53 } 50 }
54 }; 51 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld