Bra*_*ain 5 iframe uiwebview ios cordova wkwebview
根据 Apache Cordova 博客,iframe 可能无法使用 WKWebView 工作。( https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html )
我在 App Store 中有一个 Cordova 应用程序,它非常依赖 iframe。由于 UIWebView 很可能在 iOS 13 中被删除,有没有办法让 iframe 使用 WKWebView 工作?
这是我到目前为止所做的:
我尝试使用 Ionic WebView 插件 ( https://github.com/ionic-team/cordova-plugin-ionic-webview ),虽然它适用于我的应用程序的某些部分,但它不适用于 iframe 页面。具体来说,我收到 Access-Control-Allow-Origin 标头包含无效值“null”。使用 UIWebView 不会出现此错误。
小智 0
将其添加到您的 Cordova config.xml
<allow-navigation href="http://*.yourdomain.com/*" />
Run Code Online (Sandbox Code Playgroud)
它将允许您的 HTML 页面(无论是根文档还是 iframe 中的子文档)从本地主机重定向到远程 URL。