1
我想使用chrome.create.window來獲得一個彈出窗口,並出現一些問題。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
});
});
}
});
之前我已經添加height: '200',
我得到了我想要的:一個窗口跳出瀏覽器。當我添加這一行時,該窗口作爲打開窗口的另一個選項卡打開。爲什麼 ?
謝謝。我打開了控制檯,沒有看到任何錯誤。我一定錯過了什麼。我會檢查它。提示+1。 – Subway