Hi,
This is working exactly as designed.  The thing you're missing is that all
of the extension APIs are asynchronous.  So the callback function gets
called at a later point in time than when you called getCurrent.

Erik


On Mon, Jun 8, 2009 at 12:08 AM, disya2 <[email protected]> wrote:

>
> Hi,
>
> In extension script I have
>
> function onclick() {
>  var win_id = -1;
>  chrome.windows.getCurrent( function(win) {
>    win_id = win.id;
>    console.log("1 win_id="+win_id);
>   });
>  console.log("2 win_id="+win_id);
> }
>
> the output is
> 2 win_id=-1
> 1 win_id=1
>
> I guess it is a bug.
> I'm using Chrome 3.0.182.3 for Windows running on Ubuntu/Wine
>
>
> Denis
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Discussion mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to