chrome.tabs.getSelected(null, function(tab) {
    console.log(tab.url); // do what you want
});


Remember to set permission for tabs in manifest.json >

"permissions": [
        "tabs"
]

-
Pedro Junior

----- Original Message ----- 
From: "Globe199" <[email protected]>
To: "Chromium-extensions" <[email protected]>
Sent: Wednesday, December 09, 2009 3:41 PM
Subject: [chromium-extensions] Get current tab URL


> Just starting out with chrome extensions, and I'm having a hell of a
> time doing something which should be so simple.
> 
> I want to get the URL of the current tab.  I've tried a few things,
> but they either don't work or they give me the location of the
> extension file itself.
> 
> Any help is appreciated.  Thank you.
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Chromium-extensions" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/chromium-extensions?hl=en.
> 
> 
>

--

You received this message because you are subscribed to the Google Groups 
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/chromium-extensions?hl=en.


Reply via email to