demo · v142
Strict JSON MIME
Type a Content-Type. The simulator splits it into type and subtype, applies the HTTP token rules from the MIME Sniffing spec, and tells you whether Chrome ≤ 141 (sniff-friendly) or Chrome 142+ (strict tokens) would accept it as a JSON module. Use the try fetch button to actually import a module that returns each MIME.
type
—
subtype
—
Chrome ≤ 141 (lenient)
—
Chrome 142+ (strict tokens)
—
The live test serves the chosen MIME via a data: URL and tries import(url, { with: { type: "json" } }). Browsers that don't support import attributes won't be able to execute it.
relevant API
const config = await import("./config.json", { with: { type: "json" } });
// Chrome 142+: server must return Content-Type that is exactly
// application/json, text/json, or */XXX+json with HTTP-token-clean tokens.
see also
- Strict JSON MIME — feature index
- ChromeStatus entry