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

Unified Diff: lib/child/elemHide.js

Issue 29329550: Issue 3208 - Move getFrames() function from child/elemHide module into a shared child/utils module (Closed)
Patch Set: Created Oct. 30, 2015, 7:50 p.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/child/utils.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
@@ -28,51 +28,28 @@ try
delete proto.Components;
}
catch (e)
{
Cu.reportError(e);
}
let {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
-let {PrivateBrowsingUtils} = Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm")
let {Utils} = require("utils");
+let {getFrames} = require("child/utils");
let messageID = 0;
// The allowXBL binding below won't have any effect on the element. For elements
// that should be hidden however we don't return any binding at all, this makes
// Gecko stop constructing the node - it cannot be shown.
const allowXBL = "<bindings xmlns='http://www.mozilla.org/xbl'><binding id='dummy' bindToUntrustedContent='true'/></bindings>";
const hideXBL = "<bindings xmlns='http://www.mozilla.org/xbl'/>";
-function getFrames(window)
-{
- let frames = [];
- while (window)
- {
- let frame = {
- location: window.location.href,
- sitekey: null
- };
-
- let documentElement = window.document && window.document.documentElement;
- if (documentElement)
- frame.sitekey = documentElement.getAttribute("data-adblockkey")
-
- if (window == window.parent)
- frame.privateBrowsing = PrivateBrowsingUtils.isWindowPrivate(window);
-
- frames.push(frame);
- window = (window != window.parent ? window.parent : null);
- }
- return frames;
-}
-
/**
* 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",
« no previous file with comments | « no previous file | lib/child/utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld