origin is null for requests sent with window.fetch on WKWebView engine
See original GitHub issueIssue Type
- Bug Report
- Feature Request
- Support Question
Description
I’m attempting to upgrade cordova-ios from 5.1.1 to 6.0.0 for a project. At the same time, I’m also trying to migrate from uiwebview to wkwebview since that’s the new default. And uiwebview is going to be deprecated anyways.
Following the release note, I’ve managed to get the standard xhr working by setting the scheme
and hostname
preferences in config.xml
However the requests sent with window.fetch still have the origin set to null despite the custom scheme configuration.
Is that the expected behavior, and I will have to migrate to some other plugin to replace the window.fetch functionality? Is there something else that I’m missing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
WKWebview Origin null is not allowed by Access-Control ...
The underlying problem is that WKWebview expects local files to respect CORS as well, and basically you need to tell it to ignore...
Read more >apps for iOS: switching to WKWebView - SAP Blogs
In this Cordova version UIWebView has been completely removed and we no longer need to use the wkwebview-engine plugin and some of the ......
Read more >WKWebView needs feature to allow file:// subresources
The error I'm getting when trying to communicate between the main window and a local iframe is: Blocked a frame with origin "null"...
Read more >Blog - Apache Cordova
Deprecation of the Cordova WKWebView Engine Plugin ... are instead opened in the same webview as if they had not requested a new...
Read more >Breaking and Fixing Origin-Based Access Control in Hybrid ...
First, it provides an embedded Web browser (for example, WebView on Android) ... By default, PhoneGap-based Android apps request from the user and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in
CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m
afterWKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
add[configuration setValue:@"TRUE" forKey:@"allowUniversalAccessFromFileURLs"];
can fix api failSame problem when the axios is used.