Internet Explorer中的Blazor [英] Blazor in Internet Explorer

查看:210
本文介绍了Internet Explorer中的Blazor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Internet Explorer中运行blazor应用程序.在blazor页面上写的是对不支持webassembly的浏览器的asm.js的备用.但是,当我在IE中加载页面时(链接了blazor.pollyfil.js脚本),我只会收到错误消息浏览器不支持WebAssembly".

I am trying to run blazor application in Internet Explorer. On blazor page is written there is a fallback into asm.js for browsers without webassembly support. But when I load page in IE (with blazor.pollyfil.js script linked), I just get error "Browser does'n support WebAssembly".

我可以在服务器模式下运行应用程序(与呈现服务器的Signalal连接),但这是所有浏览器的解决方案,主要优点(WebAssembly)消失了.

I am able to run application in server mode (SignalR connection to rendering server), but it is solution for all browsers and the main benefit (WebAssembly) disappears.

真的有办法正确地(仅)在Internet Explorer中回到asm.js模式吗?

Is there really way how to correctly fall back to asm.js mode in (only) Internet Explorer?

推荐答案

浏览器兼容性,而不能, IE不支持WebAssembly.

WebAssembly is not included on Internet Explorer features. You can learn about Browser compatibility at mozilla.org, and not, IE has no support for WebAssembly.

记住IE是

Internet Explorer 11会继续接收更新吗?

最新功能和平台更新仅在Microsoft Edge中可用.我们将在其支持的生命周期内继续向Internet Explorer 11提供安全更新.为了确保Windows版本之间行为的一致性,我们将视情况评估Internet Explorer 11错误,以进行维修.

The latest features and platform updates will only be available in Microsoft Edge. We will continue to deliver security updates to Internet Explorer 11 through its supported lifespan. To ensure consistent behavior across Windows versions, we will evaluate Internet Explorer 11 bugs for servicing on a case by case basis.

从WebAssembly更改为组件模式只是几行更改代码,但似乎奇怪的是部署这两种模式以保持IE的兼容性.请记住,Blazor是实验性的,我想要进行真正的部署,您应该等待一段时间……有时间从IE更新到其他浏览器.

Change from WebAssembly to component mode are just a few lines change code, but seems weird to deploy both modes to keep compatibility for IE. Remember Blazor is experimental, I guess for a real deployment you should to wait for a while ... time to update from IE to some other browser.

真的有办法正确地(仅)在Internet Explorer中回到asm.js模式吗?

Is there really way how to correctly fall back to asm.js mode in (only) Internet Explorer?

我想与检查浏览器是否支持WebAssembly?" 只需将anwser修改为blazor:

I guess is the same question as "How can I check if a browser supports WebAssembly?" Just adapt the anwser for blazor:

const supported = (() => {
    try {
        if (typeof WebAssembly === "object"
            && typeof WebAssembly.instantiate === "function") {
            const module = new WebAssembly.Module(
                               Uint8Array.of(0x0, 0x61, 0x73, 0x6d,
                                             0x01, 0x00, 0x00, 0x00));
            if (module instanceof WebAssembly.Module)
                return new WebAssembly.Instance(module) 
                           instanceof WebAssembly.Instance;
        }
    } catch (e) {
    }
    return false;
})();

var script = document.createElement('script');
script.src = (supported)?
             "_framework/blazor.server.js":
             "_framework/blazor.webassembly.js";

请记住在项目中同时包含两个js.

Remember to include both js in your project.

这篇关于Internet Explorer中的Blazor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆