Index: adblockplus/Api.jsm |
=================================================================== |
--- a/adblockplus/Api.jsm |
+++ b/adblockplus/Api.jsm |
@@ -32,12 +32,18 @@ |
return result.exports; |
} |
+let {FilterNotifier} = require("filterNotifier"); |
let {FilterStorage} = require("filterStorage"); |
let {Prefs} = require("prefs"); |
let {UI} = require("ui"); |
var AdblockPlusApi = |
{ |
+ get filtersLoaded() |
+ { |
+ return !FilterStorage._loading; |
+ }, |
+ filterLoadListener: null, |
get acceptableAdsEnabled() |
{ |
return FilterStorage.subscriptions.some( |
@@ -49,3 +55,13 @@ |
UI.toggleAcceptableAds(); |
} |
}; |
+ |
+FilterNotifier.addListener(function filterListener(action) |
+{ |
+ if (action != "load") |
+ return; |
+ |
+ if (typeof AdblockPlusApi.filterLoadListener == "function") |
+ AdblockPlusApi.filterLoadListener(); |
+ FilterNotifier.removeListener(filterListener); |
Wladimir Palant
2015/03/22 19:23:34
Please remove listener as the very first thing - f
Felix Dahlke
2015/03/22 20:59:31
Done.
|
+}); |