diff --git a/CHANGELOG.md b/CHANGELOG.md index 25fa468a3..a1e6dfb07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ -Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0). +### v1.14.20 + +**v1.14.20.0** *(2020-06-16)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.0/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.20.0/builds/4chan-X-noupdate.crx)] +- Based on v1.14.19.4. +- Make image features work with .webp images. +- Make embedding work with .webp links. #365 +- Make video features work with .ogv videos. +- Fix 'Reveal Spoiler Thumbnails' on .bmp files. + ### v1.14.19 **v1.14.19.4** *(2020-06-11)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.19.4/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.19.4/builds/4chan-X-noupdate.crx)] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 06e34cb80..dc844d2f1 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 f70ba1cf6..710232a6d 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.19.4 +// @version 1.14.20.0 // @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 b279051e5..6850076d9 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.19.4 +// @version 1.14.20.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -218,7 +218,7 @@ docSet = function() { }; g = { - VERSION: '1.14.19.4', + VERSION: '1.14.20.0', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -326,7 +326,7 @@ Config = (function() { 'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'], 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], - 'Replace WEBM': [false, 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)'], + 'Replace WEBM': [false, 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'], 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'], 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], @@ -5377,6 +5377,14 @@ $ = (function() { }); }; + $.isImage = function(url) { + return /\.(jpe?g|png|gif|bmp|webp)$/i.test(url); + }; + + $.isVideo = function(url) { + return /\.(webm|mp4|ogv)$/i.test(url); + }; + $.engine = (function() { if (/Edge\//.test(navigator.userAgent)) { return 'edge'; @@ -7138,8 +7146,8 @@ Post = (function() { } $.extend(file, { url: file.link.href, - isImage: /\.(jpe?g|png|gif|bmp)$/i.test(file.link.href), - isVideo: /\.(webm|mp4)$/i.test(file.link.href) + isImage: $.isImage(file.link.href), + isVideo: $.isVideo(file.link.href) }); size = +file.size.match(/[\d.]+/)[0]; unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); @@ -8040,7 +8048,7 @@ SW = {}; }); if (thumb) { $.extend(file, { - thumbURL: /\/static\//.test(thumb.src) && /\.(?:gif|jpe?g|png)$/.test(link.href) ? link.href : thumb.src, + thumbURL: /\/static\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src, isSpoiler: /^Spoiler/i.test(info[1] || '') || link.textContent === 'Spoiler Image' }); } @@ -14669,6 +14677,7 @@ Gallery = (function() { elType = $.getOwn({ 'webm': 'video', 'mp4': 'video', + 'ogv': 'video', 'pdf': 'iframe' }, ext) || 'img'; file = $.el(elType); @@ -16835,7 +16844,7 @@ Embedding = (function() { } }, { key: 'image', - regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp)(?::\w+)?(?:[?#]|$)/i, + regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, style: '', el: function(a) { return $.el('div', {innerHTML: ""}); diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 30ff9085e..248587c5e 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 d1fb7a192..e94c4bf95 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.19.4 +// @version 1.14.20.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -218,7 +218,7 @@ docSet = function() { }; g = { - VERSION: '1.14.19.4', + VERSION: '1.14.20.0', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -326,7 +326,7 @@ Config = (function() { 'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'], 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], - 'Replace WEBM': [false, 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)'], + 'Replace WEBM': [false, 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'], 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'], 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], @@ -5377,6 +5377,14 @@ $ = (function() { }); }; + $.isImage = function(url) { + return /\.(jpe?g|png|gif|bmp|webp)$/i.test(url); + }; + + $.isVideo = function(url) { + return /\.(webm|mp4|ogv)$/i.test(url); + }; + $.engine = (function() { if (/Edge\//.test(navigator.userAgent)) { return 'edge'; @@ -7138,8 +7146,8 @@ Post = (function() { } $.extend(file, { url: file.link.href, - isImage: /\.(jpe?g|png|gif|bmp)$/i.test(file.link.href), - isVideo: /\.(webm|mp4)$/i.test(file.link.href) + isImage: $.isImage(file.link.href), + isVideo: $.isVideo(file.link.href) }); size = +file.size.match(/[\d.]+/)[0]; unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); @@ -8040,7 +8048,7 @@ SW = {}; }); if (thumb) { $.extend(file, { - thumbURL: /\/static\//.test(thumb.src) && /\.(?:gif|jpe?g|png)$/.test(link.href) ? link.href : thumb.src, + thumbURL: /\/static\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src, isSpoiler: /^Spoiler/i.test(info[1] || '') || link.textContent === 'Spoiler Image' }); } @@ -14669,6 +14677,7 @@ Gallery = (function() { elType = $.getOwn({ 'webm': 'video', 'mp4': 'video', + 'ogv': 'video', 'pdf': 'iframe' }, ext) || 'img'; file = $.el(elType); @@ -16835,7 +16844,7 @@ Embedding = (function() { } }, { key: 'image', - regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp)(?::\w+)?(?:[?#]|$)/i, + regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, style: '', el: function(a) { return $.el('div', {innerHTML: ""}); diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 02aebe928..58dd9b425 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 2a3129b43..48836c164 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.19.4 +// @version 1.14.20.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 045782589..31b85f717 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.19.4 +// @version 1.14.20.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -218,7 +218,7 @@ docSet = function() { }; g = { - VERSION: '1.14.19.4', + VERSION: '1.14.20.0', NAMESPACE: '4chan X.', sites: Object.create(null), boards: Object.create(null) @@ -326,7 +326,7 @@ Config = (function() { 'Replace GIF': [false, 'Replace gif thumbnails with the actual image.'], 'Replace JPG': [false, 'Replace jpg thumbnails with the actual image.'], 'Replace PNG': [false, 'Replace png thumbnails with the actual image.'], - 'Replace WEBM': [false, 'Replace webm and mp4 thumbnails with the actual video. Probably will degrade browser performance ;)'], + 'Replace WEBM': [false, 'Replace webm, mp4, and ogv thumbnails with the actual video. Probably will degrade browser performance ;)'], 'Image Prefetching': [true, 'Add a shortcut icon to the header to turn on image preloading.'], 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], @@ -5377,6 +5377,14 @@ $ = (function() { }); }; + $.isImage = function(url) { + return /\.(jpe?g|png|gif|bmp|webp)$/i.test(url); + }; + + $.isVideo = function(url) { + return /\.(webm|mp4|ogv)$/i.test(url); + }; + $.engine = (function() { if (/Edge\//.test(navigator.userAgent)) { return 'edge'; @@ -7138,8 +7146,8 @@ Post = (function() { } $.extend(file, { url: file.link.href, - isImage: /\.(jpe?g|png|gif|bmp)$/i.test(file.link.href), - isVideo: /\.(webm|mp4)$/i.test(file.link.href) + isImage: $.isImage(file.link.href), + isVideo: $.isVideo(file.link.href) }); size = +file.size.match(/[\d.]+/)[0]; unit = ['B', 'KB', 'MB', 'GB'].indexOf(file.size.match(/\w+$/)[0]); @@ -8040,7 +8048,7 @@ SW = {}; }); if (thumb) { $.extend(file, { - thumbURL: /\/static\//.test(thumb.src) && /\.(?:gif|jpe?g|png)$/.test(link.href) ? link.href : thumb.src, + thumbURL: /\/static\//.test(thumb.src) && $.isImage(link.href) ? link.href : thumb.src, isSpoiler: /^Spoiler/i.test(info[1] || '') || link.textContent === 'Spoiler Image' }); } @@ -14669,6 +14677,7 @@ Gallery = (function() { elType = $.getOwn({ 'webm': 'video', 'mp4': 'video', + 'ogv': 'video', 'pdf': 'iframe' }, ext) || 'img'; file = $.el(elType); @@ -16835,7 +16844,7 @@ Embedding = (function() { } }, { key: 'image', - regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp)(?::\w+)?(?:[?#]|$)/i, + regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp|webp)(?::\w+)?(?:[?#]|$)/i, style: '', el: function(a) { return $.el('div', {innerHTML: ""}); diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 9315485bd..e27829434 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 4051d5749..c95d45e2c 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.19.4", + "version": "1.14.20.0", "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 c824f4eb8..31354104e 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 5621cd25a..86e5c0dec 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.19.4", + "version": "1.14.20.0", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index cff9850df..cc2c12005 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index 2142cee37..1b571cf04 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.19.4", - "date": "2020-06-11T08:21:51.865Z" + "version": "1.14.20.0", + "date": "2020-06-16T08:56:06.279Z" } \ No newline at end of file