Release 4chan X v1.14.21.4.
This commit is contained in:
parent
cd68ba1443
commit
14c4df1d9e
@ -4,6 +4,9 @@
|
|||||||
|
|
||||||
### v1.14.21
|
### v1.14.21
|
||||||
|
|
||||||
|
**v1.14.21.4** *(2021-07-05)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.4/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.4/builds/4chan-X-noupdate.crx)]
|
||||||
|
- Preliminary support for new first-party captcha on 4chan.
|
||||||
|
|
||||||
**v1.14.21.3** *(2021-05-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.3/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.3/builds/4chan-X-noupdate.crx)]
|
**v1.14.21.3** *(2021-05-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.3/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.21.3/builds/4chan-X-noupdate.crx)]
|
||||||
- Fix race condition causing unread posts tracking to malfunction.
|
- Fix race condition causing unread posts tracking to malfunction.
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X beta
|
// @name 4chan X beta
|
||||||
// @version 1.14.21.3
|
// @version 1.14.21.4
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X beta
|
// @name 4chan X beta
|
||||||
// @version 1.14.21.3
|
// @version 1.14.21.4
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -218,7 +218,7 @@ docSet = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.14.21.3',
|
VERSION: '1.14.21.4',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
sites: Object.create(null),
|
sites: Object.create(null),
|
||||||
boards: Object.create(null)
|
boards: Object.create(null)
|
||||||
@ -23732,6 +23732,98 @@ Captcha = {};
|
|||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
Captcha.t = {
|
||||||
|
init: function() {
|
||||||
|
var root;
|
||||||
|
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root = $.el('div', {
|
||||||
|
className: 'captcha-root'
|
||||||
|
});
|
||||||
|
this.nodes = {
|
||||||
|
root: root
|
||||||
|
};
|
||||||
|
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');
|
||||||
|
return $.after(QR.nodes.com.parentNode, root);
|
||||||
|
},
|
||||||
|
moreNeeded: function() {},
|
||||||
|
setup: function(focus) {
|
||||||
|
var boardID, threadID;
|
||||||
|
if (!this.isEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.nodes.container) {
|
||||||
|
this.nodes.container = $.el('div', {
|
||||||
|
className: 'captcha-container'
|
||||||
|
});
|
||||||
|
$.prepend(this.nodes.root, this.nodes.container);
|
||||||
|
boardID = g.BOARD.ID;
|
||||||
|
threadID = '' + QR.posts[0].thread;
|
||||||
|
$.global(function() {
|
||||||
|
var el;
|
||||||
|
el = document.querySelector('#qr .captcha-container');
|
||||||
|
window.TCaptcha.init(el, this.boardID, +this.threadID);
|
||||||
|
return window.TCaptcha.setErrorCb(function(err) {
|
||||||
|
return window.dispatchEvent(new CustomEvent('CreateNotification', {
|
||||||
|
detail: {
|
||||||
|
type: 'warning',
|
||||||
|
content: '' + err
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}, {
|
||||||
|
boardID: boardID,
|
||||||
|
threadID: threadID
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (focus) {
|
||||||
|
return $('#t-resp').focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destroy: function() {
|
||||||
|
if (!(this.isEnabled && this.nodes.container)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.global(function() {
|
||||||
|
return window.TCaptcha.destroy();
|
||||||
|
});
|
||||||
|
$.rm(this.nodes.container);
|
||||||
|
return delete this.nodes.container;
|
||||||
|
},
|
||||||
|
getOne: function() {
|
||||||
|
var i, key, len, ref, response;
|
||||||
|
response = {};
|
||||||
|
if (this.nodes.container) {
|
||||||
|
ref = ['t-response', 't-challenge'];
|
||||||
|
for (i = 0, len = ref.length; i < len; i++) {
|
||||||
|
key = ref[i];
|
||||||
|
response[key] = $("[name='" + key + "']", this.nodes.container).value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!response['t-response']) {
|
||||||
|
response = null;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
},
|
||||||
|
setUsed: function() {
|
||||||
|
if (this.nodes.container) {
|
||||||
|
return $.global(function() {
|
||||||
|
return window.TCaptcha.clearChallenge();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
occupied: function() {
|
||||||
|
return !!this.nodes.container;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||||
|
|
||||||
@ -24158,7 +24250,6 @@ QR = (function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.posts = [];
|
this.posts = [];
|
||||||
this.captcha = Captcha.v2;
|
|
||||||
$.on(d, '4chanXInitFinished', function() {
|
$.on(d, '4chanXInitFinished', function() {
|
||||||
return BoardConfig.ready(QR.initReady);
|
return BoardConfig.ready(QR.initReady);
|
||||||
});
|
});
|
||||||
@ -24186,7 +24277,9 @@ QR = (function() {
|
|||||||
return Header.addShortcut('qr', sc, 540);
|
return Header.addShortcut('qr', sc, 540);
|
||||||
},
|
},
|
||||||
initReady: function() {
|
initReady: function() {
|
||||||
var config, link, linkBot, navLinksBot, origToggle, prop;
|
var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop;
|
||||||
|
captchaVersion = $('#t-root') ? 't' : 'v2';
|
||||||
|
QR.captcha = Captcha[captchaVersion];
|
||||||
QR.postingIsEnabled = true;
|
QR.postingIsEnabled = true;
|
||||||
config = g.BOARD.config;
|
config = g.BOARD.config;
|
||||||
prop = function(key, def) {
|
prop = function(key, def) {
|
||||||
@ -24964,8 +25057,11 @@ QR = (function() {
|
|||||||
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
||||||
err || (err = 'Original comment required.');
|
err || (err = 'Original comment required.');
|
||||||
}
|
}
|
||||||
if (QR.captcha.isEnabled && !(/\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||||
captcha = QR.captcha.getOne(!!threadID) || Captcha.cache.request(!!threadID);
|
captcha = QR.captcha.getOne(!!threadID);
|
||||||
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
captcha || (captcha = Captcha.cache.request(!!threadID));
|
||||||
|
}
|
||||||
if (!captcha) {
|
if (!captcha) {
|
||||||
err = 'No valid captcha.';
|
err = 'No valid captcha.';
|
||||||
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
||||||
@ -25015,13 +25111,21 @@ QR = (function() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
cb = function(response) {
|
cb = function(response) {
|
||||||
|
var key, val;
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
QR.currentCaptcha = response;
|
QR.currentCaptcha = response;
|
||||||
if (response.challenge != null) {
|
if (QR.captcha === Captcha.v2) {
|
||||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
if (response.challenge != null) {
|
||||||
options.form.append('recaptcha_response_field', response.response);
|
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||||
|
options.form.append('recaptcha_response_field', response.response);
|
||||||
|
} else {
|
||||||
|
options.form.append('g-recaptcha-response', response.response);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
options.form.append('g-recaptcha-response', response.response);
|
for (key in response) {
|
||||||
|
val = response[key];
|
||||||
|
options.form.append(key, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
||||||
@ -25031,12 +25135,14 @@ QR = (function() {
|
|||||||
QR.req = {
|
QR.req = {
|
||||||
progress: '...',
|
progress: '...',
|
||||||
abort: function() {
|
abort: function() {
|
||||||
Captcha.cache.abort();
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
Captcha.cache.abort();
|
||||||
|
}
|
||||||
return cb = null;
|
return cb = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
captcha(function(response) {
|
captcha(function(response) {
|
||||||
if (Captcha.cache.haveCookie()) {
|
if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) {
|
||||||
if (typeof cb === "function") {
|
if (typeof cb === "function") {
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
@ -25058,7 +25164,7 @@ QR = (function() {
|
|||||||
return QR.status();
|
return QR.status();
|
||||||
},
|
},
|
||||||
response: function() {
|
response: function() {
|
||||||
var URL, _, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||||
if (this !== QR.req) {
|
if (this !== QR.req) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -25071,12 +25177,17 @@ QR = (function() {
|
|||||||
}
|
}
|
||||||
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
||||||
err = QR.connectionError();
|
err = QR.connectionError();
|
||||||
if (QR.currentCaptcha) {
|
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||||
Captcha.cache.save(QR.currentCaptcha);
|
Captcha.cache.save(QR.currentCaptcha);
|
||||||
}
|
}
|
||||||
} else if (this.status !== 200) {
|
} else if (this.status !== 200) {
|
||||||
err = "Error " + this.statusText + " (" + this.status + ")";
|
err = "Error " + this.statusText + " (" + this.status + ")";
|
||||||
}
|
}
|
||||||
|
if (!connErr) {
|
||||||
|
if (typeof (base = QR.captcha).setUsed === "function") {
|
||||||
|
base.setUsed();
|
||||||
|
}
|
||||||
|
}
|
||||||
delete QR.currentCaptcha;
|
delete QR.currentCaptcha;
|
||||||
if (err) {
|
if (err) {
|
||||||
QR.errorCount = (QR.errorCount || 0) + 1;
|
QR.errorCount = (QR.errorCount || 0) + 1;
|
||||||
@ -25197,7 +25308,7 @@ QR = (function() {
|
|||||||
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
||||||
delete QR.req;
|
delete QR.req;
|
||||||
oldReq.abort();
|
oldReq.abort();
|
||||||
if (QR.currentCaptcha) {
|
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||||
Captcha.cache.save(QR.currentCaptcha);
|
Captcha.cache.save(QR.currentCaptcha);
|
||||||
}
|
}
|
||||||
delete QR.currentCaptcha;
|
delete QR.currentCaptcha;
|
||||||
@ -26003,7 +26114,9 @@ QR = (function() {
|
|||||||
}
|
}
|
||||||
this.nodes.span.textContent = this.com;
|
this.nodes.span.textContent = this.com;
|
||||||
QR.captcha.moreNeeded();
|
QR.captcha.moreNeeded();
|
||||||
return Captcha.cache.prerequest();
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
return Captcha.cache.prerequest();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_Class.prototype.isOnlyQuotes = function() {
|
_Class.prototype.isOnlyQuotes = function() {
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.14.21.3
|
// @version 1.14.21.4
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -218,7 +218,7 @@ docSet = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.14.21.3',
|
VERSION: '1.14.21.4',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
sites: Object.create(null),
|
sites: Object.create(null),
|
||||||
boards: Object.create(null)
|
boards: Object.create(null)
|
||||||
@ -23732,6 +23732,98 @@ Captcha = {};
|
|||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
Captcha.t = {
|
||||||
|
init: function() {
|
||||||
|
var root;
|
||||||
|
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root = $.el('div', {
|
||||||
|
className: 'captcha-root'
|
||||||
|
});
|
||||||
|
this.nodes = {
|
||||||
|
root: root
|
||||||
|
};
|
||||||
|
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');
|
||||||
|
return $.after(QR.nodes.com.parentNode, root);
|
||||||
|
},
|
||||||
|
moreNeeded: function() {},
|
||||||
|
setup: function(focus) {
|
||||||
|
var boardID, threadID;
|
||||||
|
if (!this.isEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.nodes.container) {
|
||||||
|
this.nodes.container = $.el('div', {
|
||||||
|
className: 'captcha-container'
|
||||||
|
});
|
||||||
|
$.prepend(this.nodes.root, this.nodes.container);
|
||||||
|
boardID = g.BOARD.ID;
|
||||||
|
threadID = '' + QR.posts[0].thread;
|
||||||
|
$.global(function() {
|
||||||
|
var el;
|
||||||
|
el = document.querySelector('#qr .captcha-container');
|
||||||
|
window.TCaptcha.init(el, this.boardID, +this.threadID);
|
||||||
|
return window.TCaptcha.setErrorCb(function(err) {
|
||||||
|
return window.dispatchEvent(new CustomEvent('CreateNotification', {
|
||||||
|
detail: {
|
||||||
|
type: 'warning',
|
||||||
|
content: '' + err
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}, {
|
||||||
|
boardID: boardID,
|
||||||
|
threadID: threadID
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (focus) {
|
||||||
|
return $('#t-resp').focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destroy: function() {
|
||||||
|
if (!(this.isEnabled && this.nodes.container)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.global(function() {
|
||||||
|
return window.TCaptcha.destroy();
|
||||||
|
});
|
||||||
|
$.rm(this.nodes.container);
|
||||||
|
return delete this.nodes.container;
|
||||||
|
},
|
||||||
|
getOne: function() {
|
||||||
|
var i, key, len, ref, response;
|
||||||
|
response = {};
|
||||||
|
if (this.nodes.container) {
|
||||||
|
ref = ['t-response', 't-challenge'];
|
||||||
|
for (i = 0, len = ref.length; i < len; i++) {
|
||||||
|
key = ref[i];
|
||||||
|
response[key] = $("[name='" + key + "']", this.nodes.container).value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!response['t-response']) {
|
||||||
|
response = null;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
},
|
||||||
|
setUsed: function() {
|
||||||
|
if (this.nodes.container) {
|
||||||
|
return $.global(function() {
|
||||||
|
return window.TCaptcha.clearChallenge();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
occupied: function() {
|
||||||
|
return !!this.nodes.container;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||||
|
|
||||||
@ -24158,7 +24250,6 @@ QR = (function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.posts = [];
|
this.posts = [];
|
||||||
this.captcha = Captcha.v2;
|
|
||||||
$.on(d, '4chanXInitFinished', function() {
|
$.on(d, '4chanXInitFinished', function() {
|
||||||
return BoardConfig.ready(QR.initReady);
|
return BoardConfig.ready(QR.initReady);
|
||||||
});
|
});
|
||||||
@ -24186,7 +24277,9 @@ QR = (function() {
|
|||||||
return Header.addShortcut('qr', sc, 540);
|
return Header.addShortcut('qr', sc, 540);
|
||||||
},
|
},
|
||||||
initReady: function() {
|
initReady: function() {
|
||||||
var config, link, linkBot, navLinksBot, origToggle, prop;
|
var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop;
|
||||||
|
captchaVersion = $('#t-root') ? 't' : 'v2';
|
||||||
|
QR.captcha = Captcha[captchaVersion];
|
||||||
QR.postingIsEnabled = true;
|
QR.postingIsEnabled = true;
|
||||||
config = g.BOARD.config;
|
config = g.BOARD.config;
|
||||||
prop = function(key, def) {
|
prop = function(key, def) {
|
||||||
@ -24964,8 +25057,11 @@ QR = (function() {
|
|||||||
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
||||||
err || (err = 'Original comment required.');
|
err || (err = 'Original comment required.');
|
||||||
}
|
}
|
||||||
if (QR.captcha.isEnabled && !(/\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||||
captcha = QR.captcha.getOne(!!threadID) || Captcha.cache.request(!!threadID);
|
captcha = QR.captcha.getOne(!!threadID);
|
||||||
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
captcha || (captcha = Captcha.cache.request(!!threadID));
|
||||||
|
}
|
||||||
if (!captcha) {
|
if (!captcha) {
|
||||||
err = 'No valid captcha.';
|
err = 'No valid captcha.';
|
||||||
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
||||||
@ -25015,13 +25111,21 @@ QR = (function() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
cb = function(response) {
|
cb = function(response) {
|
||||||
|
var key, val;
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
QR.currentCaptcha = response;
|
QR.currentCaptcha = response;
|
||||||
if (response.challenge != null) {
|
if (QR.captcha === Captcha.v2) {
|
||||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
if (response.challenge != null) {
|
||||||
options.form.append('recaptcha_response_field', response.response);
|
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||||
|
options.form.append('recaptcha_response_field', response.response);
|
||||||
|
} else {
|
||||||
|
options.form.append('g-recaptcha-response', response.response);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
options.form.append('g-recaptcha-response', response.response);
|
for (key in response) {
|
||||||
|
val = response[key];
|
||||||
|
options.form.append(key, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
||||||
@ -25031,12 +25135,14 @@ QR = (function() {
|
|||||||
QR.req = {
|
QR.req = {
|
||||||
progress: '...',
|
progress: '...',
|
||||||
abort: function() {
|
abort: function() {
|
||||||
Captcha.cache.abort();
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
Captcha.cache.abort();
|
||||||
|
}
|
||||||
return cb = null;
|
return cb = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
captcha(function(response) {
|
captcha(function(response) {
|
||||||
if (Captcha.cache.haveCookie()) {
|
if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) {
|
||||||
if (typeof cb === "function") {
|
if (typeof cb === "function") {
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
@ -25058,7 +25164,7 @@ QR = (function() {
|
|||||||
return QR.status();
|
return QR.status();
|
||||||
},
|
},
|
||||||
response: function() {
|
response: function() {
|
||||||
var URL, _, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||||
if (this !== QR.req) {
|
if (this !== QR.req) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -25071,12 +25177,17 @@ QR = (function() {
|
|||||||
}
|
}
|
||||||
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
||||||
err = QR.connectionError();
|
err = QR.connectionError();
|
||||||
if (QR.currentCaptcha) {
|
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||||
Captcha.cache.save(QR.currentCaptcha);
|
Captcha.cache.save(QR.currentCaptcha);
|
||||||
}
|
}
|
||||||
} else if (this.status !== 200) {
|
} else if (this.status !== 200) {
|
||||||
err = "Error " + this.statusText + " (" + this.status + ")";
|
err = "Error " + this.statusText + " (" + this.status + ")";
|
||||||
}
|
}
|
||||||
|
if (!connErr) {
|
||||||
|
if (typeof (base = QR.captcha).setUsed === "function") {
|
||||||
|
base.setUsed();
|
||||||
|
}
|
||||||
|
}
|
||||||
delete QR.currentCaptcha;
|
delete QR.currentCaptcha;
|
||||||
if (err) {
|
if (err) {
|
||||||
QR.errorCount = (QR.errorCount || 0) + 1;
|
QR.errorCount = (QR.errorCount || 0) + 1;
|
||||||
@ -25197,7 +25308,7 @@ QR = (function() {
|
|||||||
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
||||||
delete QR.req;
|
delete QR.req;
|
||||||
oldReq.abort();
|
oldReq.abort();
|
||||||
if (QR.currentCaptcha) {
|
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||||
Captcha.cache.save(QR.currentCaptcha);
|
Captcha.cache.save(QR.currentCaptcha);
|
||||||
}
|
}
|
||||||
delete QR.currentCaptcha;
|
delete QR.currentCaptcha;
|
||||||
@ -26003,7 +26114,9 @@ QR = (function() {
|
|||||||
}
|
}
|
||||||
this.nodes.span.textContent = this.com;
|
this.nodes.span.textContent = this.com;
|
||||||
QR.captcha.moreNeeded();
|
QR.captcha.moreNeeded();
|
||||||
return Captcha.cache.prerequest();
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
return Captcha.cache.prerequest();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_Class.prototype.isOnlyQuotes = function() {
|
_Class.prototype.isOnlyQuotes = function() {
|
||||||
|
|||||||
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.14.21.3
|
// @version 1.14.21.4
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name 4chan X
|
// @name 4chan X
|
||||||
// @version 1.14.21.3
|
// @version 1.14.21.4
|
||||||
// @minGMVer 1.14
|
// @minGMVer 1.14
|
||||||
// @minFFVer 26
|
// @minFFVer 26
|
||||||
// @namespace 4chan-X
|
// @namespace 4chan-X
|
||||||
@ -218,7 +218,7 @@ docSet = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
g = {
|
g = {
|
||||||
VERSION: '1.14.21.3',
|
VERSION: '1.14.21.4',
|
||||||
NAMESPACE: '4chan X.',
|
NAMESPACE: '4chan X.',
|
||||||
sites: Object.create(null),
|
sites: Object.create(null),
|
||||||
boards: Object.create(null)
|
boards: Object.create(null)
|
||||||
@ -23732,6 +23732,98 @@ Captcha = {};
|
|||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
Captcha.t = {
|
||||||
|
init: function() {
|
||||||
|
var root;
|
||||||
|
if (d.cookie.indexOf('pass_enabled=1') >= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(this.isEnabled = !!$('#t-root') || !$.id('postForm'))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root = $.el('div', {
|
||||||
|
className: 'captcha-root'
|
||||||
|
});
|
||||||
|
this.nodes = {
|
||||||
|
root: root
|
||||||
|
};
|
||||||
|
$.addClass(QR.nodes.el, 'has-captcha', 'captcha-t');
|
||||||
|
return $.after(QR.nodes.com.parentNode, root);
|
||||||
|
},
|
||||||
|
moreNeeded: function() {},
|
||||||
|
setup: function(focus) {
|
||||||
|
var boardID, threadID;
|
||||||
|
if (!this.isEnabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.nodes.container) {
|
||||||
|
this.nodes.container = $.el('div', {
|
||||||
|
className: 'captcha-container'
|
||||||
|
});
|
||||||
|
$.prepend(this.nodes.root, this.nodes.container);
|
||||||
|
boardID = g.BOARD.ID;
|
||||||
|
threadID = '' + QR.posts[0].thread;
|
||||||
|
$.global(function() {
|
||||||
|
var el;
|
||||||
|
el = document.querySelector('#qr .captcha-container');
|
||||||
|
window.TCaptcha.init(el, this.boardID, +this.threadID);
|
||||||
|
return window.TCaptcha.setErrorCb(function(err) {
|
||||||
|
return window.dispatchEvent(new CustomEvent('CreateNotification', {
|
||||||
|
detail: {
|
||||||
|
type: 'warning',
|
||||||
|
content: '' + err
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
}, {
|
||||||
|
boardID: boardID,
|
||||||
|
threadID: threadID
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (focus) {
|
||||||
|
return $('#t-resp').focus();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destroy: function() {
|
||||||
|
if (!(this.isEnabled && this.nodes.container)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.global(function() {
|
||||||
|
return window.TCaptcha.destroy();
|
||||||
|
});
|
||||||
|
$.rm(this.nodes.container);
|
||||||
|
return delete this.nodes.container;
|
||||||
|
},
|
||||||
|
getOne: function() {
|
||||||
|
var i, key, len, ref, response;
|
||||||
|
response = {};
|
||||||
|
if (this.nodes.container) {
|
||||||
|
ref = ['t-response', 't-challenge'];
|
||||||
|
for (i = 0, len = ref.length; i < len; i++) {
|
||||||
|
key = ref[i];
|
||||||
|
response[key] = $("[name='" + key + "']", this.nodes.container).value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!response['t-response']) {
|
||||||
|
response = null;
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
},
|
||||||
|
setUsed: function() {
|
||||||
|
if (this.nodes.container) {
|
||||||
|
return $.global(function() {
|
||||||
|
return window.TCaptcha.clearChallenge();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
occupied: function() {
|
||||||
|
return !!this.nodes.container;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||||
|
|
||||||
@ -24158,7 +24250,6 @@ QR = (function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.posts = [];
|
this.posts = [];
|
||||||
this.captcha = Captcha.v2;
|
|
||||||
$.on(d, '4chanXInitFinished', function() {
|
$.on(d, '4chanXInitFinished', function() {
|
||||||
return BoardConfig.ready(QR.initReady);
|
return BoardConfig.ready(QR.initReady);
|
||||||
});
|
});
|
||||||
@ -24186,7 +24277,9 @@ QR = (function() {
|
|||||||
return Header.addShortcut('qr', sc, 540);
|
return Header.addShortcut('qr', sc, 540);
|
||||||
},
|
},
|
||||||
initReady: function() {
|
initReady: function() {
|
||||||
var config, link, linkBot, navLinksBot, origToggle, prop;
|
var captchaVersion, config, link, linkBot, navLinksBot, origToggle, prop;
|
||||||
|
captchaVersion = $('#t-root') ? 't' : 'v2';
|
||||||
|
QR.captcha = Captcha[captchaVersion];
|
||||||
QR.postingIsEnabled = true;
|
QR.postingIsEnabled = true;
|
||||||
config = g.BOARD.config;
|
config = g.BOARD.config;
|
||||||
prop = function(key, def) {
|
prop = function(key, def) {
|
||||||
@ -24964,8 +25057,11 @@ QR = (function() {
|
|||||||
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
if (g.BOARD.ID === 'r9k' && !((ref = post.com) != null ? ref.match(/[a-z-]/i) : void 0)) {
|
||||||
err || (err = 'Original comment required.');
|
err || (err = 'Original comment required.');
|
||||||
}
|
}
|
||||||
if (QR.captcha.isEnabled && !(/\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
if (QR.captcha.isEnabled && !(QR.captcha === Captcha.v2 && /\b_ct=/.test(d.cookie) && threadID) && !(err && !force)) {
|
||||||
captcha = QR.captcha.getOne(!!threadID) || Captcha.cache.request(!!threadID);
|
captcha = QR.captcha.getOne(!!threadID);
|
||||||
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
captcha || (captcha = Captcha.cache.request(!!threadID));
|
||||||
|
}
|
||||||
if (!captcha) {
|
if (!captcha) {
|
||||||
err = 'No valid captcha.';
|
err = 'No valid captcha.';
|
||||||
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
QR.captcha.setup(!QR.cooldown.auto || d.activeElement === QR.nodes.status);
|
||||||
@ -25015,13 +25111,21 @@ QR = (function() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
cb = function(response) {
|
cb = function(response) {
|
||||||
|
var key, val;
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
QR.currentCaptcha = response;
|
QR.currentCaptcha = response;
|
||||||
if (response.challenge != null) {
|
if (QR.captcha === Captcha.v2) {
|
||||||
options.form.append('recaptcha_challenge_field', response.challenge);
|
if (response.challenge != null) {
|
||||||
options.form.append('recaptcha_response_field', response.response);
|
options.form.append('recaptcha_challenge_field', response.challenge);
|
||||||
|
options.form.append('recaptcha_response_field', response.response);
|
||||||
|
} else {
|
||||||
|
options.form.append('g-recaptcha-response', response.response);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
options.form.append('g-recaptcha-response', response.response);
|
for (key in response) {
|
||||||
|
val = response[key];
|
||||||
|
options.form.append(key, val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
QR.req = $.ajax("https://sys." + (location.hostname.split('.')[1]) + ".org/" + g.BOARD + "/post", options);
|
||||||
@ -25031,12 +25135,14 @@ QR = (function() {
|
|||||||
QR.req = {
|
QR.req = {
|
||||||
progress: '...',
|
progress: '...',
|
||||||
abort: function() {
|
abort: function() {
|
||||||
Captcha.cache.abort();
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
Captcha.cache.abort();
|
||||||
|
}
|
||||||
return cb = null;
|
return cb = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
captcha(function(response) {
|
captcha(function(response) {
|
||||||
if (Captcha.cache.haveCookie()) {
|
if (QR.captcha === Captcha.v2 && Captcha.cache.haveCookie()) {
|
||||||
if (typeof cb === "function") {
|
if (typeof cb === "function") {
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
@ -25058,7 +25164,7 @@ QR = (function() {
|
|||||||
return QR.status();
|
return QR.status();
|
||||||
},
|
},
|
||||||
response: function() {
|
response: function() {
|
||||||
var URL, _, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
var URL, _, base, connErr, err, h1, isReply, j, lastPostToThread, len, m, mi, open, post, postID, postsCount, ref, ref1, ref2, ref3, seconds, threadID;
|
||||||
if (this !== QR.req) {
|
if (this !== QR.req) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -25071,12 +25177,17 @@ QR = (function() {
|
|||||||
}
|
}
|
||||||
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
} else if ((connErr = !this.response || this.response.title !== 'Post successful!')) {
|
||||||
err = QR.connectionError();
|
err = QR.connectionError();
|
||||||
if (QR.currentCaptcha) {
|
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||||
Captcha.cache.save(QR.currentCaptcha);
|
Captcha.cache.save(QR.currentCaptcha);
|
||||||
}
|
}
|
||||||
} else if (this.status !== 200) {
|
} else if (this.status !== 200) {
|
||||||
err = "Error " + this.statusText + " (" + this.status + ")";
|
err = "Error " + this.statusText + " (" + this.status + ")";
|
||||||
}
|
}
|
||||||
|
if (!connErr) {
|
||||||
|
if (typeof (base = QR.captcha).setUsed === "function") {
|
||||||
|
base.setUsed();
|
||||||
|
}
|
||||||
|
}
|
||||||
delete QR.currentCaptcha;
|
delete QR.currentCaptcha;
|
||||||
if (err) {
|
if (err) {
|
||||||
QR.errorCount = (QR.errorCount || 0) + 1;
|
QR.errorCount = (QR.errorCount || 0) + 1;
|
||||||
@ -25197,7 +25308,7 @@ QR = (function() {
|
|||||||
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
if ((oldReq = QR.req) && !QR.req.isUploadFinished) {
|
||||||
delete QR.req;
|
delete QR.req;
|
||||||
oldReq.abort();
|
oldReq.abort();
|
||||||
if (QR.currentCaptcha) {
|
if (QR.captcha === Captcha.v2 && QR.currentCaptcha) {
|
||||||
Captcha.cache.save(QR.currentCaptcha);
|
Captcha.cache.save(QR.currentCaptcha);
|
||||||
}
|
}
|
||||||
delete QR.currentCaptcha;
|
delete QR.currentCaptcha;
|
||||||
@ -26003,7 +26114,9 @@ QR = (function() {
|
|||||||
}
|
}
|
||||||
this.nodes.span.textContent = this.com;
|
this.nodes.span.textContent = this.com;
|
||||||
QR.captcha.moreNeeded();
|
QR.captcha.moreNeeded();
|
||||||
return Captcha.cache.prerequest();
|
if (QR.captcha === Captcha.v2) {
|
||||||
|
return Captcha.cache.prerequest();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_Class.prototype.isOnlyQuotes = function() {
|
_Class.prototype.isOnlyQuotes = function() {
|
||||||
|
|||||||
Binary file not shown.
@ -3,7 +3,7 @@
|
|||||||
"4chan-x@4chan-x.net": {
|
"4chan-x@4chan-x.net": {
|
||||||
"updates": [
|
"updates": [
|
||||||
{
|
{
|
||||||
"version": "1.14.21.3",
|
"version": "1.14.21.4",
|
||||||
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
|
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.14.21.3' />
|
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.14.21.4' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
"4chan-x@4chan-x.net": {
|
"4chan-x@4chan-x.net": {
|
||||||
"updates": [
|
"updates": [
|
||||||
{
|
{
|
||||||
"version": "1.14.21.3",
|
"version": "1.14.21.4",
|
||||||
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
|
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
|
||||||
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.14.21.3' />
|
<updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.14.21.4' />
|
||||||
</app>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "1.14.21.3",
|
"version": "1.14.21.4",
|
||||||
"date": "2021-05-07T07:49:08.122Z"
|
"date": "2021-07-05T20:23:27.050Z"
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user