WebGLRenderingContext.getSupportedExtensions()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

WebGLRenderingContext.getSupportedExtensions() 方法返回一个所有的支持 WebGL 扩展的列表。

语法

js
getSupportedExtensions()

参数

无。

返回值

一个字符串数组,包含所有支持 WebGL 的扩展。

示例

js
const canvas = document.getElementById("canvas");
gl = canvas.getContext("webgl");

const extensions = gl.getSupportedExtensions();
// Array [ 'ANGLE_instanced_arrays', 'EXT_blend_minmax', … ]

参见用于获得一个特定的扩展对象的 WebGLRenderingContext.getExtension() 方法。

WebGL 扩展

所有 WebGL API 扩展都被注册在 WebGL Extension Registry 中。当前的扩展在这里列出。

规范

Specification
WebGL Specification
# 5.14.14

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getSupportedExtensions

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

参见