var win = window.open('cover.html','','height=50,width=150,titlebar=no,toolbar=no');
win.onbeforeunload = function(){ updateIcon();};
VS
chrome.windows.create(
{
url: "cover.html",
type: "popup",
width: 150,
height: 50
},
function(win)
{ win.onbeforeunload = function(){ updateIcon();}; }
);
chrome api 版本中不调用函数 updateIcon()。我想知道为什么。这两段代码都在 ubuntu linux 上进行了测试。