From 9ba6e3f7db047b3b777c35d37dfa9e74c935ed5c Mon Sep 17 00:00:00 2001 From: im-mi Date: Tue, 16 Aug 2016 11:27:22 -0400 Subject: [PATCH] Remove trailing variables from image address --- ext/upload/bookmarklet.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/upload/bookmarklet.js b/ext/upload/bookmarklet.js index aff5e6d9..c2516438 100644 --- a/ext/upload/bookmarklet.js +++ b/ext/upload/bookmarklet.js @@ -92,6 +92,7 @@ else if(document.getElementById('tag-sidebar') !== null) { } fileinfo = fileinfo || document.getElementsByTagName('embed')[0]; //If fileinfo is null then image is most likely flash. var furl = fileinfo.href || fileinfo.src; + furl = furl.split('?')[0]; // Remove trailing variables, if present. var fs = (fileinfo.innerText.match(/[0-9]+ (KB|MB)/) || ["0 KB"])[0].split(" "); var filesize = (fs[1] === "MB" ? fs[0] * 1024 : fs[0]);