我正在使用 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,或者我错过了什么?
谢谢你的时间