我环顾四周,似乎这是一个已知的错误....
http://code.google.com/p/chromium/issues/detail?id=108875&q=popup%20bar&colspec=ID%20Pri%20Mstone%20ReleaseBlock %20OS%20Area%20Feature%20Status%20Owner%20Summary
您应该为以后的更新加注星标,我认为您也应该对您的情况发表评论。
从扩展代码中获得所需弹出窗口的唯一方法是打开一个选项卡,让它打开弹出窗口,然后关闭选项卡......远非理想。
但是如果这对你来说已经足够好了,这里有一些示例代码......
清单.json
{
"name": "Popup with adresse bar",
"version": "1.0",
"permissions": [
"tabs", "<all_urls>"
],
"browser_action": {
"default_title": "Popup with adresse bar.",
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"manifest_version" : 2
}
popup.html
<!doctype html>
<html>
<head>
<script src="popup.js"></script>
</head>
<body>
<a id='clicky' href='#'>clicky</a>
</body>
</html>
popup.js
clicky = function() {
chrome.tabs.create({
url: 'open.html#' + 'http://www.google.com',
active: false
});
}
onload = function() {
document.querySelector('#clicky').onclick = clicky;
}
window.onload = onload;
打开.html
<script src='open.js'></script>
打开.js
window.close();
window.open(window.location.hash.substr(1), '…', '…');