Index: lib/api.js |
=================================================================== |
--- a/lib/api.js |
+++ b/lib/api.js |
@@ -110,16 +110,35 @@ var API = (function() |
getListedSubscriptions: function() |
{ |
return FilterStorage.subscriptions.filter(function(s) |
{ |
return !(s instanceof SpecialSubscription) |
}); |
}, |
+ getRecommendedSubscriptions: function() |
+ { |
+ var subscriptions = require("subscriptions.xml"); |
+ var result = []; |
+ for (var i = 0; i < subscriptions.length; i++) |
+ { |
+ var subscription = Subscription.fromURL(subscriptions[i].url); |
+ subscription.title = subscriptions[i].title; |
+ subscription.homepage = subscriptions[i].homepage; |
+ |
+ // These aren't normally properties of a Subscription object |
+ subscription.author = subscriptions[i].author; |
+ subscription.prefixes = subscriptions[i].prefixes; |
+ subscription.specialization = subscriptions[i].specialization; |
+ result.push(subscription); |
+ } |
+ return result; |
+ }, |
+ |
checkFilterMatch: function(url, contentType, documentUrl) |
{ |
// TODO: set thirdParty properly |
var thirdParty = false; |
return defaultMatcher.matchesAny(url, contentType, documentUrl, thirdParty); |
}, |
getElementHidingSelectors: function(domain) |