Working with webOS Enyo Web services in Google Chrome

The options described below are very useful for development, but equally dangerous. Enabling these options is a huge security risk and should not be used for normal browsing.

If you need these options enabled but still want to browse, please consider using Chromium as a development browser with these options.

I’ve been writing code for in HP’s new Enyo framework for webOS, and a constant issue has been that WebServices can only be run in the emulator.  Webservices are Enyo’s abstraction of XMLHttpRequest, basically.  One of Enyo’s biggest strengths is that it can be tested in any Webkit based browser, but when you get to the internet access portion of testing (usually the biggest part!) you have to move to the emulator.

Fortunately, there is a fix!  As noted above, do not leave this on by default as it is a huge security risk.  This disables the file access and same origin protections, allowing you to perform webservices calls in Chrome.

To do this, run Chrome with the following command line options:

--allow-file-access-from-files --disable-web-security

In windows, you can add these to a shortcut (after the quotes, if present) just be sure to make the double hyphens a single hyphen.  On OSX you can copy and paste the command line options above.  For OSX you’d want to use a script unless you want to run it from the command line each time.  If you’ll be spending a lot of time within Enyo, you may want to download Chromium and use that for development work.  Again, browsing with these options enabled is a significant security risk.

Thanks for reading!

  1. It’s not uncommon to run a webserver on your development system. Apache is actually really easy to install on most systems (if it’s not already there) and there are lots of other alternatives. Using a webserver to serve Enyo files gets you around the file-access problem right away. The web security issue needs a bit more work, but really it’s easy to make a little proxy using PHP, or any number of other methods. Btw, to deploy your application on the WWW, the service calls would have to go through a server anyway. The web app talks to it’s own server, and the server can go fetch things from other domains.

    HTH

  2. Hi Jon
    I work on OSX 10.6 i try to use Enyo in chrome. i launch in my terminal : /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome –allow-file-access-from-files –disable-web-security but i have a bad message :

    [0720/025140:INFO:breakpad_mac.mm(89)] Breakpad disabled
    [46659:263:1310970081269390:FATAL:sandbox_mac.mm(551)] Failed to initialize sandbox: -1 dlopen(libsandbox.1.dylib, 261): image not found

    Do you have a clue, thank in advance

Reply to pparole ¬
Cancel reply


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>