我试图设置chrome应用程序的最小宽度,然后查看了一些chrome文档,然后将其实现到chrome应用程序中,如下所示:
chrome.app.runtime.onLaunched.addListener(function(launchData) {
chrome.app.window.create(
'index.html',
{
id: 'mainWindow',
bounds: {
width: 800,
height: 600,
minWidth: 600
}
}
);
});
但是我得到了错误:
错误app.runtime.onLaunched事件处理程序中的错误:错误:参数2的值无效。属性'bounds.minWidth':意外的属性。
据我所知,这意味着该属性不存在,但事实并非如此,就像在文档中一样。也许我执行错了吗?任何帮助,将不胜感激!
我发现这是innerBounds
我需要使用的!现在是我的代码:
chrome.app.runtime.onLaunched.addListener(function(launchData) {
chrome.app.window.create(
'index.html',
{
id: 'mainWindow',
bounds: {width: 800, height: 600},
innerBounds: { minWidth: 800}
}
);
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句