I am trying to create a simple extension in chrome that appends the tab index number to the tab title. This is my first attempt at creating an extension so I don't have much experience. I would appreciate it if someone could point out what I am doing wrong.
{
//My manifest.json
"name": "Tab Selector",
"version": "1.0",
"description": "Overlays tab index on tab title",
"permissions": ["tabs", "http://*/*"
]
}
<script>
//My background.html
chrome.tabs.onUpdated.addListener(function(tabid, changeInfo, tab)
{
var name = tab.title + " " + tab.index;
chrome.tabs.executeScript(tabid, {code: 'document.title = "'+ name'";'}, null);
});
</script>