Provides a unified way to detect new features that use script elements.

Motivation

Currently there is no simple way to know what kind of types can be used for HTMLScriptElement’s type attribute. There are several new feature proposals using the script element. https://github.com/WICG/import-maps/ https://github.com/jeremyroman/alternate-loading-modes/blob/main/triggers.md#speculation-rules https://github.com/WICG/resource-bundles/ We can use the nomodule attribute to detect the module type support. But there is no unified method to detect such new features. If we have the HTMLScriptElement.supports(type) method which is like HTMLLinkElement.relList.supports(), we can easily detect such features.

Demo

Documentation

Specification

Specification link


Final published standard: Recommendation, Living Standard, Candidate Recommendation, or similar final form

Status in Chromium

Blink>HTML>Script


In developer trial (Behind a flag) (tracking bug)

Consensus & Standardization

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

Owner

Intent to Prototype url

Intent to Prototype thread

Last updated on 2021-09-24