Get Chrome Tabs Information
Helpful tutorials about how to create Chrome Extensions
1 post
Page 1 of 1
Hello Coders,
The following code will allow you to grab all the tabs open in Chrome and use their information.
Following Danny simple extension getting started tutorial here: http://www.codenstuff.com/forum/viewtop ... 272&t=8264
I have attached a simple example extension for you to download and play with.
Happy coding
The following code will allow you to grab all the tabs open in Chrome and use their information.
Following Danny simple extension getting started tutorial here: http://www.codenstuff.com/forum/viewtop ... 272&t=8264
Code: Select all
You would place the above code in your popup.js file. //GET LIST OF TABS URLS
chrome.tabs.query({}, function (tabs) {
tabs.forEach(function (tab) {
/*Do what you need to here in order to use the tab information
EAXMPLE:
tab.favIconUrl = Get the tabs favicon
tab.url = Get the tabs current URL
new URL(tab.url).hostname = Get the tabs hostname/domain
*/
});
});
I have attached a simple example extension for you to download and play with.
Happy coding

You do not have the required permissions to view the files attached to this post.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023