Closed sombatos closed 1 year ago
Using window.WkWebView.convertFilePath('your/file/path')
as recommended in some places does not help.
// Assuming localFile contains "file:///private/var/whatever..."
localFile = window.WkWebView.convertFilePath(localFile);
window.open(localFile)
Works for me Cordova iOS 6.2.0.
Thanks. It works with window.open()
.
Hopefully window.open()
does not create an extra window but simply changes location of the current window.
Also one need to keep in mind that window.open()
will work only as a result of clicking some link. It won't work if you just do:
<script>
window.open("../test/page.html");
</script>
Read more in this comment: https://github.com/apache/cordova-ios/issues/898#issuecomment-729450208
And the real user has to cause the event. For example emulating click event via $("#test").click()
will not work.
Bug Report
Links to the upper level URLs (
../test/page.html
) work fine on iOS 12 but do not work on iOS 15-16.Also the following JavaScript code does not work anymore (before it was redirecting to the specified page):
Is this something that need to be fixed in
cordova-ios
? Or maybe there is some workaround?Version information
iOS 15-16
XCode 13.0.x