--- title: WebGLRenderingContext.getSupportedExtensions() slug: Web/API/WebGLRenderingContext/getSupportedExtensions translation_of: Web/API/WebGLRenderingContext/getSupportedExtensions ---
{{APIRef("WebGL")}}

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

语法

gl.getSupportedExtensions();

返回值

一个字符串 {{jsxref("Array")}} 数组,包含所有支持 WebGL 的扩展。

示例代码

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

var extensions = gl.getSupportedExtensions();
// Array [ "ANGLE_instanced_arrays", "EXT_blend_minmax", ... ]

浏览 {{domxref("WebGLRenderingContext.getExtension()")}} 方法得到一个特定的扩展对象。

WebGL 扩展

所有WebGL API 扩展都被注册在 WebGL Extension Registry 中。当前的扩展是:

{{page("en-US/docs/Web/API/WebGL_API", "Extension_interfaces")}}

规格说明书

规格说明书 状态 注释
{{SpecName("WebGL", "#5.14.14", "WebGLRenderingContext.getSupportedExtensions")}} {{Spec2("WebGL")}} Initial definition.

浏览器兼容性

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 9 {{CompatGeckoDesktop("2.0")}} 11 12 5.1
ANGLE_instanced_arrays {{CompatUnknown}} {{CompatGeckoDesktop("33.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_blend_minmax {{CompatUnknown}} {{CompatGeckoDesktop("33.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_color_buffer_half_float {{CompatUnknown}} {{CompatGeckoDesktop("30.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_disjoint_timer_query {{CompatUnknown}} {{CompatGeckoDesktop("41.0")}} [1] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_frag_depth {{CompatUnknown}} {{CompatGeckoDesktop("30.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_sRGB {{CompatUnknown}} {{CompatGeckoDesktop("28.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_shader_texture_lod {{CompatUnknown}} {{CompatGeckoDesktop("34.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_texture_filter_anisotropic {{CompatUnknown}} {{CompatGeckoDesktop("17.0")}} [2] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_element_index_uint {{CompatUnknown}} {{CompatGeckoDesktop("24.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_standard_derivatives {{CompatUnknown}} {{CompatGeckoDesktop("10.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_float {{CompatUnknown}} {{CompatGeckoDesktop("6.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_float_linear {{CompatUnknown}} {{CompatGeckoDesktop("24.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_half_float {{CompatUnknown}} {{CompatGeckoDesktop("29.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_half_float_linear {{CompatUnknown}} {{CompatGeckoDesktop("30.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_vertex_array_object {{CompatUnknown}} {{CompatGeckoDesktop("25.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_color_buffer_float {{CompatUnknown}} {{CompatGeckoDesktop("30.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_atc {{CompatUnknown}} {{CompatGeckoDesktop("18.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_etc1 {{CompatUnknown}} {{CompatGeckoDesktop("30.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_pvrtc {{CompatUnknown}} {{CompatGeckoDesktop("18.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_s3tc {{CompatUnknown}} {{CompatGeckoDesktop("15.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_debug_renderer_info {{CompatUnknown}} {{CompatGeckoDesktop("19.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_debug_shaders {{CompatUnknown}} {{CompatGeckoDesktop("30.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_depth_texture {{CompatUnknown}} {{CompatGeckoDesktop("17.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_draw_buffers {{CompatUnknown}} {{CompatGeckoDesktop("28.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_lose_context {{CompatUnknown}} {{CompatGeckoDesktop("19.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} 25 {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} 12 8.1
ANGLE_instanced_arrays {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_blend_minmax {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_color_buffer_half_float {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_disjoint_timer_query {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_frag_depth {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_sRGB {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_shader_texture_lod {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
EXT_texture_filter_anisotropic {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_element_index_uint {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_standard_derivatives {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_float {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_float_linear {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_half_float {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_texture_half_float_linear {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
OES_vertex_array_object {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_color_buffer_float {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_atc {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_etc1 {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_pvrtc {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_compressed_texture_s3tc {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_debug_renderer_info {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_debug_shaders {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_depth_texture {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_draw_buffers {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
WEBGL_lose_context {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

[1] Toggling the webgl.enable-draft-extensions preference in about:config is required.

[2] This was prefixed as MOZ_EXT_texture_filter_anisotropic in prior versions.

浏览其他相关资源