diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a07d30cb..a3e8248f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ ### v1.14.7 +**v1.14.7.2** *(2019-04-11)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.7.2/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.7.2/builds/4chan-X-noupdate.crx)] +- Fix dragging left to contract WebMs in Firefox. #1547 +- Remove query string from filename in Post from URL feature. +- Speed up Post from URL on some platforms. +- Fix issue making WebM title fetching needlessly slow on Chrome extension. + **v1.14.7.1** *(2019-04-09)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.7.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.7.1/builds/4chan-X-noupdate.crx)] - Tolerate broken HTML better. - Fix 4chan/4channel not being correct in certain links. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 179f6a91e..165cdf911 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index 96aec7591..820447f6e 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.14.7.1 +// @version 1.14.7.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index 0607a8371..a9d40bbb6 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.14.7.1 +// @version 1.14.7.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.7.1', + VERSION: '1.14.7.2', NAMESPACE: '4chan X.', boards: {} }; @@ -5441,21 +5441,21 @@ CrossOrigin = (function() { CrossOrigin = { binary: function(url, cb, headers) { - var options, ref, workaround; if (headers == null) { headers = {}; } url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'); - workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version); - workaround || (workaround = /PaleMoon\//.test(navigator.userAgent)); - workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null); - options = { + return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)({ method: "GET", url: url, headers: headers, + responseType: 'arraybuffer', + overrideMimeType: 'text/plain; charset=x-user-defined', onload: function(xhr) { - var contentDisposition, contentType, data, i, r, ref1, ref2; - if (workaround) { + var data, i, r; + if (xhr.response instanceof ArrayBuffer) { + data = new Uint8Array(xhr.response); + } else { r = xhr.responseText; data = new Uint8Array(r.length); i = 0; @@ -5463,12 +5463,8 @@ CrossOrigin = (function() { data[i] = r.charCodeAt(i); i++; } - } else { - data = new Uint8Array(xhr.response); } - contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; - contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; - return cb(data, contentType, contentDisposition); + return cb(data, xhr.responseHeaders); }, onerror: function() { return cb(null); @@ -5476,27 +5472,23 @@ CrossOrigin = (function() { onabort: function() { return cb(null); } - }; - if (workaround) { - options.overrideMimeType = 'text/plain; charset=x-user-defined'; - } else { - options.responseType = 'arraybuffer'; - } - return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(options); + }); }, file: function(url, cb) { - return CrossOrigin.binary(url, function(data, contentType, contentDisposition) { - var blob, match, mime, name, ref, ref1, ref2, ref3; + return CrossOrigin.binary(url, function(data, headers) { + var blob, contentDisposition, contentType, match, mime, name, ref, ref1, ref2, ref3, ref4; if (data == null) { return cb(null); } - name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0; + name = (ref = url.match(/([^\/?#]+)\/*(?:$|[?#])/)) != null ? ref[1] : void 0; + contentType = (ref1 = headers.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; + contentDisposition = (ref2 = headers.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream'; - match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0); + match = (contentDisposition != null ? (ref3 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref3[1] : void 0 : void 0) || (contentType != null ? (ref4 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref4[1] : void 0 : void 0); if (match) { name = match.replace(/\\"/g, '"'); } - if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) { + if (/^text\/plain;\s*charset=x-user-defined$/i.test(mime)) { mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream'; } blob = new Blob([data], { @@ -14465,7 +14457,7 @@ ImageExpand = (function() { } }, mouseout: function(e) { - if (mousedown && e.clientX <= this.getBoundingClientRect().left) { + if (((e.buttons & 1) || mousedown) && e.clientX <= this.getBoundingClientRect().left) { return ImageExpand.toggle(Get.postFromNode(this)); } } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index ef906fca9..a37e401b8 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index 866614c9c..57177db19 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.7.1 +// @version 1.14.7.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.7.1', + VERSION: '1.14.7.2', NAMESPACE: '4chan X.', boards: {} }; @@ -5441,21 +5441,21 @@ CrossOrigin = (function() { CrossOrigin = { binary: function(url, cb, headers) { - var options, ref, workaround; if (headers == null) { headers = {}; } url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'); - workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version); - workaround || (workaround = /PaleMoon\//.test(navigator.userAgent)); - workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null); - options = { + return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)({ method: "GET", url: url, headers: headers, + responseType: 'arraybuffer', + overrideMimeType: 'text/plain; charset=x-user-defined', onload: function(xhr) { - var contentDisposition, contentType, data, i, r, ref1, ref2; - if (workaround) { + var data, i, r; + if (xhr.response instanceof ArrayBuffer) { + data = new Uint8Array(xhr.response); + } else { r = xhr.responseText; data = new Uint8Array(r.length); i = 0; @@ -5463,12 +5463,8 @@ CrossOrigin = (function() { data[i] = r.charCodeAt(i); i++; } - } else { - data = new Uint8Array(xhr.response); } - contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; - contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; - return cb(data, contentType, contentDisposition); + return cb(data, xhr.responseHeaders); }, onerror: function() { return cb(null); @@ -5476,27 +5472,23 @@ CrossOrigin = (function() { onabort: function() { return cb(null); } - }; - if (workaround) { - options.overrideMimeType = 'text/plain; charset=x-user-defined'; - } else { - options.responseType = 'arraybuffer'; - } - return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(options); + }); }, file: function(url, cb) { - return CrossOrigin.binary(url, function(data, contentType, contentDisposition) { - var blob, match, mime, name, ref, ref1, ref2, ref3; + return CrossOrigin.binary(url, function(data, headers) { + var blob, contentDisposition, contentType, match, mime, name, ref, ref1, ref2, ref3, ref4; if (data == null) { return cb(null); } - name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0; + name = (ref = url.match(/([^\/?#]+)\/*(?:$|[?#])/)) != null ? ref[1] : void 0; + contentType = (ref1 = headers.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; + contentDisposition = (ref2 = headers.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream'; - match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0); + match = (contentDisposition != null ? (ref3 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref3[1] : void 0 : void 0) || (contentType != null ? (ref4 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref4[1] : void 0 : void 0); if (match) { name = match.replace(/\\"/g, '"'); } - if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) { + if (/^text\/plain;\s*charset=x-user-defined$/i.test(mime)) { mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream'; } blob = new Blob([data], { @@ -14465,7 +14457,7 @@ ImageExpand = (function() { } }, mouseout: function(e) { - if (mousedown && e.clientX <= this.getBoundingClientRect().left) { + if (((e.buttons & 1) || mousedown) && e.clientX <= this.getBoundingClientRect().left) { return ImageExpand.toggle(Get.postFromNode(this)); } } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index d82b77381..7e79313c4 100644 Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 8c49c20b1..f931ee9fe 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.7.1 +// @version 1.14.7.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index d2c701d29..3a268c150 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.7.1 +// @version 1.14.7.2 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.7.1', + VERSION: '1.14.7.2', NAMESPACE: '4chan X.', boards: {} }; @@ -5441,21 +5441,21 @@ CrossOrigin = (function() { CrossOrigin = { binary: function(url, cb, headers) { - var options, ref, workaround; if (headers == null) { headers = {}; } url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'); - workaround = $.engine === 'gecko' && (typeof GM_info !== "undefined" && GM_info !== null) && /^[0-2]\.|^3\.[01](?!\d)/.test(GM_info.version); - workaround || (workaround = /PaleMoon\//.test(navigator.userAgent)); - workaround || (workaround = (typeof GM_info !== "undefined" && GM_info !== null ? (ref = GM_info.script) != null ? ref.includeJSB : void 0 : void 0) != null); - options = { + return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)({ method: "GET", url: url, headers: headers, + responseType: 'arraybuffer', + overrideMimeType: 'text/plain; charset=x-user-defined', onload: function(xhr) { - var contentDisposition, contentType, data, i, r, ref1, ref2; - if (workaround) { + var data, i, r; + if (xhr.response instanceof ArrayBuffer) { + data = new Uint8Array(xhr.response); + } else { r = xhr.responseText; data = new Uint8Array(r.length); i = 0; @@ -5463,12 +5463,8 @@ CrossOrigin = (function() { data[i] = r.charCodeAt(i); i++; } - } else { - data = new Uint8Array(xhr.response); } - contentType = (ref1 = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; - contentDisposition = (ref2 = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; - return cb(data, contentType, contentDisposition); + return cb(data, xhr.responseHeaders); }, onerror: function() { return cb(null); @@ -5476,27 +5472,23 @@ CrossOrigin = (function() { onabort: function() { return cb(null); } - }; - if (workaround) { - options.overrideMimeType = 'text/plain; charset=x-user-defined'; - } else { - options.responseType = 'arraybuffer'; - } - return ((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) || GM_xmlhttpRequest)(options); + }); }, file: function(url, cb) { - return CrossOrigin.binary(url, function(data, contentType, contentDisposition) { - var blob, match, mime, name, ref, ref1, ref2, ref3; + return CrossOrigin.binary(url, function(data, headers) { + var blob, contentDisposition, contentType, match, mime, name, ref, ref1, ref2, ref3, ref4; if (data == null) { return cb(null); } - name = (ref = url.match(/([^\/]+)\/*$/)) != null ? ref[1] : void 0; + name = (ref = url.match(/([^\/?#]+)\/*(?:$|[?#])/)) != null ? ref[1] : void 0; + contentType = (ref1 = headers.match(/Content-Type:\s*(.*)/i)) != null ? ref1[1] : void 0; + contentDisposition = (ref2 = headers.match(/Content-Disposition:\s*(.*)/i)) != null ? ref2[1] : void 0; mime = (contentType != null ? contentType.match(/[^;]*/)[0] : void 0) || 'application/octet-stream'; - match = (contentDisposition != null ? (ref1 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref1[1] : void 0 : void 0) || (contentType != null ? (ref2 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref2[1] : void 0 : void 0); + match = (contentDisposition != null ? (ref3 = contentDisposition.match(/\bfilename\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref3[1] : void 0 : void 0) || (contentType != null ? (ref4 = contentType.match(/\bname\s*=\s*"((\\"|[^"])+)"/i)) != null ? ref4[1] : void 0 : void 0); if (match) { name = match.replace(/\\"/g, '"'); } - if ((typeof GM_info !== "undefined" && GM_info !== null ? (ref3 = GM_info.script) != null ? ref3.includeJSB : void 0 : void 0) != null) { + if (/^text\/plain;\s*charset=x-user-defined$/i.test(mime)) { mime = QR.typeFromExtension[name.match(/[^.]*$/)[0].toLowerCase()] || 'application/octet-stream'; } blob = new Blob([data], { @@ -14465,7 +14457,7 @@ ImageExpand = (function() { } }, mouseout: function(e) { - if (mousedown && e.clientX <= this.getBoundingClientRect().left) { + if (((e.buttons & 1) || mousedown) && e.clientX <= this.getBoundingClientRect().left) { return ImageExpand.toggle(Get.postFromNode(this)); } } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 3d5c37033..eb1c9adba 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.json b/builds/updates-beta.json index 2f07d0b8b..865f12f76 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.7.1", + "version": "1.14.7.2", "update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx" } ] diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index bf7f5221f..03fd2bfb8 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.json b/builds/updates.json index 976291b1e..a0ea5cd15 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.7.1", + "version": "1.14.7.2", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index 0f7db5861..ab0816572 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index b621dc1db..f775e69dc 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.7.1", - "date": "2019-04-09T17:45:20.859Z" + "version": "1.14.7.2", + "date": "2019-04-11T15:38:53.367Z" } \ No newline at end of file