Unable to communicate with the server when using the Crosswalk plug-in

Asked 2 years ago, Updated 2 years ago, 80 views

Thank you for your help.

In monaca, with the Crosswalk plug-in in,
When I communicated with the server, the following error occurred.

(preferably) without any configuration on the server side. Is there a way to communicate normally?

=== [Error Contents] ===
XMLHttpRequest cannot load http://xxxx.xxx.jp/xxxx.php/xxxxx.No'Access-Control-Allow-Origin' header is present on the requested resource.Origin' file://'is there before not allowed access.

monaca cordova

2022-09-30 15:34

1 Answers

Unfortunately, due to the Crosswalk plug-in specifications, the server side is

Access-Control-Allow-Origin: file://

or

Access-Control-Allow-Origin:*

If you do not have the configuration, you will get this error.
This error does not appear in the built application because index.html is in the code area of the application.
However, the Monaca debugger has index.html in the rewritable file area, so
This error is unavoidable.

To resolve this issue, the Crosswalk plug-in side needs to be modified.Refurbished as a trial

what you did https://github.com/knight9999/cordova-plugin-crosswalk-webview
I prepared it at .Remove the standard Crosswalk plug-in and insert this plug-in. If you create a custom built debugger, there will be no errors on the custom built debugger.
You will now be able to communicate with the server.

In addition, this renovation will be incorporated into the next Monaca debugger (6.0.x series) in some way.


2022-09-30 15:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.