A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/ImageDecoder/isTypeSupported_static below:

ImageDecoder: isTypeSupported() static method - Web APIs

ImageDecoder: isTypeSupported() static method

Limited availability

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Dedicated Web Workers.

The ImageDecoder.isTypeSupported() static method checks if a given MIME type can be decoded by the user agent.

Syntax
ImageDecoder.isTypeSupported(type)
Parameters
type

A string containing the MIME type to check for decoding support.

Return value

A promise that resolves with a boolean value indicating whether images with a format of type can be decoded by the API.

Examples

The following example checks if GIF and PCX images are supported for decoding and prints the result to the console.

let isGifSupported = await ImageDecoder.isTypeSupported("image/gif");
console.log(`GIF supported: ${isGifSupported}`); // Likely true.

let isPcxSupported = await ImageDecoder.isTypeSupported("image/pcx");
console.log(`PCX supported: ${isPcxSupported}`); // Probably false
Specifications Browser compatibility

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4