Index: lib/url.js |
=================================================================== |
--- a/lib/url.js |
+++ b/lib/url.js |
@@ -53,6 +53,7 @@ |
* |
* @param {URL} url |
* @return {string} |
+ * @static |
*/ |
function getDecodedHostname(url) |
{ |
@@ -73,7 +74,7 @@ |
* @param {Frame} frame |
* @return {string} |
*/ |
-function extractHostFromFrame(frame) |
+exports.extractHostFromFrame = function(frame) |
{ |
for (; frame; frame = frame.parent) |
{ |
@@ -83,8 +84,7 @@ |
} |
return ""; |
-} |
-exports.extractHostFromFrame = extractHostFromFrame; |
+}; |
/** |
* Converts a URL object into a string. For HTTP(S) URLs |
@@ -93,7 +93,7 @@ |
* @param {URL} url |
* @return {string} |
*/ |
-function stringifyURL(url) |
+exports.stringifyURL = function(url) |
{ |
let protocol = url.protocol; |
let href = url.href; |
@@ -110,9 +110,7 @@ |
} |
return href; |
-} |
- |
-exports.stringifyURL = stringifyURL; |
+}; |
function isDomain(hostname) |
{ |
@@ -154,7 +152,7 @@ |
* @param {string} documentHost The IDN-decoded hostname of the document |
* @return {Boolean} |
*/ |
-function isThirdParty(url, documentHost) |
+exports.isThirdParty = function(url, documentHost) |
{ |
let requestHost = getDecodedHostname(url).replace(/\.+$/, ""); |
documentHost = documentHost.replace(/\.+$/, ""); |
@@ -166,5 +164,4 @@ |
return true; |
return getBaseDomain(requestHost) != getBaseDomain(documentHost); |
-} |
-exports.isThirdParty = isThirdParty; |
+}; |