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

Unified Diff: lib/url.js

Issue 29333522: Issue 3515 - Adapted polyfill for URL class for consistency (Closed)
Patch Set: Created Jan. 14, 2016, 5:22 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
Index: lib/url.js
===================================================================
--- a/lib/url.js
+++ b/lib/url.js
@@ -17,37 +17,6 @@
/** @module url */
-window.URL = (function()
-{
- let URL = window.URL || window.webkitURL;
- let URLProperties = ["href", "protocol", "host", "hostname", "pathname", "search"];
-
- if (!URL || !URLProperties.every(prop => prop in new URL("about:blank")))
- {
- let doc = document.implementation.createHTMLDocument();
-
- let base = doc.createElement("base");
- doc.head.appendChild(base);
-
- let anchor = doc.createElement("a");
- doc.body.appendChild(anchor);
-
- URL = function(url, baseUrl)
- {
- if (baseUrl instanceof URL)
- base.href = baseUrl.href;
- else
- base.href = baseUrl || "";
- anchor.href = url;
-
- for (let prop of URLProperties)
- this[prop] = anchor[prop];
- };
- }
-
- return URL;
-})();
-
/**
* Gets the IDN-decoded hostname from a URL object.
*
« no previous file with comments | « lib/polyfill/url.js ('k') | metadata.common » ('j') | safari/ext/background.js » ('J')

Powered by Google App Engine
This is Rietveld