diff options
| author | Teddy Wing | 2014-03-24 18:32:11 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2014-03-24 18:32:11 -0400 | 
| commit | b5f69d0b3426e86507a88e6f3bda5e758a8fd497 (patch) | |
| tree | 3f6027e712cbfd689432532688fb4c6d325471a7 /chrome-get-urls-from-tabs-in-windows.js | |
| download | chrome-copy-urls-from-all-tabs-b5f69d0b3426e86507a88e6f3bda5e758a8fd497.tar.bz2 | |
Initial commit: initial working version
From 2014.03.17. Clicking on the extension's icon button opens a new
tab containing a textarea with all URLs in open tabs collected by
window.
Diffstat (limited to 'chrome-get-urls-from-tabs-in-windows.js')
| -rw-r--r-- | chrome-get-urls-from-tabs-in-windows.js | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/chrome-get-urls-from-tabs-in-windows.js b/chrome-get-urls-from-tabs-in-windows.js new file mode 100644 index 0000000..4fdcefb --- /dev/null +++ b/chrome-get-urls-from-tabs-in-windows.js @@ -0,0 +1,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++; +	}); +});
\ No newline at end of file | 
