Skip to content Skip to sidebar Skip to footer

Closure Dev Mode & Chrome Packaged App -- "document.write() Is Not Available In The Sandbox Of Packaged Apps"

I'm running into issues in development mode with Closure as the security policies for my Chrome Packaged App (i.e., v2 manifest file) are restricting things called in the Closure b

Solution 1:

The following code is what I eventually used and it works great for running Closure in Dev mode within Chrome's Packaged App framework.

In closure/goog/base.js, overwrite goog.global.CLOSURE_IMPORT_SCRIPT as follows:

goog.global.CLOSURE_IMPORT_SCRIPT = function(src) {
  var script = document.createElement('script');
  script.src = src;
  script.type = 'text/javascript';
  goog.global.document.getElementsByTagName("head")[0].appendChild(script);
  returntrue;
};

Post a Comment for "Closure Dev Mode & Chrome Packaged App -- "document.write() Is Not Available In The Sandbox Of Packaged Apps""