You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/04/22 13:31:29 UTC
[GitHub] [cordova-plugin-wkwebview-engine] breautek commented on issue #143: Blank screen after using plugin-wkwebview-engine
breautek commented on issue #143:
URL: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/143#issuecomment-617780800
With `WKWebView`, you have to obey [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).
Normally, you have to modify your webserver to add the appropriate CORS headers, but since you're using XHR requests on local files, there is obviously no webserver at play here, so adding those appropriate headers becomes difficult.
The solution is to either use [cordova-plugin-file]() to load those files using the filesystem APIs instead
**OR**
Use the third-party [cordova-plugin-wkwebview-file-xhr](https://github.com/oracle/cordova-plugin-wkwebview-file-xhr) plugin which intercepts the XHR requests and excluding the `origin` header.
For your case, since it looks like angular is the one making those requests, you're probably best off on using the wkwebview-file-xhr plugin. Be sure to read their known issues to determine if you'll be affected by it.
Let me know if this helps.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org