1

I'm using the crosswalk webview on a project. I need some javascript to access elements which are on an iframe from a different origin but the same origin policy throws an error. Is there a way on crosswalk to turn this security check off?

Thanks.

casolorz
  • 8,486
  • 19
  • 93
  • 200

1 Answers1

4

Crosswalk supports all command line option that Chromium has, so, to disable samle origin policy, you can use --disable-web-security switch.

If you are using make_apk tool to package your application, you can use the following option: python make_apk.py --xwalk-command-line='--disable-web-security' ...

https://github.com/crosswalk-project/crosswalk-website/wiki/use-chromium-command-lines-in-your-apps-on-android

Or if you are embedding Crosswalk WebView directly, you can just write a plain text file named xwalk-command-line into the assets of your project, the content of the text file should be walk --disable-web-security.

Shouqun
  • 746
  • 4
  • 3
  • Thank you, that is pretty cool. If I disable all web security though that might be a bit much, is it possible to just give some domain extra rights or something? – casolorz Jul 18 '14 at 13:22