Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Extension: In Tabs doc don't exist this "chrome.tabs.getSelected" but I see aniway in examples

as title I can't able find this method into the Api -> Tabs... Way and where? Thanks'

like image 803
Donovant Avatar asked Oct 19 '25 09:10

Donovant


2 Answers

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
    });
});
like image 97
Rick Avatar answered Oct 22 '25 05:10

Rick


It was removed. Use chrome.tabs.query instead.

like image 21
abraham Avatar answered Oct 22 '25 03:10

abraham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!