You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:Skype Web Control的sdk.min.js导致IE中机器人无法运行的问题

Fix for Skype Web Control SDK IE Compatibility (getRandomValues Undefined Error)

The root cause here is that Internet Explorer 11 and older versions don't natively support window.crypto.getRandomValues—an API the Skype Web Control SDK depends on for initialization. Since you can't modify the sdk.min.js file directly, the solution is to add a polyfill for this API before loading the Skype SDK.

Step-by-Step Fix:

  1. Inject a polyfill for crypto.getRandomValues right before the Skype SDK script tag. This will patch the missing API in IE without altering the SDK itself.
  2. Use the following code to cover both IE11 (which has a renamed msCrypto object) and older IE versions:
<span class="skype-button bubble " data-bot-id="vdasdsadsadyapzK5k-C7Zw9acGTpVddH9CCj8" data-color="#1C57D9"></span>
<span class="skype-chat" data-color-message="#27D1F0"></span>
<!-- Polyfill for crypto.getRandomValues - must load BEFORE Skype SDK -->
<script>
// Map IE11's msCrypto to standard crypto object
if (!window.crypto && window.msCrypto) {
  window.crypto = window.msCrypto;
}

// Fallback for older IE versions with no crypto support
if (!window.crypto?.getRandomValues) {
  window.crypto = {
    getRandomValues: function(array) {
      // Basic non-cryptographically secure implementation (works for SDK's needs)
      for (var i = 0; i < array.length; i++) {
        array[i] = Math.floor(Math.random() * 256);
      }
      return array;
    }
  };
}
</script>
<script src="https://swc.cdn.skype.com/sdk/v1/sdk.min.js"></script>

Why This Works:

  • For IE11: We alias the browser's native msCrypto (which has the same getRandomValues functionality) to the standard window.crypto name the SDK expects.
  • For older IE versions: We add a simple fallback implementation of getRandomValues. While this isn't cryptographically secure, it's sufficient for the SDK's use case (generating random identifiers for the chat control) and will allow the SDK to initialize without errors.

This approach keeps your existing Skype control markup intact, works seamlessly in Chrome (since the polyfill won't run in modern browsers), and resolves the IE compatibility issue without modifying the SDK file.

内容的提问来源于stack exchange,提问作者vikbehal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 05:28:24