Index: lib/url.js |
=================================================================== |
--- a/lib/url.js |
+++ b/lib/url.js |
@@ -45,10 +45,11 @@ |
* If the URL don't have host information (like "about:blank" |
* and "data:" URLs) it falls back to the parent frame. |
* |
- * @param {Frame} frame |
+ * @param {?Frame} frame |
+ * @param {URL} [originUrl] |
* @return {string} |
*/ |
-exports.extractHostFromFrame = frame => |
+exports.extractHostFromFrame = (frame, originUrl) => |
{ |
for (; frame; frame = frame.parent) |
{ |
@@ -57,7 +58,7 @@ |
return hostname; |
} |
- return ""; |
+ return originUrl ? getDecodedHostname(originUrl) : ""; |
}; |
/** |