Index: lib/whitelisting.js |
=================================================================== |
--- a/lib/whitelisting.js |
+++ b/lib/whitelisting.js |
@@ -28,7 +28,7 @@ |
* @param {Page} page |
* @return {WhitelistFilter} The active filter whitelisting this page or null |
*/ |
-function isPageWhitelisted(page) |
+exports.isPageWhitelisted = function(page) |
{ |
let url = page.url; |
@@ -36,8 +36,7 @@ |
stringifyURL(url), "DOCUMENT", |
getDecodedHostname(url), false, null |
); |
-} |
-exports.isPageWhitelisted = isPageWhitelisted; |
+}; |
/** |
* Checks whether a frame is whitelisted. |
@@ -48,7 +47,7 @@ |
* the frame is whitelisted for. |
* @return {Boolean} |
*/ |
-function isFrameWhitelisted(page, frame, type) |
+exports.isFrameWhitelisted = function(page, frame, type) |
{ |
while (frame) |
{ |
@@ -69,8 +68,7 @@ |
} |
return false; |
-} |
-exports.isFrameWhitelisted = isFrameWhitelisted; |
+}; |
/** |
* Gets the public key, previously recorded for the given page |
@@ -80,7 +78,7 @@ |
* @param {Frame} frame |
* @return {string} |
*/ |
-function getKey(page, frame) |
+exports.getKey = function(page, frame) |
{ |
let urlsWithKey = pagesWithKey.get(page); |
if (!urlsWithKey) |
@@ -94,8 +92,7 @@ |
} |
return null; |
-} |
-exports.getKey = getKey; |
+}; |
function verifyKey(key, signature, url) |
{ |
@@ -132,7 +129,7 @@ |
* @param {Page} page |
* @param {Frame} frame |
*/ |
-function processKey(token, page, frame) |
+exports.processKey = function(token, page, frame) |
{ |
if (token.indexOf("_") < 0) |
return; |
@@ -142,5 +139,4 @@ |
if (verifyKey(key, signature, frame.url)) |
recordKey(page, frame.url, key); |
-} |
-exports.processKey = processKey; |
+}; |