aboutsummaryrefslogtreecommitdiffstats
path: root/chrome-get-urls-from-tabs-in-windows.js
diff options
context:
space:
mode:
authorTeddy Wing2014-03-30 19:19:12 -0400
committerTeddy Wing2014-03-30 19:19:12 -0400
commit08781bc28dfa2bd517a0806eab65e6fa2f30974a (patch)
treeece4791d70d468fa9d39757dc96e1942de3a31fd /chrome-get-urls-from-tabs-in-windows.js
parent3cdd7ca2de7f9f4eb0fa134310b524d6c96debca (diff)
downloadchrome-copy-urls-from-all-tabs-08781bc28dfa2bd517a0806eab65e6fa2f30974a.tar.bz2
Add functionality for downloading backup on icon click
If the download option is set, a backup file is now downloaded when the extension button is clicked.
Diffstat (limited to 'chrome-get-urls-from-tabs-in-windows.js')
-rw-r--r--chrome-get-urls-from-tabs-in-windows.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome-get-urls-from-tabs-in-windows.js b/chrome-get-urls-from-tabs-in-windows.js
index 0ed0d8f..fc27d1f 100644
--- a/chrome-get-urls-from-tabs-in-windows.js
+++ b/chrome-get-urls-from-tabs-in-windows.js
@@ -94,14 +94,14 @@ generate_backup_text(function(backup_text) {
// Adapted from:
// http://stackoverflow.com/a/18197511
-create_download_link = function(text) {
+create_download_link = function(text, callback) {
generate_filename(function(filename) {
var download_link = document.createElement('a');
download_link.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
download_link.setAttribute('download', filename);
download_link.innerHTML = 'Download file';
- document.getElementById('download-link').appendChild(download_link);
+ callback(download_link);
});
};