← Back to release summary

URL protocol setter: New restrictions for file URLs

Category
JavaScript
Type
No developer-visible change
Status
Enabled by default (Chrome 90)
Intent stage
Shipped

Summary

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.

Standards & signals

View on chromestatus.com