【问题标题】:WARNING Crisp found shims of native JavaScript methods警告 Crisp 发现了原生 JavaScript 方法的 shims
【发布时间】:2022-08-06 22:58:31
【问题描述】:

我们的应用程序中来自 Crisp(实时聊天)的错误是这样说的:

[警告] Crisp 发现了原生 JavaScript 方法的 shims。这个可以 改变聊天框的行为并破坏事物。确保不要覆盖 列出的功能,以确保您的聊天框按预期工作。你可能会 在此页面上寻找其他正在使用的 JavaScript 库。

您可以通过添加以下内容来禁用此警告: $crisp.push([\"safe\", true]) 到 您的页面 JavaScript。

Methods to check: Object.prototype.toString
{
    arguments: [
        [WARNING] Crisp found shims of native JavaScript methods. This can alter the 
        chatbox behavior and break things. Make sure not to override listed functions 
        to ensure your chatbox works as expected. You may be looking for other 
        JavaScript libraries in use on this page.

        You can disable this warning by adding: $crisp.push([\"safe\", true]) to your 
        page JavaScript.

        Methods to check:
        [
            Object.prototype.toString
         ]
    ], 
    logger: console
}

Crisp 用于使用 Angular(版本 12)开发的项目中。

有人遇到这个问题吗?有解决方法吗?

顺便说一句,我们不想禁用警告。

提前感谢您,祝您有美好的一天/晚上!

    标签: angular shim


    【解决方案1】:

    显然您的项目代码或某些依赖项正在使用本机 toString() 方法。

    就我而言,当我们使用 Array() 时,它对我们大喊大叫。我们也不想删除来自 Crisp 的任何警告。

    [WARNING] Crisp found shims of native JavaScript methods. This can alter the chatbox behavior and break things. Make sure not to override listed functions to ensure your chatbox works as expected. You may be looking for other JavaScript libraries in use on this page.
    
    You can disable this warning by adding: $crisp.push(["safe", true]) to your page JavaScript.
    
    Methods to check: Array(1)
    

    如果在您的代码库中找到上述方法,只需将其更改为其他内容。但如果你真的需要它,你也无能为力。只要该方法不干扰 Crisp 功能,我认为只需忽略警告

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多