aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2014-03-30 15:22:43 -0400
committerTeddy Wing2014-03-30 15:23:57 -0400
commit9195a855b9f4a02440b70fe83addd37ff60b41ad (patch)
tree31ff9e1676d15e870873f8c6dcb6c3425de93a0a
parentdae3bcc4249c0c98f19df2a3cab671773942f887 (diff)
downloadchrome-copy-urls-from-all-tabs-9195a855b9f4a02440b70fe83addd37ff60b41ad.tar.bz2
Page: update 'text' format output
* Remove <a> tags * Show page title and URL for each entry
-rw-r--r--chrome-get-urls-from-tabs-in-windows.js41
1 files changed, 27 insertions, 14 deletions
diff --git a/chrome-get-urls-from-tabs-in-windows.js b/chrome-get-urls-from-tabs-in-windows.js
index a689b0c..0717a01 100644
--- a/chrome-get-urls-from-tabs-in-windows.js
+++ b/chrome-get-urls-from-tabs-in-windows.js
@@ -2,26 +2,39 @@ var textarea = document.getElementById('copy-area');
var create_download_link;
var generate_filename;
-chrome.windows.getAll({populate:true},function(windows){
+
+chrome.windows.getAll({populate:true}, function(windows){
var w_index = 0;
- windows.forEach(function(window){
- textarea.value += "Window " + w_index + ":";
+ chrome.storage.sync.get(function(items) {
+ var format = items.file_format;
+ console.log(format);
+
+ if (format === 'yaml') {
+
+ }
+ else if (format === 'html') {
+
+ }
+ else { // format === 'text'
+ windows.forEach(function(window){
+ textarea.value += "Window " + w_index + ":";
+
+ window.tabs.forEach(function(tab){
+ textarea.value += "\n";
+ textarea.value += "\t* " + tab.title + "\n";
+ textarea.value += "\t " + tab.url + "\n";
+ });
- 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";
- textarea.value += "\n\n";
+ w_index++;
+ });
+ }
- w_index++;
+
+ create_download_link(textarea.value);
});
-
- create_download_link(textarea.value);
});