Closed SpiderNeo1 closed 6 years ago
This is because CORS policy applies. You must have correct CORS headers on server or try this plugin https://github.com/ionic-team/cordova-plugin-ionic-webview
Thank you for your message but I'm not on ionic. Where I have to put the good correct CORS headers ? In JS file ? In HTML file ? In the config.xml file for Cordova ?
You don't have to be on ionic to use this cordova plugin
I just tried https://github.com/ionic-team/cordova-plugin-ionic-webview instead of https://github.com/apache/cordova-plugin-wkwebview-engine and it's still the same problem :-(
In fact, it works with internal file but not with WebServices.
For requests to external services correct CORS headers must be set on server side https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#The_HTTP_response_headers
I'm sorry Vladimir but I have already put this on my server (Apache/PHP) and it doesn't work better :
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-Type: application/json");
header("Access-Control-Allow-Origin: *");
Try also to add allowed methods https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods
If won’t work then check the errors in browser console
I can't do it at all, I tried everything...
On the Chrome browser, I have to launch the application by launching the browser in this way: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user- data-dir = "c:/chrome"
I think I'll go back to the UIWebView. Hoping that when I re-develop my application on the F7 v2.0, everything will work fine on WKWebView.
Do you expect to release a 1.6.6 version?
Maybe you should also use https://github.com/apache/cordova-plugin-whitelist No ?
On my Browser Chrome, I have this error :
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1' is therefore not allowed access.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
This is a (multiple allowed):
[x] bug
[ ] feature-discussion (RFC)
[ ] enhancement
Framework7 Version: 1.6.5
Platform and Target: Cordova iOS >=9.0.0
What you did
I Added WKWebViewEngine to my Cordova App https://github.com/apache/cordova-plugin-wkwebview-engine
Expected Behavior
With UIWebView, simple navigation is working And the call to the functions $$.getJSON and $$.get also works.
Actual Behavior
With WKWebView, simple navigation is working BUT the call to the functions $$.getJSON and $$.get no't working. I imagine that post and ajax functions don't work with WKWebView.