本文介绍了科尔多瓦ios WKWebView升级-显示某些图像时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ionic 1和AngularJS 1.5开发一个应用程序

有人告诉我,我需要升级ios以使用WKWebView而不是UIWebView: https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/?utm_campaign=enterprise&utm_source=hs_email&utm_medium=email&utm_content=85 ; _hsenc = p2ANqtz--vsf3kcg7MssMWwjv2_GpHmVbzN23_5fXDfKT0E6OileYraLWs9btGPqWUcq5mzTKCtKwXGqO35V3SnInjypj4uqSBRg = 85

这是我的设置:

cordova-android 8.1.0
cordova-ios 5.1.0
cordova-plugin-ionic-webview 4.1.3
cordova 8.1.2
ionic 5.4.16
node 10.19.0
iOS 13 iPhone 11 Pro Max

Error:

unsafe:ionic://localhost/img/white/activities.svg
An error occurred while trying to load the resource

我在这里尝试了消毒的建议,但它似乎对我不起作用: https://github.com/ionic-team/cordova- plugin-ionic-webview/issues/284

如何显示图像?

解决方案

实际上,我的代码有问题,是的,这里的建议确实可行: https://github.com/ionic-team/cordova- plugin-ionic-webview/issues/284

    $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|ionic):|data:image\//);

现在我的所有图像都显示出来.

I'm working on an app with Ionic 1 and AngularJS 1.5

I was told that I need to upgrade my ios to use WKWebView instead of UIWebView:https://ionicframework.com/blog/understanding-itms-90809-uiwebview-api-deprecation/?utm_campaign=enterprise&utm_source=hs_email&utm_medium=email&utm_content=85128961&_hsenc=p2ANqtz--vsf3kcg7MssMWwjv2_GpHmVbzN23_5fXDfKT0E6OileYraLWs9btGPqWUcq5mzTKCtKwXGqO35V3SnInjypj4uqSBRg&_hsmi=85128961

Here is my setup:

cordova-android 8.1.0
cordova-ios 5.1.0
cordova-plugin-ionic-webview 4.1.3
cordova 8.1.2
ionic 5.4.16
node 10.19.0
iOS 13 iPhone 11 Pro Max

Error:

unsafe:ionic://localhost/img/white/activities.svg
An error occurred while trying to load the resource

I have tried the suggestion here with the sanitize but it doesn't seem to work for me:https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/284

How can I get my images to show?

解决方案

Actually, there was a problem with my code and yes, the suggestion here does work:https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/284

    $compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|blob|ionic):|data:image\//);

Now all my images show.

这篇关于科尔多瓦ios WKWebView升级-显示某些图像时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 00:47