Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/child/elemHide.js

Issue 29346609: Issue 4162 - Rename about:abp-elemhidehit into about:abp-elemhide (Closed)
Patch Set: Created June 17, 2016, 12:19 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/elemHideStylesheet.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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("',
« no previous file with comments | « no previous file | lib/elemHideStylesheet.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld