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

Unified Diff: lib/basedomain.js

Issue 5666188336037888: Issue 581 - Fixed element hiding/collapsing in anonymous frames on Chrome (Closed)
Patch Set: Also handle <object type="text/html"> Created June 4, 2014, 4:11 p.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
« include.preload.js ('K') | « include.preload.js ('k') | webrequest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/basedomain.js
===================================================================
--- a/lib/basedomain.js
+++ b/lib/basedomain.js
@@ -158,6 +158,22 @@
}
/**
+ * Extracts host name from the URL of the given frame. If the URL don't have host
+ * information (like about:blank or data: URLs) it falls back to the parent frame.
+ */
+function extractHostFromFrame(frame)
+{
+ var host = extractHostFromURL(frame.url);
+ if (!host)
+ {
+ var parentFrame = frame.parent;
+ if (parentFrame)
+ return extractHostFromFrame(parentFrame);
+ }
+ return host;
+}
+
+/**
* Strips the fragment from a URL.
*/
function stripFragmentFromURL(/**String*/ url)
« include.preload.js ('K') | « include.preload.js ('k') | webrequest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld