how to get current tabId from background page? current tabId is the tab that user can see its content.
background.html
Many API methods interpret null as a current tab. chrome.tabs.sendRequest is one of them.
null
chrome.tabs.sendRequest
Otherwise:
chrome.tabs.getSelected(null, function(tab) { ... })