简体   繁体   English

我可以从IE11中的Web Worker访问MSCrypto吗?

[英]Can I access MSCrypto from a Web Worker in IE11?

IE11's Web Crypto is located inside of window.msCrypto , whereas for Firefox or Chrome, it's accessible in window.crypto . IE11的Web Crypto位于window.msCrypto内部,而对于Firefox或Chrome,它可以在window.crypto访问。

Web Workers do not have access to the window context but, thankfully, Chrome and Firefox also expose the crypto variable in the Web Worker context (so, at the global level, you can use this.crypto to access the Web Crypto suite in a Web Worker). Web Workers无法访问window上下文,但幸运的是,Chrome和Firefox还在Web Worker上下文中公开了crypto变量(因此,在全局级别,您可以使用this.crypto访问Web中的Web Crypto套件工人)。 It would seem, however, that IE11 does not expose this.msCrypto in their Web Worker context. 不过,看来,这IE11 公开this.msCrypto在他们的Web工作环境。

Is that correct? 那是对的吗? Is there any way to use Web Crypto in an IE11 Web Worker? 有没有办法在IE11 Web Worker中使用Web Crypto?

"support Web Crypto API inside a Web Worker" is an open issue on Microsoft developer site https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7607496/ “支持Web Worker中的Web Crypto API”是Microsoft开发人员网站上的一个未解决的问题https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7607496/

The Web Crypto API is not available inside a Web Worker. Web Crypto API在Web Worker中不可用。 Both "self.crypto" and "self.msCrypto" are undefined inside a worker context. “self.crypto”和“self.msCrypto”都是在工作者上下文中未定义的。

I guess is the same issue for IE11 but I have not found documentation 我猜IE11也是同样的问题,但我没有找到文档

In this thread suggests a workaround, changing from web worker thread to main thread to execute the WebCrypto operations. 在此线程中建议一种解决方法,从Web工作线程更改为主线程以执行WebCrypto操作。 It is assumed that performance will be lost, and programming surely will be complex 假设性能将会丢失,编程肯定会很复杂

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM