javascript判断是否支持WebAssembly

javascript判断是否支持WebAssembly

 

       function  iswebasm(){
     var useWasm = 0;
        var webAsmObj = window["WebAssembly"];
        if (typeof webAsmObj === "object")
    {
            if (typeof webAsmObj["Memory"] === "function")
      {
        if ((typeof webAsmObj["instantiateStreaming"] === "function") || (typeof webAsmObj["instantiate"] === "function"))
          useWasm = 1;
      }
    }        
       }

 

posted @ 2020-11-05 14:01  newmiracle宇宙  阅读(590)  评论(0编辑  收藏  举报