| 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) |