diff --git a/CHANGELOG.md b/CHANGELOG.md index 545d41e41..fa36f7f3c 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ The links to individual versions below are to copies of the script with the upda ### v1.10.6 +**v1.10.6.6** *(2015-03-25)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.6.6/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.6.6/builds/4chan-X-noupdate.crx "Chromium version")] +- Work around issue where 4chan confirms post success before creating the thread, causing people to be sent to the 404 page instead of their thread. + **v1.10.6.5** *(2015-03-24)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.6.5/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.6.5/builds/4chan-X-noupdate.crx "Chromium version")] - Fix updater beeping on filtered posts / your own posts. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index a85a5814b..1f531fa23 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 1686cd753..ee8ad71e0 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.10.6.5 +// @version 1.10.6.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 fb5d49bbd..ddcc460bf 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.10.6.5 +// @version 1.10.6.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -395,7 +395,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.6.5', + VERSION: '1.10.6.6', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -7593,7 +7593,7 @@ return QR.status(); }, response: function() { - var URL, _, ban, err, h1, isReply, m, post, postID, postsCount, ref, ref1, req, resDoc, threadID; + var URL, _, ban, err, h1, isReply, m, open, post, postID, postsCount, ref, ref1, req, resDoc, threadID; req = QR.req; delete QR.req; post = QR.posts[0]; @@ -7670,14 +7670,38 @@ QR.cooldown.add(req.uploadEndTime, threadID, postID); URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0; if (URL) { - if (Conf['Open Post in New Tab'] || postsCount) { - $.open(URL); + open = Conf['Open Post in New Tab'] || postsCount ? function() { + return $.open(URL); + } : function() { + return window.location = URL; + }; + if (threadID === postID) { + QR.waitForThread(URL, open); } else { - window.location = URL; + open(); } } return QR.status(); }, + waitForThread: function(url, cb) { + var attempts, check; + attempts = 0; + check = function() { + return $.ajax(url, { + onloadend: function() { + attempts++; + if (attempts >= 5 || this.status === 200) { + return cb(); + } else { + return setTimeout(check, attempts * $.SECOND); + } + } + }, { + type: 'HEAD' + }); + }; + return check(); + }, abort: function() { if (QR.req && !QR.req.isUploadFinished) { QR.req.abort(); diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index a714cafe1..efe1775ea 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 b32b25e46..fab50cfae 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.10.6.5 +// @version 1.10.6.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -394,7 +394,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.6.5', + VERSION: '1.10.6.6', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -7592,7 +7592,7 @@ return QR.status(); }, response: function() { - var URL, _, ban, err, h1, isReply, m, post, postID, postsCount, ref, ref1, req, resDoc, threadID; + var URL, _, ban, err, h1, isReply, m, open, post, postID, postsCount, ref, ref1, req, resDoc, threadID; req = QR.req; delete QR.req; post = QR.posts[0]; @@ -7669,14 +7669,38 @@ QR.cooldown.add(req.uploadEndTime, threadID, postID); URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0; if (URL) { - if (Conf['Open Post in New Tab'] || postsCount) { - $.open(URL); + open = Conf['Open Post in New Tab'] || postsCount ? function() { + return $.open(URL); + } : function() { + return window.location = URL; + }; + if (threadID === postID) { + QR.waitForThread(URL, open); } else { - window.location = URL; + open(); } } return QR.status(); }, + waitForThread: function(url, cb) { + var attempts, check; + attempts = 0; + check = function() { + return $.ajax(url, { + onloadend: function() { + attempts++; + if (attempts >= 5 || this.status === 200) { + return cb(); + } else { + return setTimeout(check, attempts * $.SECOND); + } + } + }, { + type: 'HEAD' + }); + }; + return check(); + }, abort: function() { if (QR.req && !QR.req.isUploadFinished) { QR.req.abort(); diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 53455eb00..e84cfe97f 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 ea760472e..ed2f87ae0 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.10.6.5 +// @version 1.10.6.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5b4907eff..46584dfa4 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.10.6.5 +// @version 1.10.6.6 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -395,7 +395,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.6.5', + VERSION: '1.10.6.6', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -7593,7 +7593,7 @@ return QR.status(); }, response: function() { - var URL, _, ban, err, h1, isReply, m, post, postID, postsCount, ref, ref1, req, resDoc, threadID; + var URL, _, ban, err, h1, isReply, m, open, post, postID, postsCount, ref, ref1, req, resDoc, threadID; req = QR.req; delete QR.req; post = QR.posts[0]; @@ -7670,14 +7670,38 @@ QR.cooldown.add(req.uploadEndTime, threadID, postID); URL = threadID === postID ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID : g.VIEW === 'index' && !QR.cooldown.auto && Conf['Open Post in New Tab'] ? window.location.origin + "/" + g.BOARD + "/thread/" + threadID + "#p" + postID : void 0; if (URL) { - if (Conf['Open Post in New Tab'] || postsCount) { - $.open(URL); + open = Conf['Open Post in New Tab'] || postsCount ? function() { + return $.open(URL); + } : function() { + return window.location = URL; + }; + if (threadID === postID) { + QR.waitForThread(URL, open); } else { - window.location = URL; + open(); } } return QR.status(); }, + waitForThread: function(url, cb) { + var attempts, check; + attempts = 0; + check = function() { + return $.ajax(url, { + onloadend: function() { + attempts++; + if (attempts >= 5 || this.status === 200) { + return cb(); + } else { + return setTimeout(check, attempts * $.SECOND); + } + } + }, { + type: 'HEAD' + }); + }; + return check(); + }, abort: function() { if (QR.req && !QR.req.isUploadFinished) { QR.req.abort(); diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 3344f1161..483d864f5 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 d936907bc..61a3dd8d4 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 5f0b3a755..3f5f7cb19 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 726737fb7..e7be73d66 100755 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.10.6.5", - "date": "2015-03-25T04:33:38.095Z", + "version": "1.10.6.6", + "date": "2015-03-26T04:18:29.835Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",