Index: messageResponder.js |
diff --git a/messageResponder.js b/messageResponder.js |
index a6886cbbe74380c6901224cc87b8d405de5a8da8..e69f437e1669ac56ffffb96a31a026a53c619593 100644 |
--- a/messageResponder.js |
+++ b/messageResponder.js |
@@ -25,10 +25,12 @@ |
var FilterStorage = require("filterStorage").FilterStorage; |
var FilterNotifier = require("filterNotifier").FilterNotifier; |
var defaultMatcher = require("matcher").defaultMatcher; |
- |
+ var CSSRules = require("cssRules").CSSRules; |
+ |
var filterClasses = require("filterClasses"); |
var Filter = filterClasses.Filter; |
var BlockingFilter = filterClasses.BlockingFilter; |
+ var RegExpFilter = filterClasses.RegExpFilter; |
var Synchronizer = require("synchronizer").Synchronizer; |
var subscriptionClasses = require("subscriptionClasses"); |
@@ -194,13 +196,36 @@ |
callback(filter instanceof BlockingFilter); |
break; |
case "filters.get": |
+ if (message.what == "cssproperties") |
+ { |
+ if (!message.domain) |
+ { |
+ callback([]); |
+ break; |
+ } |
+ var specificOnly = require("whitelisting").isFrameWhitelisted( |
Thomas Greiner
2015/11/03 14:26:02
I noticed that in "get-selectors" (see https://hg.
kzar
2015/11/03 15:49:49
Done.
|
+ sender.page, sender.frame, RegExpFilter.typeMap.GENERICHIDE |
+ ); |
+ var filters = CSSRules.getRulesForDomain(message.domain, specificOnly); |
+ filters = filters.map(function(filter) |
+ { |
+ return { |
+ prefix: filter.selectorPrefix, |
+ suffix: filter.selectorSuffix, |
+ regexp: filter.regexpString |
+ }; |
+ }); |
+ callback(filters); |
+ break; |
+ } |
+ |
var subscription = Subscription.fromURL(message.subscriptionUrl); |
if (!subscription) |
{ |
callback([]); |
break; |
} |
- |
+ |
callback(subscription.filters.map(convertFilter)); |
break; |
case "filters.importRaw": |