From 102b40477b2dd33e8d9b74992d06fbc5a60fe3a0 Mon Sep 17 00:00:00 2001 From: mitsugu oyama Date: Fri, 12 Nov 2010 18:06:22 +0900 Subject: 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' --- simg.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'simg.js') 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 = - @@ -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); -- cgit v1.2.3