Fwd: GWT-based Chrome Packaged App

169 views
Skip to first unread message

Renato Mangini (Chromium)

unread,
Jun 4, 2013, 4:47:47 PM6/4/13
to Chromium Apps

(forwarded from an internal discussion, regarding support for GWT compiled code in Chrome packaged apps)

I've spent some time investigating it but won't have time to implement it before July. In case anyone wants to give it a try (and to save my investigation for later use), my suggestion is to:

- create a new Linker that extends DirectInstallLinker and replaces getJsInstallLocation method, linking to another script that doesn't set inline "javascript::" in iframe.src and doesn't use document.open/close/write  (the current offending script is com/google/gwt/core/ext/linker/impl/installLocationIframe.js)
- create a permutation variable that is enabled for Chrome Packaged Apps builds;
- create a version of WindowImpl.java for the ChromeApps permutation that doesn't use onunload and onbeforeunload (maybe replace by chrome.app.window.onClose)

Creating the permutation variable allows for widget override in case other widgets are also not compatible.

It shouldn't be more than a handful of hours/work for seasoned Java devs. If someone is willing to try it, please let me know.

Renato Mangini | Chrome Developer Programs Engineer | man...@google.com | +55 11 2395-8608


On Tue, Jun 4, 2013 at 2:33 PM, Renato Mangini <man...@google.com> wrote:

Even the DirectInstallLinker generates CSP-incompatible code. 

The good news is: I have checked now, and it seems quite simple to adapt DirectInstallLinker to generate CSP compatible code that don't even need sandboxes to run. In a hello world sample, I only had to:
- remove onunload/onbeforeunload event handlers in the  *.cache.js files
- remove four lines in the *.nocache.js file

I imagine more complex code (xhr, complex widgets) could need more adaptation, but this is a good start.


Renato Mangini | Chrome Developer Programs Engineer | man...@google.com | +55 11 2395-8608


Howdy,

   I have a GWT-based application that I'd like to turn into a Chrome packaged app, and am running into this error message:

Sandbox access violation: Blocked a frame at "chrome-extension://lllehongbdglmolnbebballiodeojoao" from accessing a frame at "null".  Both frames are sandboxed and lack the "allow-same-origin" flag.

 This is using the DirectInstallLinker and my manifest (version 2) excerpt looks like this:

"sandbox": {
     "pages": [
      "chrome.html",
      "my.package.Web/9E517B944D4312A64AA2157A58B67C93.cache.js",
         "my.package.Web/my.package.Web.nocache.js"
     ]
  }

  Opening up chrome.html locally from the browser works fine, just not when it's launched as a Chrome package app. 



Reply all
Reply to author
Forward
0 new messages