diff --git a/CHANGELOG.md b/CHANGELOG.md index a199891c2..721a6f31d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ The attributions below are for work that has been incorporated into the script a The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x). +### v1.9.21.8 +*2015-01-31* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.8/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.8/builds/4chan-X-noupdate.crx "Chromium version")] + +- Expanded WebMs with audio are no longer paused when offscreen. + ### v1.9.21.7 *2015-01-31* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.7/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.21.7/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/LICENSE b/LICENSE index 4c6c0d889..f69a8c8fa 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.9.21.7 +* 4chan X - Version 1.9.21.8 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 4ccd0146e..5c7d3f878 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 70996bb35..23f6ecc5d 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.9.21.7 +// @version 1.9.21.8 // @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 30721acb1..fa895a85b 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.9.21.7 +// @version 1.9.21.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -25,7 +25,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.21.7 +* 4chan X - Version 1.9.21.8 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -397,7 +397,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.21.7', + VERSION: '1.9.21.8', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -831,6 +831,10 @@ return (value < min ? min : value > max ? max : value); }; + $.hasAudio = function(video) { + return video.mozHasAudio || !!video.webkitAudioDecodedByteCount; + }; + $.item = function(key, val) { var item; item = {}; @@ -6627,7 +6631,7 @@ noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled; this.captcha = Captcha[noscript ? 'noscript' : 'v2']; if (Conf['QR Shortcut']) { - sc = $.el('a', { + this.shortcut = sc = $.el('a', { className: 'qr-shortcut fa fa-comment-o disabled', textContent: 'QR', title: 'Quick Reply', @@ -6747,7 +6751,7 @@ } } if (Conf['QR Shortcut']) { - return $.rmClass($('.qr-shortcut'), 'disabled'); + return $.rmClass(QR.shortcut, 'disabled'); } }, close: function() { @@ -6761,7 +6765,7 @@ d.activeElement.blur(); $.rmClass(QR.nodes.el, 'dump'); if (Conf['QR Shortcut']) { - $.addClass($('.qr-shortcut'), 'disabled'); + $.addClass(QR.shortcut, 'disabled'); } new QR.post(true); _ref = QR.posts.splice(0, QR.posts.length - 1); @@ -7135,7 +7139,7 @@ QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); pass = false; } - if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && (video.mozHasAudio || video.webkitAudioDecodedByteCount)) { + if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) { QR.error("" + file.name + ": Audio not allowed"); pass = false; } @@ -9519,6 +9523,9 @@ continue; } video = post.file.fullImage; + if ($.hasAudio(video)) { + continue; + } visible = Header.isNodeVisible(video); if (visible && post.file.wasPlaying) { delete post.file.wasPlaying; diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 006fa6ad8..638253b15 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 28152667c..4c2846bbc 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.9.21.7 +// @version 1.9.21.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.21.7 +* 4chan X - Version 1.9.21.8 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -396,7 +396,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.21.7', + VERSION: '1.9.21.8', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -830,6 +830,10 @@ return (value < min ? min : value > max ? max : value); }; + $.hasAudio = function(video) { + return video.mozHasAudio || !!video.webkitAudioDecodedByteCount; + }; + $.item = function(key, val) { var item; item = {}; @@ -6626,7 +6630,7 @@ noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled; this.captcha = Captcha[noscript ? 'noscript' : 'v2']; if (Conf['QR Shortcut']) { - sc = $.el('a', { + this.shortcut = sc = $.el('a', { className: 'qr-shortcut fa fa-comment-o disabled', textContent: 'QR', title: 'Quick Reply', @@ -6746,7 +6750,7 @@ } } if (Conf['QR Shortcut']) { - return $.rmClass($('.qr-shortcut'), 'disabled'); + return $.rmClass(QR.shortcut, 'disabled'); } }, close: function() { @@ -6760,7 +6764,7 @@ d.activeElement.blur(); $.rmClass(QR.nodes.el, 'dump'); if (Conf['QR Shortcut']) { - $.addClass($('.qr-shortcut'), 'disabled'); + $.addClass(QR.shortcut, 'disabled'); } new QR.post(true); _ref = QR.posts.splice(0, QR.posts.length - 1); @@ -7134,7 +7138,7 @@ QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); pass = false; } - if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && (video.mozHasAudio || video.webkitAudioDecodedByteCount)) { + if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) { QR.error("" + file.name + ": Audio not allowed"); pass = false; } @@ -9518,6 +9522,9 @@ continue; } video = post.file.fullImage; + if ($.hasAudio(video)) { + continue; + } visible = Header.isNodeVisible(video); if (visible && post.file.wasPlaying) { delete post.file.wasPlaying; diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 7a2f9a6bf..85c56b004 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 584f123e1..fcf40fc9f 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.9.21.7 +// @version 1.9.21.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5a28a837f..83096d0c5 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.9.21.7 +// @version 1.9.21.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -25,7 +25,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.21.7 +* 4chan X - Version 1.9.21.8 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -397,7 +397,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.21.7', + VERSION: '1.9.21.8', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -831,6 +831,10 @@ return (value < min ? min : value > max ? max : value); }; + $.hasAudio = function(video) { + return video.mozHasAudio || !!video.webkitAudioDecodedByteCount; + }; + $.item = function(key, val) { var item; item = {}; @@ -6627,7 +6631,7 @@ noscript = Conf['Force Noscript Captcha'] || !doc.dataset.jsEnabled; this.captcha = Captcha[noscript ? 'noscript' : 'v2']; if (Conf['QR Shortcut']) { - sc = $.el('a', { + this.shortcut = sc = $.el('a', { className: 'qr-shortcut fa fa-comment-o disabled', textContent: 'QR', title: 'Quick Reply', @@ -6747,7 +6751,7 @@ } } if (Conf['QR Shortcut']) { - return $.rmClass($('.qr-shortcut'), 'disabled'); + return $.rmClass(QR.shortcut, 'disabled'); } }, close: function() { @@ -6761,7 +6765,7 @@ d.activeElement.blur(); $.rmClass(QR.nodes.el, 'dump'); if (Conf['QR Shortcut']) { - $.addClass($('.qr-shortcut'), 'disabled'); + $.addClass(QR.shortcut, 'disabled'); } new QR.post(true); _ref = QR.posts.splice(0, QR.posts.length - 1); @@ -7135,7 +7139,7 @@ QR.error("" + file.name + ": Video too long (video: " + duration + "s, max: " + QR.max_duration_video + "s)"); pass = false; } - if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && (video.mozHasAudio || video.webkitAudioDecodedByteCount)) { + if (((_ref = g.BOARD.ID) !== 'gif' && _ref !== 'wsg') && $.hasAudio(video)) { QR.error("" + file.name + ": Audio not allowed"); pass = false; } @@ -9519,6 +9523,9 @@ continue; } video = post.file.fullImage; + if ($.hasAudio(video)) { + continue; + } visible = Header.isNodeVisible(video); if (visible && post.file.wasPlaying) { delete post.file.wasPlaying; diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 3c35bd632..a92813b1d 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index e5d1fac6c..20eebe736 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index b756c1fa6..919b1ade0 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 1256f3a10..8d57c379d 100755 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.9.21.7", + "version": "1.9.21.8", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",