Reputation: 745
I'm writing a simple extension which pops up a window (for a radio player). I want to try and avoid having the extension popping up more than one radio player, so I want to...
I'm getting stuck with step 4.
chrome.windows.onRemoved.addListener(function(window) {
alert (window.id);
});
...this returns "undefined" for the window.id - I'd rather it returned the windowId that has just been closed, so I can do something with it.
What is the obvious thing that I have missed?
ANSWER
chrome.windows.onRemoved.addListener(function(windowId) {
alert(windowId);
});
...as it happens.
Upvotes: 1
Views: 1439
Reputation: 111305
chrome.windows.onRemoved
returns windowId
, not window
:
chrome.windows.onRemoved.addListener(function(integer windowId) {...});
Upvotes: 1