aboutsummaryrefslogtreecommitdiffstats
path: root/chrome-get-urls-from-tabs-in-windows.js
diff options
context:
space:
mode:
Diffstat (limited to 'chrome-get-urls-from-tabs-in-windows.js')
-rw-r--r--chrome-get-urls-from-tabs-in-windows.js21
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