OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH |
| 4 * |
| 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 |
| 7 * published by the Free Software Foundation. |
| 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ |
| 17 |
| 18 var EXPORTED_SYMBOLS = ["AdblockPlusApi"]; |
| 19 |
| 20 const Cc = Components.classes; |
| 21 const Ci = Components.interfaces; |
| 22 const Cr = Components.results; |
| 23 const Cu = Components.utils; |
| 24 |
| 25 Cu.import("resource://gre/modules/Services.jsm"); |
| 26 |
| 27 function require(module) |
| 28 { |
| 29 let result = {}; |
| 30 result.wrappedJSObject = result; |
| 31 Services.obs.notifyObservers(result, "adblockplus-require", module); |
| 32 return result.exports; |
| 33 } |
| 34 |
| 35 let {FilterStorage} = require("filterStorage"); |
| 36 let {Prefs} = require("prefs"); |
| 37 let {UI} = require("ui"); |
| 38 |
| 39 var AdblockPlusApi = |
| 40 { |
| 41 get acceptableAdsEnabled() |
| 42 { |
| 43 return FilterStorage.subscriptions.some( |
| 44 (subscription) => subscription.url == Prefs.subscriptions_exceptionsurl); |
| 45 }, |
| 46 set acceptableAdsEnabled(acceptableAdsEnabled) |
| 47 { |
| 48 if (acceptableAdsEnabled != AdblockPlusApi.acceptableAdsEnabled) |
| 49 UI.toggleAcceptableAds(); |
| 50 } |
| 51 }; |
OLD | NEW |