as title I can't able find this method into the Api -> Tabs... Way and where? Thanks'
Asked
Active
Viewed 6,340 times
3
-
https://developer.chrome.com/extensions/tabs#method-getSelected – Pacerier Aug 04 '16 at 18:22
3 Answers
11
It was deprecated in Chrome 16. The correct way is to use chrome.tabs.query
with active:true
and lastFocusedWindow:true
.
// Get the current active tab in the lastly focused window
chrome.tabs.query({
active: true,
lastFocusedWindow: true
}, function(tabs) {
// and use that tab to fill in out title and url
var tab = tabs[0];
run({
url: tab.url,
description: tab.title
});
});
-
How can I access to DOM for the current/last selected tab? i would like to access it with jquery, TIA. – Dean Van Greunen May 26 '21 at 09:08
1
https://developer.chrome.com/extensions/tabs#method-getSelected
It's a deprecated method, but you can still use it.
chrome.tabs.getSelected(null, function(tab) {
var url = tab.url;
});

Dennis
- 56,821
- 26
- 143
- 139