Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  34] [ 4]  / answers: 1 / hits: 48898  / 13 Years ago, sat, july 16, 2011, 12:00:00

The code is meant to output the current tab object for the page the user is viewing to the console but it just outputs undefined. It's run from within a browser action page.



chrome.tabs.getCurrent( function(tab){
console.log(tab);
} );


I've looked at the documentation and as far as I can tell the code seems to match what it says.


More From » html

 Answers
19

Try:



chrome.tabs.getSelected(null, function(tab){
console.log(tab);
});

[#91151] Thursday, July 14, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
maureen

Total Points: 151
Total Questions: 110
Total Answers: 110

Location: Mali
Member since Fri, Dec 3, 2021
3 Years ago
;