I am trying to write an extension for Google Chrome. My extension will need info about opened tabs, actually, I want to know, for instance, in tab[1], http://www.google.com is open.
How I will achieve this, thanks :)
I am trying to write an extension for Google Chrome. My extension will need info about opened tabs, actually, I want to know, for instance, in tab[1], http://www.google.com is open.
How I will achieve this, thanks :)
You'll have to add "tabs"
to your permissions
in your manifest.json
file. Then, you can simply use the chrome.tabs.query
function and specify no properties to get all the tabs.
Some sample code would look like this:
chrome.tabs.query(null, function (tab){
console.log(tab[0].url);
});