Take the 2-minute tour ×

I'm using Dijit (Dojo Toolkit) to generate a HTML layout in a sandboxed page, but everytime I make a call for the dijit files, I get Uncaught unload is not available in packaged apps..

Now I'm not sure this is a problem with Dojo or just a limitation of Chrome with the new security policies.

My files:

/** manifest.json **/
  "name": "Hello App",
  "version": "2.0",
  "manifest_version": 2,
  "description": "A app that says hello",
  "app": {
    "background": {
      "scripts" : ["js/app.js"]
  "permissions": [

  "sandbox": {
    "pages" : ["live.html"]

/** js/app.js **/
  chrome.app.window.create('live.html', {width:screen.width,
    height: screen.height});

/** js/helloapp/app.js **/
/** This is the file that actually calls Dijit to build the layout **/

I've left live.html out because it's basically just the HTML structure, a call to the dojo loader and a require for the helloapp/app.js file.

If this is a limitation in the CSP world, is there another way I can use Dijit on the new Chrome Apps or am I missing something?

Thanks for your time

share|improve this question
Just throwing out a couple guesses since I haven't written a Chrome extension before. If you're loading dojo/dijits from a local source then you may need to specify them as a script your app is allowed to load. If you're loading dojo from a CDN you may need to specify the CND host in the permissions section. –  Nick Roth Nov 23 '12 at 3:36
I don't think so because according to the google developer doc: Note that you only need to list pages that you expected to be loaded in windows or frames. Resources used by sandboxed pages (e.g. stylesheets or JavaScript source files) do not need to appear in the sandboxed_page list, they will use the sandbox of the page that embeds them. And the error doesn't seem to be related with a lack of permissions in that regard. Thanks anyway –  skkeeper Nov 23 '12 at 12:33

1 Answer 1

You would have to mod the all the core source code in Dojo Core, Dojo Base and Dijit to remove the unload event or redefine it.

close() and unload() are very similar and you can see a thread on why it isn't implemented here:



share|improve this answer

Your Answer


