aboutsummaryrefslogtreecommitdiffstats
path: root/chrome-get-urls-from-tabs-in-windows.js
blob: 4fdcefbcea6fcf35ebd22447b246aee5feeb2f55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var textarea = document.getElementById('copy-area');

chrome.windows.getAll({populate:true},function(windows){
	var w_index = 0;
	
	windows.forEach(function(window){
		textarea.value += "Window " + w_index + ":";
		
		window.tabs.forEach(function(tab){
			//collect all of the urls here, I will just log them instead
			//console.log(tab.url);
			textarea.value += "\n\t";
			textarea.value += '* ' + tab.url + "\n";
			textarea.value += "\t\t" + '<a href="' + tab.url + '">' + tab.title + '</a>';
		});
		
		textarea.value += "\n\n";
		
		w_index++;
	});
});