On Thu, Aug 27, 2009 at 4:12 PM, <--v1c1ous--><[email protected]> wrote:
> Or you can see:
> http://dev.chromium.org/developers/design-documents/extensions/tabs-api
The tabs API is the way to do this. The code to get the currently
selected tab's URL is:
chrome.tabs.getSelected(null, function(tab) {
alert(tab.url)
});
See:
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/tabs.html#method-getSelected
If you want to update a tab's URL, you can do it like this:
var tabId = // get tab id from something like getSelected(), getCurrent(), etc.
chrome.tabs.update(tabId, {url: "http://www.google.com/"});
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/tabs.html#method-update
- a
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---