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

Specification link


Specification being incubated in a Community Group

Status in Chromium

Blink>Network


Enabled by default

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owner

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:"

Last updated on 2021-05-23