Muly,

Thanks for reporting this issue. I've filed a bug as 
https://crosswalk-project.org/jira/browse/XWALK-1859.

And I've sent a PR to fix this on Crosswalk WebView as 
https://github.com/crosswalk-project/crosswalk-cordova-android/pull/111. Once 
it pass the review, I will cherry-picked it to Crosswalk-6.

Please track the XWALK-1859 for the status.

Thanks again for trying Crosswalk,
-ningxin

From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of Hu, 
Ningxin
Sent: Thursday, June 05, 2014 9:52 AM
To: Muly Oved; Zhu, Yongsheng
Cc: [email protected]
Subject: Re: [Crosswalk-help] Access-Control-Allow-Origin error on Android 
4.0.3 (OK on 4.4.2)

Muly,

I suppose the code you pointed out is for Android WebView (come from 
Cordova-Android) other than XWalkView.

I recommend you follow Yongsheng's suggestion to explicitly turn on the 
"setAllowUniversalAccessFromFileURLs(boolean)” in XWalkSettings.

Thanks,
-ningxin

From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of Muly 
Oved
Sent: Thursday, June 05, 2014 1:43 AM
To: Zhu, Yongsheng
Cc: 
[email protected]<mailto:[email protected]>
Subject: Re: [Crosswalk-help] Access-Control-Allow-Origin error on Android 
4.0.3 (OK on 4.4.2)

I found this line line in CordovaWebView:271

if (android.os.Build.VERSION.SDK_INT > 
android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)

As the problem is with API15 (ICE_CREAM_SANDWICH_MR1) and not later API I 
modified it to be
if (android.os.Build.VERSION.SDK_INT >= 
android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)

And it seem to work fine for API15 (4.0.3) emulator, didn't tested on real 
device yet

Any idea why the line was limited for API15
Muly

On Wed, Jun 4, 2014 at 4:38 AM, Zhu, Yongsheng 
<[email protected]<mailto:[email protected]>> wrote:
Muly,
I guess you may get XWalkSettings from XWalkView instance. There is one method 
called “setAllowUniversalAccessFromFileURLs(boolean)” in XWalkSettings. You 
could pass  ‘true’ value to enable cross origin XHR for your case.
Please let me know if you have further problems.

Thanks for trying Crosswalk.

Yongsheng

From: Crosswalk-help 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Muly Oved
Sent: Tuesday, June 03, 2014 3:33 PM
To: 
[email protected]<mailto:[email protected]>
Subject: [Crosswalk-help] Access-Control-Allow-Origin error on Android 4.0.3 
(OK on 4.4.2)

Have a Crosswalk/Cordova application doing login using Google OAuth API

When running on Android emulator version 4.0.3 API Level 15 I get 
Access-Control-Allow-Origin error

When running the same project on Android emulator version 4.4.2 API Level 19 it 
work fine

The project itself use Google API 4.4.2 API 19
Crosswalk version: crosswalk-cordova-6.35.131.7-x86

Error message:
06-03 06:22:59.891: I/chromium(1397): [INFO:CONSOLE(0)] "XMLHttpRequest cannot 
load https://accounts.google.com/o/oauth2/token. No 
'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'file://' is therefore not allowed access.", source: 
file:///android_asset/www/index.html#/login<file:///\\android_asset\www\index.html#/login>
 (0)

Muly

_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to