[英]Set minimum width of chrome app
我试图设置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}
}
);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.