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

Unified Diff: lib/url.js

Issue 29739594: Issue 6543 - Match requests without tabId/frameId in their originating context (Closed)
Patch Set: Created April 2, 2018, 2:55 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
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) : "";
};
/**

Powered by Google App Engine
This is Rietveld