aboutsummaryrefslogtreecommitdiffstats
path: root/chrome-get-urls-from-tabs-in-windows.js
diff options
context:
space:
mode:
authorTeddy Wing2015-02-15 12:37:34 -0500
committerTeddy Wing2015-02-15 12:37:34 -0500
commit145be6788c4723123a5297a0dd783cadff810a34 (patch)
tree3bbf7576c848a322383e6abb20dfaf337faf59ec /chrome-get-urls-from-tabs-in-windows.js
parentad5127d12d3d5449075a0c3934eb524c4beb55db (diff)
downloadchrome-copy-urls-from-all-tabs-145be6788c4723123a5297a0dd783cadff810a34.tar.bz2
Add option to change downloaded filename prefix
The downloaded file would always have this format: chrome-tabs-20150215-12h38.yml Add a user-customisable option to change the "chrome-tabs-" prefix of the filename. I realised I wanted this after installing the extension on both Chrome and Chrome Canary, and wanted to have my backup files named differently depending on the version of Chrome they were coming from.
Diffstat (limited to 'chrome-get-urls-from-tabs-in-windows.js')
-rw-r--r--chrome-get-urls-from-tabs-in-windows.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome-get-urls-from-tabs-in-windows.js b/chrome-get-urls-from-tabs-in-windows.js
index e38c6ce..b2c3554 100644
--- a/chrome-get-urls-from-tabs-in-windows.js
+++ b/chrome-get-urls-from-tabs-in-windows.js
@@ -110,7 +110,7 @@ create_download_link = function(text, callback) {
};
-generate_file_string = function() {
+generate_file_string = function(filename_prefix) {
var d = new Date();
var date_string =
d.getFullYear()
@@ -123,7 +123,7 @@ generate_file_string = function() {
+ 'h'
+ ('0' + d.getMinutes()).slice(-2);
- return 'chrome-tabs-' + date_string;
+ return (filename_prefix ? filename_prefix : 'chrome-tabs-') + date_string;
};
@@ -142,6 +142,6 @@ generate_filename = function(callback) {
file_extension = 'txt';
}
- callback(generate_file_string() + '.' + file_extension);
+ callback(generate_file_string(items.filename_prefix) + '.' + file_extension);
});
}; \ No newline at end of file