Get window id from javascript with help of chrome extension
<p>Currently I send message from my html page to chrome extension and it, in turn calls</p>

<pre><code>chrome.windows.getCurrent(function (win) {
     callback(win.id)
});
</code></pre>

<p>to get window Id. But if user selects another (or opens new) window just before this call, I get incorrect id. How can I get id of window, where my js code is running?</p>