Google chrome extension Chrome extension create.window:如何使用高度参数?

Google chrome extension Chrome extension create.window:如何使用高度参数?,google-chrome-extension,window,height,Google Chrome Extension,Window,Height,我正在尝试使用chrome.create.window获得一个弹出窗口,但出现了一些问题 下面是我的background.js代码: chrome.extension.onRequest.addListener(function(request) { if (request.type === 'open_window') { chrome.tabs.create({ url: chrome.extension.getURL('win.html'),

我正在尝试使用chrome.create.window获得一个弹出窗口,但出现了一些问题

下面是我的background.js代码:

chrome.extension.onRequest.addListener(function(request) {
if (request.type === 'open_window') {
        chrome.tabs.create({
            url: chrome.extension.getURL('win.html'),
            active: false
        }, function(tab) {
            chrome.windows.create({
                tabId: tab.id,
                type: 'popup',
                height: '200',

                focused: true
            });
        });
}
});

在我添加高度:“200”之前,我得到了我想要的:一个窗口跳出了浏览器。添加此行时,窗口将作为打开窗口的另一个选项卡打开。为什么会这样?

用数字代替字符串:
200
→ <代码>“200”。如果您:

未捕获错误:参数1的值无效。属性“高度”:应为“整数”,但得到“字符串”

我建议将
url
选项与一起使用,因为它的效率稍高一些:

chrome.windows.create({
    url: chrome.extension.getURL('win.html'),
    type: 'popup',
    height: 200,
    focused: true
});

非常感谢。我已经打开控制台,没有看到任何错误。我一定错过了什么。我会查清楚的+小费1英镑。