I was going through the Chrome extension "Getting started guide":
and one section mentions this code
chrome.tabs.executeScript(
tabs[0].id,
{code: 'document.body.style.backgroundColor = "' + color + '";'});
};
I am getting an undefined error on tabs[0].id
. Now the API documentation states that chrome.tabs.Tab
is accessible but I can't seem to get it. What am I doing wrong?