这是我的清单
{
"manifest_version": 2,
"name": "test",
"description": "test",
"version": "1.0",
"permissions": [
"activeTab",
"tabs"
],
"browser_action": {
"default_popup": "index.html"
},
"background": {
"scripts": ["background.js"]
}
}
在我的index.html中,我有:
<html>
<head>
<script src="jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<div class="container">
</div>
</body>
</html>
在我的script.js中我有:
var Chat = function( username, avatar) {
username = username || "";
/// more lines
}
我是否有办法在backround.js中调用Chat(index.html) 例如:
chat = new Chat("john", "");
一个更通用的问题是:弹出窗口和背景如何一起说话?有消息吗?任何可用的样品?