我想在 Chrome 中创建新选项卡时触发一个事件。我以为下面的内容可以做到这一点,但似乎不行。(初学者)
清单.json
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"background_page": "background.html",
"permissions": [
"tabs"
]
}
背景.html
<html>
<head>
<script type="text/javascript">
chrome.tabs.onCreated.addListener(function() {alert('hello new tab'});
</script>
</head>
<body>
</body>
</html>
你是不是错过了一个结束语)
括号?
...{alert('hello new tab'});
^
因为除此之外你的代码对我有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)