← Back to release summary

Make 'true' a truthy value for window.open boolean features

Category
DOM
Type
No developer-visible change
Status
Enabled by default (Chrome 101)
Intent stage
Prepare to ship

Summary

This is a recent change [1] to the spec for parsing the windowFeatures argument to window.open(). Previous to this change, window.open(url,'','popup=true') interpreted the 'popup=true' to mean popup is false. With this change, 'true' counts as a truthy value. [1] https://github.com/whatwg/html/pull/7425

Motivation

Having `popup=true` result in popup being false is counterintuitive and confusing. Making this change should make boolean features easier to use and understand.

Standards & signals

Explainers: https://github.com/whatwg/html/issues/7399

View on chromestatus.com