diff options
author | mitsugu oyama | 2010-11-12 18:06:22 +0900 |
---|---|---|
committer | mitsugu oyama | 2010-11-12 18:06:22 +0900 |
commit | 102b40477b2dd33e8d9b74992d06fbc5a60fe3a0 (patch) | |
tree | 48a6baf286f1697f61f5f607ce4e533f854260c6 /simg.js | |
parent | 3acf9c35a8bd63d821107801e1125dc097a89d6b (diff) | |
download | vimperator-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.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |