Index: messageResponder.js |
=================================================================== |
--- a/messageResponder.js |
+++ b/messageResponder.js |
@@ -20,17 +20,17 @@ |
if (!global.ext) |
global.ext = require("ext_background"); |
var Prefs = require("prefs").Prefs; |
var Utils = require("utils").Utils; |
var FilterStorage = require("filterStorage").FilterStorage; |
var FilterNotifier = require("filterNotifier").FilterNotifier; |
var defaultMatcher = require("matcher").defaultMatcher; |
- var CSSRules = require("cssRules").CSSRules; |
+ var ElemHideEmulation = require("elemHideEmulation").ElemHideEmulation; |
var NotificationStorage = require("notification").Notification; |
var filterClasses = require("filterClasses"); |
var Filter = filterClasses.Filter; |
var BlockingFilter = filterClasses.BlockingFilter; |
var RegExpFilter = filterClasses.RegExpFilter; |
var Synchronizer = require("synchronizer").Synchronizer; |
@@ -215,32 +215,31 @@ |
break; |
case "filters.blocked": |
var filter = defaultMatcher.matchesAny(message.url, |
RegExpFilter.typeMap[message.requestType], message.docDomain, |
message.thirdParty); |
callback(filter instanceof BlockingFilter); |
break; |
case "filters.get": |
- if (message.what == "cssproperties") |
+ if (message.what == "elemhideemulation") |
{ |
var filters = []; |
var checkWhitelisted = require("whitelisting").checkWhitelisted; |
if (Prefs.enabled && !checkWhitelisted(sender.page, sender.frame, |
RegExpFilter.typeMap.DOCUMENT | |
RegExpFilter.typeMap.ELEMHIDE)) |
{ |
- filters = CSSRules.getRulesForDomain(sender.frame.url.hostname); |
+ var hostname = sender.frame.url.hostname; |
+ filters = ElemHideEmulation.getRulesForDomain(hostname); |
filters = filters.map(function(filter) |
{ |
return { |
- prefix: filter.selectorPrefix, |
- suffix: filter.selectorSuffix, |
- regexp: filter.regexpString, |
+ selector: filter.selector, |
text: filter.text |
}; |
}); |
} |
callback(filters); |
break; |
} |