I assume this is for your background page. You probably don't care about the actual tab, but rather want to associate the header information with this tabId. To do this, follow these steps: 1) create a tab container: "tabs = {}" 2) save the data in this container: "tabs [details.id] .details.push (details);"
It will look something like this:
tabs = {}; init=function(){ ... chrome.webRequest.onBeforeRedirect.addListener(beforeRedirect, requestFilter, extraInfo); ... } beforeRedirect = function(details){ ... tabs[details.id].details.push(details); ... }
You also have the ability chrome.tabs.query to connect to the actual tab. If all you need is to save the header information, you probably won't want to use this:
chrome.tabs.query({active:true, windowId: chrome.windows.WINDOW_ID_CURRENT}, function(tab){ var currentTab = tab[0]; ...
source share