Index: lib/api.js |
=================================================================== |
--- a/lib/api.js |
+++ b/lib/api.js |
@@ -19,16 +19,17 @@ var API = (function() |
{ |
var Filter = require("filterClasses").Filter; |
var Subscription = require("subscriptionClasses").Subscription; |
var SpecialSubscription = require("subscriptionClasses").SpecialSubscription; |
var FilterStorage = require("filterStorage").FilterStorage; |
var defaultMatcher = require("matcher").defaultMatcher; |
var ElemHide = require("elemHide").ElemHide; |
var Synchronizer = require("synchronizer").Synchronizer; |
+ var Prefs = require("prefs").Prefs; |
return { |
getFilterFromText: function(text) |
{ |
text = Filter.normalize(text); |
if (!text) |
throw "Attempted to create a filter from empty text"; |
return Filter.fromText(text); |
@@ -140,11 +141,21 @@ var API = (function() |
var documentHost = extractHostFromURL(documentUrl); |
var thirdParty = isThirdParty(requestHost, documentHost); |
return defaultMatcher.matchesAny(url, contentType, documentUrl, thirdParty); |
}, |
getElementHidingSelectors: function(domain) |
{ |
return ElemHide.getSelectorsForDomain(domain, false); |
+ }, |
+ |
+ getPref: function(pref) |
+ { |
+ return Prefs[pref]; |
+ }, |
+ |
+ setPref: function(pref, value) |
+ { |
+ Prefs[pref] = value; |
} |
}; |
})(); |