aboutsummaryrefslogtreecommitdiffstats
path: root/zip-de-download.js
diff options
context:
space:
mode:
Diffstat (limited to 'zip-de-download.js')
-rw-r--r--zip-de-download.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/zip-de-download.js b/zip-de-download.js
index a4a1cb3..8e642d3 100644
--- a/zip-de-download.js
+++ b/zip-de-download.js
@@ -1,5 +1,5 @@
let INFO =
-<plugin name="zip-de-download" version="0.5"
+<plugin name="zip-de-download" version="0.5.1"
href=""
summary="ZIPでダウンロードするお"
xmlns="http://vimperator.org/namespaces/liberator">
@@ -151,6 +151,10 @@ __proto__ = (function(){
liberator.modules.services.get("directory").get("Home", Ci.nsIFile).path;
return getFile(path);
}
+ function fixFilename(filename){
+ const badChars = /[\\\/:;\*\?\"\<\>\|\#]/g;
+ return liberator.has('windows') ? filename.replace(badChars, '_') : filename;
+ }
let self = {
downloadZip: function(path, urls, comment, isAppend){
let zipW = new zipWriter();
@@ -221,7 +225,7 @@ __proto__ = (function(){
liberator.assert(info.xpath, "not registered in SITE_IFO");
let urls = this.getURLs(info);
- let title = liberator.modules.buffer.title;
+ let title = fixFilename(liberator.modules.buffer.title);
let comment = [title, liberator.modules.buffer.URL].join("\n");
let file;
if (!zipPath){