I'm new to developing chrome extensions, and wanted to start with some simple code. I've tried to change the badge text when the user clicks the icon. However, this doesn't seem to work. Can anyone suggest what am I doing wrong here?
manifest.json
{
"name": "Hello World",
"description": "Just displays hello world",
"version": "1.2",
"manifest_version": 2,
"background":
{
"scripts": ["background.js"],
"persistent": false
},
"browser_action":
{
"name": "Click to display",
"default_popup": "popup.html"
}
}
background.js
function updatebadge()
{
chrome.browserAction.setBadgeText({text: "Hello!"});
};
chrome.browserAction.onClicked.addListener(updatebadge);
popup.html
<body>
Hello, World!
</body>