diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0b2f59916..75d8cfe01 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -5695,6 +5695,7 @@ if (_ref = urlBlob.type, __indexOf.call(QR.mimeTypes, _ref) < 0) { QR.error("Unsupported file type."); } + urlBlob.name = url.substr(url.lastIndexOf('/') + 1, url.length); QR.handleFiles([urlBlob]); return; return { diff --git a/builds/crx.crx b/builds/crx.crx index b20e3cd0d..19eb5adc9 100644 Binary files a/builds/crx.crx and b/builds/crx.crx differ diff --git a/builds/crx/script.js b/builds/crx/script.js index 46d0fd92e..35cccd420 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -5696,6 +5696,7 @@ if (_ref = urlBlob.type, __indexOf.call(QR.mimeTypes, _ref) < 0) { QR.error("Unsupported file type."); } + urlBlob.name = url.substr(url.lastIndexOf('/') + 1, url.length); QR.handleFiles([urlBlob]); } else { QR.error("Can't load image."); diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index fea23146e..b6de4ffa5 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -276,11 +276,12 @@ QR = xhr.open('GET', url, true) xhr.responseType = 'blob' xhr.onload = (e) -> - if this.readyState == this.DONE && xhr.status == 200 + if @readyState is @DONE && xhr.status is 200 urlBlob = new Blob([this.response], {type : this.getResponseHeader('content-type')}) return if urlBlob.type == null unless urlBlob.type in QR.mimeTypes QR.error "Unsupported file type." + urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length) QR.handleFiles([urlBlob]) return else @@ -318,6 +319,7 @@ QR = unless urlBlob.type in QR.mimeTypes QR.error "Unsupported file type." + urlBlob.name = url.substr(url.lastIndexOf('/')+1, url.length) QR.handleFiles([urlBlob]) return