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: Use URL patterns to find tabs for initiator Created April 4, 2018, 1:01 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) : "";
};
/**
« lib/requestBlocker.js ('K') | « lib/requestBlocker.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld