I would like to compute the identity of tabs in the chrome browser in a way that survives a browser restart. I am trying to implement the solution proposed in this question.
In my bg.htmtl, I wrote the following event handler:
chrome.windows.onCreated.addListener(
function(win) {
console.log("window.onCreated", win);
for(tab in win.tabs) {
console.log("window.created.tab", tab);
}
});
I then create a new window by pressing ctl-n
with the focus on Chrome, but I don't get the event to fire. I then create a second tab via ctrl-t
and the event still doesn't fire. I then close the window, create a new window again, and then reload the previously closed ' 2 tabs' item in the recently-closed list. The event then fires. Unforunately, it is missing the tabs property, which is described as optional in the documentation. I have "tabs" permission specified in my manifest.
What should I try next?