aboutsummaryrefslogtreecommitdiffstats
path: root/simg.js
diff options
context:
space:
mode:
authormitsugu oyama2010-11-12 18:06:22 +0900
committermitsugu oyama2010-11-12 18:06:22 +0900
commit102b40477b2dd33e8d9b74992d06fbc5a60fe3a0 (patch)
tree48a6baf286f1697f61f5f607ce4e533f854260c6 /simg.js
parent3acf9c35a8bd63d821107801e1125dc097a89d6b (diff)
downloadvimperator-plugins-102b40477b2dd33e8d9b74992d06fbc5a60fe3a0.tar.bz2
cut off obstructive http's parameter
For example, http://hoge.com/path/to/hogehoge.jpg?id=hogehogehogehoge&page=2 Should drop '?id=hogehogehogehoge&page=2'
Diffstat (limited to 'simg.js')
-rw-r--r--simg.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/simg.js b/simg.js
index 90842fc..0cb78ee 100644
--- a/simg.js
+++ b/simg.js
@@ -1,6 +1,6 @@
// INFO //
-var INFO =
-<plugin name="simg.js" version="0.1"
+var INFO =
+<plugin name="simg.js" version="0.2"
summary="Save image on contents area"
href="http://github.com/vimpr/vimperator-plugins/blob/master/simg.js"
xmlns="http://vimperator.org/namespaces/liberator">
@@ -51,6 +51,9 @@ commands.addUserCommand(
let trueCurrntImg=function(){
let fileName=imgURL.substr(imgURL.lastIndexOf('/'));
+ if (-1!=fileName.indexOf('?')){
+ fileName=fileName.substr(0,fileName.indexOf('?'));
+ }
savePath=savePath+fileName;
let instream=xhrImg.responseText;
let aFile=Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);