aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/archiveror.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/archiveror.js b/src/archiveror.js
index a8238f6..8055f22 100644
--- a/src/archiveror.js
+++ b/src/archiveror.js
@@ -227,10 +227,14 @@ function saveLocal(tab, automatic, path) {
}
function sanitizeFilename(title) {
- // Chrome disallows <>:"/\|?*~ in filenames
+ // Chromium disallows <>:"/\|?*~ in filenames (raises an error in chrome.downloads.download)
let name = title;
let re = /[<>:"/\\|?*~]/g;
name = title.replace(re, "_").trim();
+ // Chromium disallows filenames starting with a .
+ while (name.startsWith(".")) {
+ name = name.slice(1);
+ }
return name;
}