2

我正在使用 Dijit (Dojo Toolkit) 在沙盒页面中生成 HTML 布局,但每次调用 dijit 文件时,都会得到Uncaught unload is not available in packaged apps..

现在我不确定这是 Dojo 的问题,还是 Chrome 的新安全策略限制。

我的文件:

/** 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.runtime.onLaunched.addListener(function(){
  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 **/
define(function(){
  require(["dijit/layout/ContentPane",
    "dijit/layout/BorderContainer"]);
});

我没有留下live.html,因为它基本上只是HTML 结构、对dojo 加载程序的调用和对helloapp/app.js文件的要求。

如果这是 CSP 领域的限制,我是否可以通过其他方式在新的 Chrome 应用程序上使用 Dijit,或者我错过了什么?

谢谢你的时间

4

1 回答 1

0

您必须修改 Dojo Core、Dojo Base 和 Dijit 中的所有核心源代码以删除卸载事件或重新定义它。

close()并且unload()非常相似,你可以看到一个关于为什么它没有在这里实现的线程:

http://code.google.com/p/chromium/issues/detail?id=147674

http://code.google.com/p/chromium/issues/detail?id=130465

于 2012-12-02T09:56:56.560 回答