Index: lib/child/elemHide.js |
=================================================================== |
--- a/lib/child/elemHide.js |
+++ b/lib/child/elemHide.js |
@@ -49,17 +49,17 @@ const notImplemented = () => Cr.NS_ERROR |
/** |
* about: URL module used to count hits. |
* @class |
*/ |
let AboutHandler = |
{ |
classID: Components.ID("{55fb7be0-1dd2-11b2-98e6-9e97caf8ba67}"), |
classDescription: "Element hiding hit registration protocol handler", |
- aboutPrefix: "abp-elemhidehit", |
+ aboutPrefix: "abp-elemhide", |
/** |
* Registers handler on startup. |
*/ |
init: function() |
{ |
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); |
registrar.registerFactory(this.classID, this.classDescription, |
@@ -88,24 +88,24 @@ let AboutHandler = |
getURIFlags: function(uri) |
{ |
return Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT; |
}, |
newChannel: function(uri, loadInfo) |
{ |
- let match = /\?(\d+|css)$/.exec(uri.path); |
+ let match = /\?(?:hit(\d+)|css)$/.exec(uri.path); |
if (!match) |
throw Cr.NS_ERROR_FAILURE; |
- if (match[1] == "css") |
+ if (match[1]) |
+ return new HitRegistrationChannel(uri, loadInfo, match[1]); |
+ else |
return new StyleDataChannel(uri, loadInfo); |
- else |
- return new HitRegistrationChannel(uri, loadInfo, match[1]); |
}, |
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory, Ci.nsIAboutModule]) |
}; |
AboutHandler.init(); |
/** |
* Base class for channel implementations, subclasses usually only need to |
@@ -226,17 +226,17 @@ StyleDataChannel.prototype = { |
{ |
return "\\" + match.charCodeAt(0).toString(16) + " "; |
} |
// Would be great to avoid sync messaging here but nsIStyleSheetService |
// insists on opening channels synchronously. |
let domains = port.emitSync("getSelectors"); |
- let cssPrefix = "{-moz-binding: url(about:abp-elemhidehit?"; |
+ let cssPrefix = "{-moz-binding: url(about:abp-elemhide?hit"; |
let cssSuffix = "#dummy) !important;}\n"; |
let result = []; |
for (let [domain, selectors] of domains) |
{ |
if (domain) |
{ |
result.push('@-moz-document domain("', |