在 iOS 14.2 上找不到变量 webkit

Posted

技术标签:

【中文标题】在 iOS 14.2 上找不到变量 webkit【英文标题】:Can't find variable webkit on iOS 14.2 【发布时间】:2021-03-03 10:41:22 【问题描述】:

我正在开发基于 AngularJS 1.7 的网络应用程序。该应用程序在带有 ios 12、14.0、14.1 的 Safari 上运行良好 - 但由于我已将我的 iOS 升级到 14.2/14.3(检查了它们) - 我收到以下错误:

ReferenceError:找不到变量:webkit

当我尝试调用 webkit 时出现 - 像这样:

  try 
    webkit.messageHandlers.callback.postMessage(JSON.stringify(userData));
    
   catch (err) 
    console.log('There was some problem sending message native app to IOS');

  

我不是 iOS 本地开发人员 - 但我确信回调函数没有改变,正如我之前提到的 - 它在以前的 iOS 版本上运行良好......有什么想法吗?

【问题讨论】:

我的一个用户也在基于反应的 web 应用中看到了这一点。但我自己不会这么叫!我不知道发生了什么。 【参考方案1】:

尝试从窗口调用它(使用window.webkit

【讨论】:

这并没有提供问题的答案。一旦你有足够的reputation,你就可以comment on any post;相反,provide answers that don't require clarification from the asker。 - From Review

以上是关于在 iOS 14.2 上找不到变量 webkit的主要内容,如果未能解决你的问题,请参考以下文章

(在通道 plugins.flutter.io 上找不到方法 canLaunch 的实现...)

在 iOS 表格视图中的“NSIndexPath *”类型的对象上找不到属性“行”

在 AWS 上找不到 404

MissingPluginException(在通道 plugins.flutter.io/path_provider 上找不到方法 getApplicationDocumentsDirectory

在通道 plugins.flutter.io/path_provider 上找不到方法 getApplicationDocumentsDirectory 的实现

MissingPluginException(在通道 plugins.flutter.io/firebase_auth 上找不到方法 signInWithCredential 的实现)