diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f558d772..6b15bfaed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ ### v1.13.15 +**v1.13.15.6** *(2018-01-25)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.6/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.6/builds/4chan-X-noupdate.crx)] +- Bugfix to captcha opening logic. Don't ask user for new captchas when we have a bypass cookie or at least one captcha, even when many posts are queued. +- Don't save captchas to disk or share them between tabs. They are too short-lived to be worth it now. This should reduce associated I/O errors. + **v1.13.15.5** *(2018-01-23)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.5/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.13.15.5/builds/4chan-X-noupdate.crx)] - Add link in settings to captcha FAQ. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index f0db1e5c8..90fa4241a 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 669ab5ff2..03090cdcc 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.13.15.5 +// @version 1.13.15.6 // @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 c71ad42ee..4b94a6539 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.13.15.5 +// @version 1.13.15.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -159,7 +159,7 @@ docSet = function() { }; g = { - VERSION: '1.13.15.5', + VERSION: '1.13.15.6', NAMESPACE: '4chan X.', boards: {} }; @@ -5259,7 +5259,7 @@ $ = (function() { }); $.clear = function(cb) { $["delete"](Object.keys(Conf)); - $["delete"](['previousversion', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']); + $["delete"](['previousversion', 'QR Size', 'QR.persona', 'hiddenPSA']); try { $["delete"]($.listValues().map(function(key) { return key.replace(g.NAMESPACE, ''); @@ -20154,15 +20154,6 @@ Captcha = {}; (function() { Captcha.cache = { init: function() { - $.get('captchas', [], (function(_this) { - return function(arg) { - var captchas; - captchas = arg.captchas; - _this.sync(captchas); - return _this.clear(); - }; - })(this)); - $.sync('captchas', this.sync.bind(this)); return $.on(d, 'SaveCaptcha', (function(_this) { return function(e) { return _this.save(e.detail); @@ -20174,26 +20165,7 @@ Captcha = {}; return this.captchas.length; }, needed: function() { - var captchaCount, postsCount; - captchaCount = this.captchas.length; - if (QR.req || /\b_ct=/.test(d.cookie)) { - captchaCount++; - } - postsCount = QR.posts.length; - if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) { - postsCount = 0; - } - return captchaCount < postsCount; - }, - sync: function(captchas) { - if (captchas == null) { - captchas = []; - } - if (!(captchas instanceof Array)) { - captchas = []; - } - this.captchas = captchas; - return this.count(); + return !(/\b_ct=/.test(d.cookie) || this.captchas.length || QR.req) && (QR.posts.length > 1 || Conf['Auto-load captcha'] || QR.posts[0].com || QR.posts[0].file); }, getOne: function(isReply) { var captcha, i; @@ -20203,7 +20175,6 @@ Captcha = {}; }); if (i >= 0) { captcha = this.captchas.splice(i, 1)[0]; - $.set('captchas', this.captchas); this.count(); return captcha; } else { @@ -20211,17 +20182,14 @@ Captcha = {}; } }, save: function(captcha) { - $.forceSync('captchas'); this.captchas.push(captcha); this.captchas.sort(function(a, b) { return a.timeout - b.timeout; }); - $.set('captchas', this.captchas); return this.count(); }, clear: function() { var captcha, i, j, len, now, ref; - $.forceSync('captchas'); if (this.captchas.length) { now = Date.now(); ref = this.captchas; @@ -20233,7 +20201,6 @@ Captcha = {}; } if (i) { this.captchas = this.captchas.slice(i); - $.set('captchas', this.captchas); return this.count(); } } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 9714fad35..3c4ff365a 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 5d321aa5f..12b6a4f16 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.13.15.5 +// @version 1.13.15.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -159,7 +159,7 @@ docSet = function() { }; g = { - VERSION: '1.13.15.5', + VERSION: '1.13.15.6', NAMESPACE: '4chan X.', boards: {} }; @@ -5259,7 +5259,7 @@ $ = (function() { }); $.clear = function(cb) { $["delete"](Object.keys(Conf)); - $["delete"](['previousversion', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']); + $["delete"](['previousversion', 'QR Size', 'QR.persona', 'hiddenPSA']); try { $["delete"]($.listValues().map(function(key) { return key.replace(g.NAMESPACE, ''); @@ -20154,15 +20154,6 @@ Captcha = {}; (function() { Captcha.cache = { init: function() { - $.get('captchas', [], (function(_this) { - return function(arg) { - var captchas; - captchas = arg.captchas; - _this.sync(captchas); - return _this.clear(); - }; - })(this)); - $.sync('captchas', this.sync.bind(this)); return $.on(d, 'SaveCaptcha', (function(_this) { return function(e) { return _this.save(e.detail); @@ -20174,26 +20165,7 @@ Captcha = {}; return this.captchas.length; }, needed: function() { - var captchaCount, postsCount; - captchaCount = this.captchas.length; - if (QR.req || /\b_ct=/.test(d.cookie)) { - captchaCount++; - } - postsCount = QR.posts.length; - if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) { - postsCount = 0; - } - return captchaCount < postsCount; - }, - sync: function(captchas) { - if (captchas == null) { - captchas = []; - } - if (!(captchas instanceof Array)) { - captchas = []; - } - this.captchas = captchas; - return this.count(); + return !(/\b_ct=/.test(d.cookie) || this.captchas.length || QR.req) && (QR.posts.length > 1 || Conf['Auto-load captcha'] || QR.posts[0].com || QR.posts[0].file); }, getOne: function(isReply) { var captcha, i; @@ -20203,7 +20175,6 @@ Captcha = {}; }); if (i >= 0) { captcha = this.captchas.splice(i, 1)[0]; - $.set('captchas', this.captchas); this.count(); return captcha; } else { @@ -20211,17 +20182,14 @@ Captcha = {}; } }, save: function(captcha) { - $.forceSync('captchas'); this.captchas.push(captcha); this.captchas.sort(function(a, b) { return a.timeout - b.timeout; }); - $.set('captchas', this.captchas); return this.count(); }, clear: function() { var captcha, i, j, len, now, ref; - $.forceSync('captchas'); if (this.captchas.length) { now = Date.now(); ref = this.captchas; @@ -20233,7 +20201,6 @@ Captcha = {}; } if (i) { this.captchas = this.captchas.slice(i); - $.set('captchas', this.captchas); return this.count(); } } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index a14c23fa3..6ded9b125 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 5a4f493b1..ced2d454d 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.13.15.5 +// @version 1.13.15.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 877ca8fee..2e7a55283 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.13.15.5 +// @version 1.13.15.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -159,7 +159,7 @@ docSet = function() { }; g = { - VERSION: '1.13.15.5', + VERSION: '1.13.15.6', NAMESPACE: '4chan X.', boards: {} }; @@ -5259,7 +5259,7 @@ $ = (function() { }); $.clear = function(cb) { $["delete"](Object.keys(Conf)); - $["delete"](['previousversion', 'QR Size', 'captchas', 'QR.persona', 'hiddenPSA']); + $["delete"](['previousversion', 'QR Size', 'QR.persona', 'hiddenPSA']); try { $["delete"]($.listValues().map(function(key) { return key.replace(g.NAMESPACE, ''); @@ -20154,15 +20154,6 @@ Captcha = {}; (function() { Captcha.cache = { init: function() { - $.get('captchas', [], (function(_this) { - return function(arg) { - var captchas; - captchas = arg.captchas; - _this.sync(captchas); - return _this.clear(); - }; - })(this)); - $.sync('captchas', this.sync.bind(this)); return $.on(d, 'SaveCaptcha', (function(_this) { return function(e) { return _this.save(e.detail); @@ -20174,26 +20165,7 @@ Captcha = {}; return this.captchas.length; }, needed: function() { - var captchaCount, postsCount; - captchaCount = this.captchas.length; - if (QR.req || /\b_ct=/.test(d.cookie)) { - captchaCount++; - } - postsCount = QR.posts.length; - if (postsCount === 1 && !Conf['Auto-load captcha'] && !QR.posts[0].com && !QR.posts[0].file) { - postsCount = 0; - } - return captchaCount < postsCount; - }, - sync: function(captchas) { - if (captchas == null) { - captchas = []; - } - if (!(captchas instanceof Array)) { - captchas = []; - } - this.captchas = captchas; - return this.count(); + return !(/\b_ct=/.test(d.cookie) || this.captchas.length || QR.req) && (QR.posts.length > 1 || Conf['Auto-load captcha'] || QR.posts[0].com || QR.posts[0].file); }, getOne: function(isReply) { var captcha, i; @@ -20203,7 +20175,6 @@ Captcha = {}; }); if (i >= 0) { captcha = this.captchas.splice(i, 1)[0]; - $.set('captchas', this.captchas); this.count(); return captcha; } else { @@ -20211,17 +20182,14 @@ Captcha = {}; } }, save: function(captcha) { - $.forceSync('captchas'); this.captchas.push(captcha); this.captchas.sort(function(a, b) { return a.timeout - b.timeout; }); - $.set('captchas', this.captchas); return this.count(); }, clear: function() { var captcha, i, j, len, now, ref; - $.forceSync('captchas'); if (this.captchas.length) { now = Date.now(); ref = this.captchas; @@ -20233,7 +20201,6 @@ Captcha = {}; } if (i) { this.captchas = this.captchas.slice(i); - $.set('captchas', this.captchas); return this.count(); } } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 479797007..c66e3ad84 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 413b6bb6a..0ee2b2cfe 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.13.15.5", + "version": "1.13.15.6", "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 6f812dfb6..1349b7da3 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 dffa620f5..f56e0813d 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.13.15.5", + "version": "1.13.15.6", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index 5e48c2308..22b90d059 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index db07d6bb7..e873b846a 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.13.15.5", - "date": "2018-01-23T21:09:54.187Z" + "version": "1.13.15.6", + "date": "2018-01-25T00:49:44.705Z" } \ No newline at end of file