src/elementMgr.js
function initWebGL() {

  var NAMES = ['webgl2', 'webgl', 'experimental-webgl2', 'experimental-webgl', 'webkit-3d', 'moz-webgl'];
  for (let i = 0; i < NAMES.length; i++) {
    try {
      let ctx = currCanvas.getContext(NAMES[i], {
        alpha: true,
        antialias: true,
        premultipliedAlpha: true,
        failIfMajorPerformanceCaveat: false,
      });
      if (ctx) currWebGL = ctx;
    } catch (e) { }
  }
  if (!currWebGL) {
    console.error('Live2D widgets: Failed to create WebGL context.');
    if (!window.WebGLRenderingContext) {
      console.error('Your browser may not support WebGL, check https://get.webgl.org/ for futher information.');
    }
    return;
  }
}
function initWebGL() {

  var NAMES = ['webgl2', 'webgl', 'experimental-webgl2', 'experimental-webgl', 'webkit-3d', 'moz-webgl'];
  for (let i = 0; i < NAMES.length; i++) {
    try {
      let ctx = currCanvas.getContext(NAMES[i], {
        alpha: true,
        antialias: true,
        premultipliedAlpha: true,
        failIfMajorPerformanceCaveat: false,
      });
      if (ctx) currWebGL = ctx;
    } catch (e) { }
  }
  if (!currWebGL) {
    console.error('Live2D widgets: Failed to create WebGL context.');
    if (!window.WebGLRenderingContext) {
      console.error('Your browser may not support WebGL, check https://get.webgl.org/ for futher information.');
    }
    return;
  }
}
function initWebGL ( ) { var NAMES = [ 'webgl2' , 'webgl' , 'experimental-webgl2' , 'experimental-webgl' , 'webkit-3d' , 'moz-webgl' ] ; for ( let i = 0 ; i < NAMES . length ; i ++ ) { try { let ctx = currCanvas . getContext ( NAMES [ i ] , { alpha : true , antialias : true , premultipliedAlpha : true , failIfMajorPerformanceCaveat : false , } ) ; if ( ctx ) currWebGL = ctx ; } catch ( e ) { } } if ( ! currWebGL ) { console . error ( 'Live2D widgets: Failed to create WebGL context.' ) ; if ( ! window . WebGLRenderingContext ) { console . error ( 'Your browser may not support WebGL, check https://get.webgl.org/ for futher information.' ) ; } return ; } }
Find and set the current WebGL element to the container
@return {null}
Find and set the current WebGL element to the container