Aligns behavior with the standard in edge cases when changing the URL protocol to or from "file". Previously, attempting to change the protocol of a URL with credentials or a port to "file" would lead to an invalid URL. Similarly, attempting to change a URL with no host from "file" to "http" would lead to an invalid URL. Now the invalid change will be ignored for consistency with other browsers. This affects the "protocol" attribute on the URL API, location, and <a> and <area> elements.
Motivation
Improved standards compliance and interoperability with other browsers.
Specification
Status in Chromium
No active development in:
- Chrome for desktop release No active development
- Chrome for Android release 90
- Chrome for iOS release 90
Consensus & Standardization
After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.
- Worth prototyping
- No signal
- Shipped/Shipping
- No signals
Owner
Last updated on 2021-02-17
Comments
Prior to this change: > url.href = 'http://localhost:8001'; > url.protocol <- "http:" > url.protocol = "file"; > url.href <- "file://localhost:8001/" > url.protocol <- ":" After this change: > url.href = 'http://localhost:8001'; > url.protocol <- "http:" > url.protocol = "file"; > url.href <- "http://localhost:8001/" > url.protocol <- "http:"