Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the urls of all the tabs in all windows using chrome extension

Tags:

Is this possible for chrome extension to get all the URLs in all tabs using chrome extension ?

I have got the url of current Tab using this code

chrome.tabs.getSelected(null, function(tab) {     tabUrl = tab.url;     alert(tabUrl); }); 

We need the following permissions in manifest.json file

"permissions": [     "tabs" ] 

My question is to find out the URLs in all tabs ?

like image 861
Sachin Avatar asked Apr 24 '13 06:04

Sachin


People also ask

How do I copy the URL of all open tabs in Chrome?

Press Ctrl + a on Windows/Linux or ⌘ + a on Mac to select all bookmarks. Press Ctrl + c on Windows/Linux or ⌘ + c on Mac to copy all urls (and only urls).

How can I get the current tab URL for Chrome extension?

You can access the currently active tab and its properties via the query() method, for example: chrome. tabs. query({ currentWindow: true, active: true });

How do I see a list of open tabs in Chrome?

This looks like a down arrow, and it's located in the top right corner of the window. The Search Tabs popup window will now appear. An alternative way to get here is by using the keyboard shortcut: Shift + Command + A on Mac, or Control + Shift + A on PC.


Video Answer


1 Answers

You could do something like this:

chrome.windows.getAll({populate:true},function(windows){   windows.forEach(function(window){     window.tabs.forEach(function(tab){       //collect all of the urls here, I will just log them instead       console.log(tab.url);     });   }); }); 
like image 79
BeardFist Avatar answered Nov 08 '22 14:11

BeardFist