Release 4chan X v1.14.3.0.

This commit is contained in:
ccd0 2018-09-18 04:34:00 -07:00
parent c64b220e06
commit 5b154550a5
15 changed files with 440 additions and 281 deletions

View File

@ -2,6 +2,12 @@
-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). -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.3
**v1.14.3.0** *(2018-09-18)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.3.0/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.3.0/builds/4chan-X-noupdate.crx)]
- Based on v1.14.2.1.
- Fix issues with archives, Link Title, and Github Gist embedding caused by ad blocking changes.
### v1.14.2 ### v1.14.2
**v1.14.2.1** *(2018-06-22)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.2.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.2.1/builds/4chan-X-noupdate.crx)] **v1.14.2.1** *(2018-06-22)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.2.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.2.1/builds/4chan-X-noupdate.crx)]

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.14.2.1 // @version 1.14.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -38,6 +38,24 @@
// @exclude https://www.4chan.org/donate?* // @exclude https://www.4chan.org/donate?*
// @connect 4chan.org // @connect 4chan.org
// @connect 4cdn.org // @connect 4cdn.org
// @connect mayhemydg.github.io
// @connect archive.4plebs.org
// @connect archive.nyafuu.org
// @connect archive.rebeccablacktech.com
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archive.b-stats.org
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect vimeo.com
// @connect www.googleapis.com
// @connect * // @connect *
// @grant GM_getValue // @grant GM_getValue
// @grant GM_setValue // @grant GM_setValue

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X beta // @name 4chan X beta
// @version 1.14.2.1 // @version 1.14.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -38,6 +38,24 @@
// @exclude https://www.4chan.org/donate?* // @exclude https://www.4chan.org/donate?*
// @connect 4chan.org // @connect 4chan.org
// @connect 4cdn.org // @connect 4cdn.org
// @connect mayhemydg.github.io
// @connect archive.4plebs.org
// @connect archive.nyafuu.org
// @connect archive.rebeccablacktech.com
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archive.b-stats.org
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect vimeo.com
// @connect www.googleapis.com
// @connect * // @connect *
// @grant GM_getValue // @grant GM_getValue
// @grant GM_setValue // @grant GM_setValue
@ -157,7 +175,7 @@ docSet = function() {
}; };
g = { g = {
VERSION: '1.14.2.1', VERSION: '1.14.3.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -5361,12 +5379,56 @@ CrossOrigin = (function() {
}); });
}, },
json: (function() { json: (function() {
var callbacks, responses; var callbacks, failure, results, success;
callbacks = {}; callbacks = {};
responses = {}; results = {};
return function(url, cb) { success = function(url, result) {
if (responses[url]) { var cb, j, len, ref;
cb(responses[url]); ref = callbacks[url];
for (j = 0, len = ref.length; j < len; j++) {
cb = ref[j];
$.queueTask(function() {
return cb.call(result);
});
}
delete callbacks[url];
return results[url] = result;
};
failure = function(url) {
var cb, j, len, ref;
ref = callbacks[url];
for (j = 0, len = ref.length; j < len; j++) {
cb = ref[j];
$.queueTask(function() {
return cb.call({});
});
}
return delete callbacks[url];
};
return function(url, cb, bypassCache) {
var req;
if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) {
if (bypassCache) {
$.cleanCache(function(url2) {
return url2 === url;
});
}
if ((req = $.cache(url, cb, {
responseType: 'json'
}))) {
$.on(req, 'abort error', function() {
return cb.call({});
});
} else {
cb.call({});
}
return;
}
if (bypassCache) {
delete results[url];
}
if (results[url]) {
cb.call(results[url]);
return; return;
} }
if (callbacks[url]) { if (callbacks[url]) {
@ -5378,21 +5440,24 @@ CrossOrigin = (function() {
method: "GET", method: "GET",
url: url + '', url: url + '',
onload: function(xhr) { onload: function(xhr) {
var j, len, ref, response; var response, status, statusText;
status = xhr.status, statusText = xhr.statusText;
try {
response = JSON.parse(xhr.responseText); response = JSON.parse(xhr.responseText);
ref = callbacks[url]; return success(url, {
for (j = 0, len = ref.length; j < len; j++) { status: status,
cb = ref[j]; statusText: statusText,
cb(response); response: response
});
} catch (_error) {
return failure(url);
} }
delete callbacks[url];
return responses[url] = response;
}, },
onerror: function() { onerror: function() {
return delete callbacks[url]; return failure(url);
}, },
onabort: function() { onabort: function() {
return delete callbacks[url]; return failure(url);
} }
}); });
}; };
@ -6024,7 +6089,7 @@ Fetcher = (function() {
}; };
Fetcher.prototype.archivedPost = function() { Fetcher.prototype.archivedPost = function() {
var archive, url; var archive, encryptionOK, that, url;
if (!Conf['Resurrect Quotes']) { if (!Conf['Resurrect Quotes']) {
return false; return false;
} }
@ -6035,33 +6100,23 @@ Fetcher = (function() {
return false; return false;
} }
archive = Redirect.data.post[this.boardID]; archive = Redirect.data.post[this.boardID];
if (/^https:\/\//.test(url) || location.protocol === 'http:') { encryptionOK = /^https:\/\//.test(url) || location.protocol === 'http:';
$.cache(url, (function(_this) { if (encryptionOK || Conf['Exempt Archives from Encryption']) {
return function(e) { that = this;
return _this.parseArchivedPost(e.target.response, url, archive); CrossOrigin.json(url, function() {
}; var key, media, ref, ref1;
})(this), { if (!encryptionOK && ((ref = this.response) != null ? ref.media : void 0)) {
responseType: 'json', media = this.response.media;
withCredentials: archive.withCredentials
});
return true;
} else if (Conf['Exempt Archives from Encryption']) {
CrossOrigin.json(url, (function(_this) {
return function(response) {
var key, media, ref;
media = response.media;
if (media) {
for (key in media) { for (key in media) {
if (/_link$/.test(key)) { if (/_link$/.test(key)) {
if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) { if (!((ref1 = media[key]) != null ? ref1.match(/^http:\/\//) : void 0)) {
delete media[key]; delete media[key];
} }
} }
} }
} }
return _this.parseArchivedPost(response, url, archive); return that.parseArchivedPost(this.response, url, archive);
}; });
})(this));
return true; return true;
} }
return false; return false;
@ -7568,7 +7623,7 @@ Redirect = (function() {
return Redirect.data = o; return Redirect.data = o;
}, },
update: function(cb) { update: function(cb) {
var i, j, k, len, len1, load, nloaded, ref, ref1, responses, url, urls; var err, fail, i, j, k, len, len1, load, nloaded, ref, ref1, response, responses, url, urls;
urls = []; urls = [];
responses = []; responses = [];
nloaded = 0; nloaded = 0;
@ -7583,21 +7638,16 @@ Redirect = (function() {
urls.push(url); urls.push(url);
} }
} }
fail = function(url, action, msg) {
return new Notice('warning', "Error " + action + " archive data from\n" + url + "\n" + msg, 20);
};
load = function(i) { load = function(i) {
return function() { return function() {
var err, fail, response; var response;
fail = function(action, msg) {
return new Notice('warning', "Error " + action + " archive data from\n" + urls[i] + "\n" + msg, 20);
};
if (this.status !== 200) { if (this.status !== 200) {
return fail('fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error')); return fail(urls[i], 'fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'));
}
try {
response = JSON.parse(this.response);
} catch (_error) {
err = _error;
return fail('parsing', err.message);
} }
response = this.response;
if (!(response instanceof Array)) { if (!(response instanceof Array)) {
response = [response]; response = [response];
} }
@ -7612,15 +7662,19 @@ Redirect = (function() {
for (i = k = 0, len1 = urls.length; k < len1; i = ++k) { for (i = k = 0, len1 = urls.length; k < len1; i = ++k) {
url = urls[i]; url = urls[i];
if ((ref1 = url[0]) === '[' || ref1 === '{') { if ((ref1 = url[0]) === '[' || ref1 === '{') {
try {
response = JSON.parse(url);
} catch (_error) {
err = _error;
fail(url, 'parsing', err.message);
continue;
}
load(i).call({ load(i).call({
status: 200, status: 200,
response: url response: response
}); });
} else { } else {
$.ajax(url, { CrossOrigin.json(url, load(i), true);
responseType: 'text',
onloadend: load(i)
});
} }
} }
} else { } else {
@ -15022,19 +15076,13 @@ Embedding = (function() {
return Embedding.flushTitles(service); return Embedding.flushTitles(service);
} }
} else { } else {
if (!$.cache(service.api(uid), (function() { return CrossOrigin.json(service.api(uid), (function() {
return Embedding.cb.title(this, data); return Embedding.cb.title(this, data);
}), { }));
responseType: 'json'
})) {
return $.extend(link, {
innerHTML: "[" + E(key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
});
}
} }
}, },
flushTitles: function(service) { flushTitles: function(service) {
var cb, data, j, len, queue; var cb, data, queue;
queue = service.queue; queue = service.queue;
if (!(queue != null ? queue.length : void 0)) { if (!(queue != null ? queue.length : void 0)) {
return; return;
@ -15047,7 +15095,7 @@ Embedding = (function() {
Embedding.cb.title(this, data); Embedding.cb.title(this, data);
} }
}; };
if (!$.cache(service.api((function() { return CrossOrigin.json(service.api((function() {
var j, len, results; var j, len, results;
results = []; results = [];
for (j = 0, len = queue.length; j < len; j++) { for (j = 0, len = queue.length; j < len; j++) {
@ -15055,16 +15103,7 @@ Embedding = (function() {
results.push(data.uid); results.push(data.uid);
} }
return results; return results;
})()), cb, { })()), cb);
responseType: 'json'
})) {
for (j = 0, len = queue.length; j < len; j++) {
data = queue[j];
$.extend(data.link, {
innerHTML: "[" + E(data.key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
});
}
}
}, },
preview: function(data) { preview: function(data) {
var key, link, service, uid; var key, link, service, uid;
@ -15132,6 +15171,9 @@ Embedding = (function() {
}, },
title: function(req, data) { title: function(req, data) {
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid; var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
if (!req.status) {
return;
}
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
status = req.status; status = req.status;
service = Embedding.types[key].title; service = Embedding.types[key].title;
@ -15275,9 +15317,7 @@ Embedding = (function() {
hidden: true, hidden: true,
id: "gist-embed-" + (counter++) id: "gist-embed-" + (counter++)
}); });
$.ajax("https://api.github.com/gists/" + a.dataset.uid, { CrossOrigin.json("https://api.github.com/gists/" + a.dataset.uid, function() {
responseType: 'json',
onload: function() {
el.textContent = Object.values(this.response.files)[0].content; el.textContent = Object.values(this.response.files)[0].content;
el.className = 'prettyprint'; el.className = 'prettyprint';
$.global(function() { $.global(function() {
@ -15286,7 +15326,6 @@ Embedding = (function() {
id: el.id id: el.id
}); });
return el.hidden = false; return el.hidden = false;
}
}); });
return el; return el;
}; };

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.14.2.1 // @version 1.14.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -38,6 +38,24 @@
// @exclude https://www.4chan.org/donate?* // @exclude https://www.4chan.org/donate?*
// @connect 4chan.org // @connect 4chan.org
// @connect 4cdn.org // @connect 4cdn.org
// @connect mayhemydg.github.io
// @connect archive.4plebs.org
// @connect archive.nyafuu.org
// @connect archive.rebeccablacktech.com
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archive.b-stats.org
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect vimeo.com
// @connect www.googleapis.com
// @connect * // @connect *
// @grant GM_getValue // @grant GM_getValue
// @grant GM_setValue // @grant GM_setValue
@ -157,7 +175,7 @@ docSet = function() {
}; };
g = { g = {
VERSION: '1.14.2.1', VERSION: '1.14.3.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -5361,12 +5379,56 @@ CrossOrigin = (function() {
}); });
}, },
json: (function() { json: (function() {
var callbacks, responses; var callbacks, failure, results, success;
callbacks = {}; callbacks = {};
responses = {}; results = {};
return function(url, cb) { success = function(url, result) {
if (responses[url]) { var cb, j, len, ref;
cb(responses[url]); ref = callbacks[url];
for (j = 0, len = ref.length; j < len; j++) {
cb = ref[j];
$.queueTask(function() {
return cb.call(result);
});
}
delete callbacks[url];
return results[url] = result;
};
failure = function(url) {
var cb, j, len, ref;
ref = callbacks[url];
for (j = 0, len = ref.length; j < len; j++) {
cb = ref[j];
$.queueTask(function() {
return cb.call({});
});
}
return delete callbacks[url];
};
return function(url, cb, bypassCache) {
var req;
if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) {
if (bypassCache) {
$.cleanCache(function(url2) {
return url2 === url;
});
}
if ((req = $.cache(url, cb, {
responseType: 'json'
}))) {
$.on(req, 'abort error', function() {
return cb.call({});
});
} else {
cb.call({});
}
return;
}
if (bypassCache) {
delete results[url];
}
if (results[url]) {
cb.call(results[url]);
return; return;
} }
if (callbacks[url]) { if (callbacks[url]) {
@ -5378,21 +5440,24 @@ CrossOrigin = (function() {
method: "GET", method: "GET",
url: url + '', url: url + '',
onload: function(xhr) { onload: function(xhr) {
var j, len, ref, response; var response, status, statusText;
status = xhr.status, statusText = xhr.statusText;
try {
response = JSON.parse(xhr.responseText); response = JSON.parse(xhr.responseText);
ref = callbacks[url]; return success(url, {
for (j = 0, len = ref.length; j < len; j++) { status: status,
cb = ref[j]; statusText: statusText,
cb(response); response: response
});
} catch (_error) {
return failure(url);
} }
delete callbacks[url];
return responses[url] = response;
}, },
onerror: function() { onerror: function() {
return delete callbacks[url]; return failure(url);
}, },
onabort: function() { onabort: function() {
return delete callbacks[url]; return failure(url);
} }
}); });
}; };
@ -6024,7 +6089,7 @@ Fetcher = (function() {
}; };
Fetcher.prototype.archivedPost = function() { Fetcher.prototype.archivedPost = function() {
var archive, url; var archive, encryptionOK, that, url;
if (!Conf['Resurrect Quotes']) { if (!Conf['Resurrect Quotes']) {
return false; return false;
} }
@ -6035,33 +6100,23 @@ Fetcher = (function() {
return false; return false;
} }
archive = Redirect.data.post[this.boardID]; archive = Redirect.data.post[this.boardID];
if (/^https:\/\//.test(url) || location.protocol === 'http:') { encryptionOK = /^https:\/\//.test(url) || location.protocol === 'http:';
$.cache(url, (function(_this) { if (encryptionOK || Conf['Exempt Archives from Encryption']) {
return function(e) { that = this;
return _this.parseArchivedPost(e.target.response, url, archive); CrossOrigin.json(url, function() {
}; var key, media, ref, ref1;
})(this), { if (!encryptionOK && ((ref = this.response) != null ? ref.media : void 0)) {
responseType: 'json', media = this.response.media;
withCredentials: archive.withCredentials
});
return true;
} else if (Conf['Exempt Archives from Encryption']) {
CrossOrigin.json(url, (function(_this) {
return function(response) {
var key, media, ref;
media = response.media;
if (media) {
for (key in media) { for (key in media) {
if (/_link$/.test(key)) { if (/_link$/.test(key)) {
if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) { if (!((ref1 = media[key]) != null ? ref1.match(/^http:\/\//) : void 0)) {
delete media[key]; delete media[key];
} }
} }
} }
} }
return _this.parseArchivedPost(response, url, archive); return that.parseArchivedPost(this.response, url, archive);
}; });
})(this));
return true; return true;
} }
return false; return false;
@ -7568,7 +7623,7 @@ Redirect = (function() {
return Redirect.data = o; return Redirect.data = o;
}, },
update: function(cb) { update: function(cb) {
var i, j, k, len, len1, load, nloaded, ref, ref1, responses, url, urls; var err, fail, i, j, k, len, len1, load, nloaded, ref, ref1, response, responses, url, urls;
urls = []; urls = [];
responses = []; responses = [];
nloaded = 0; nloaded = 0;
@ -7583,21 +7638,16 @@ Redirect = (function() {
urls.push(url); urls.push(url);
} }
} }
fail = function(url, action, msg) {
return new Notice('warning', "Error " + action + " archive data from\n" + url + "\n" + msg, 20);
};
load = function(i) { load = function(i) {
return function() { return function() {
var err, fail, response; var response;
fail = function(action, msg) {
return new Notice('warning', "Error " + action + " archive data from\n" + urls[i] + "\n" + msg, 20);
};
if (this.status !== 200) { if (this.status !== 200) {
return fail('fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error')); return fail(urls[i], 'fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'));
}
try {
response = JSON.parse(this.response);
} catch (_error) {
err = _error;
return fail('parsing', err.message);
} }
response = this.response;
if (!(response instanceof Array)) { if (!(response instanceof Array)) {
response = [response]; response = [response];
} }
@ -7612,15 +7662,19 @@ Redirect = (function() {
for (i = k = 0, len1 = urls.length; k < len1; i = ++k) { for (i = k = 0, len1 = urls.length; k < len1; i = ++k) {
url = urls[i]; url = urls[i];
if ((ref1 = url[0]) === '[' || ref1 === '{') { if ((ref1 = url[0]) === '[' || ref1 === '{') {
try {
response = JSON.parse(url);
} catch (_error) {
err = _error;
fail(url, 'parsing', err.message);
continue;
}
load(i).call({ load(i).call({
status: 200, status: 200,
response: url response: response
}); });
} else { } else {
$.ajax(url, { CrossOrigin.json(url, load(i), true);
responseType: 'text',
onloadend: load(i)
});
} }
} }
} else { } else {
@ -15022,19 +15076,13 @@ Embedding = (function() {
return Embedding.flushTitles(service); return Embedding.flushTitles(service);
} }
} else { } else {
if (!$.cache(service.api(uid), (function() { return CrossOrigin.json(service.api(uid), (function() {
return Embedding.cb.title(this, data); return Embedding.cb.title(this, data);
}), { }));
responseType: 'json'
})) {
return $.extend(link, {
innerHTML: "[" + E(key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
});
}
} }
}, },
flushTitles: function(service) { flushTitles: function(service) {
var cb, data, j, len, queue; var cb, data, queue;
queue = service.queue; queue = service.queue;
if (!(queue != null ? queue.length : void 0)) { if (!(queue != null ? queue.length : void 0)) {
return; return;
@ -15047,7 +15095,7 @@ Embedding = (function() {
Embedding.cb.title(this, data); Embedding.cb.title(this, data);
} }
}; };
if (!$.cache(service.api((function() { return CrossOrigin.json(service.api((function() {
var j, len, results; var j, len, results;
results = []; results = [];
for (j = 0, len = queue.length; j < len; j++) { for (j = 0, len = queue.length; j < len; j++) {
@ -15055,16 +15103,7 @@ Embedding = (function() {
results.push(data.uid); results.push(data.uid);
} }
return results; return results;
})()), cb, { })()), cb);
responseType: 'json'
})) {
for (j = 0, len = queue.length; j < len; j++) {
data = queue[j];
$.extend(data.link, {
innerHTML: "[" + E(data.key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
});
}
}
}, },
preview: function(data) { preview: function(data) {
var key, link, service, uid; var key, link, service, uid;
@ -15132,6 +15171,9 @@ Embedding = (function() {
}, },
title: function(req, data) { title: function(req, data) {
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid; var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
if (!req.status) {
return;
}
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
status = req.status; status = req.status;
service = Embedding.types[key].title; service = Embedding.types[key].title;
@ -15275,9 +15317,7 @@ Embedding = (function() {
hidden: true, hidden: true,
id: "gist-embed-" + (counter++) id: "gist-embed-" + (counter++)
}); });
$.ajax("https://api.github.com/gists/" + a.dataset.uid, { CrossOrigin.json("https://api.github.com/gists/" + a.dataset.uid, function() {
responseType: 'json',
onload: function() {
el.textContent = Object.values(this.response.files)[0].content; el.textContent = Object.values(this.response.files)[0].content;
el.className = 'prettyprint'; el.className = 'prettyprint';
$.global(function() { $.global(function() {
@ -15286,7 +15326,6 @@ Embedding = (function() {
id: el.id id: el.id
}); });
return el.hidden = false; return el.hidden = false;
}
}); });
return el; return el;
}; };

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.14.2.1 // @version 1.14.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -38,6 +38,24 @@
// @exclude https://www.4chan.org/donate?* // @exclude https://www.4chan.org/donate?*
// @connect 4chan.org // @connect 4chan.org
// @connect 4cdn.org // @connect 4cdn.org
// @connect mayhemydg.github.io
// @connect archive.4plebs.org
// @connect archive.nyafuu.org
// @connect archive.rebeccablacktech.com
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archive.b-stats.org
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect vimeo.com
// @connect www.googleapis.com
// @connect * // @connect *
// @grant GM_getValue // @grant GM_getValue
// @grant GM_setValue // @grant GM_setValue

View File

@ -1,6 +1,6 @@
// ==UserScript== // ==UserScript==
// @name 4chan X // @name 4chan X
// @version 1.14.2.1 // @version 1.14.3.0
// @minGMVer 1.14 // @minGMVer 1.14
// @minFFVer 26 // @minFFVer 26
// @namespace 4chan-X // @namespace 4chan-X
@ -38,6 +38,24 @@
// @exclude https://www.4chan.org/donate?* // @exclude https://www.4chan.org/donate?*
// @connect 4chan.org // @connect 4chan.org
// @connect 4cdn.org // @connect 4cdn.org
// @connect mayhemydg.github.io
// @connect archive.4plebs.org
// @connect archive.nyafuu.org
// @connect archive.rebeccablacktech.com
// @connect warosu.org
// @connect desuarchive.org
// @connect boards.fireden.net
// @connect arch.b4k.co
// @connect archive.b-stats.org
// @connect archived.moe
// @connect thebarchive.com
// @connect archiveofsins.com
// @connect api.clyp.it
// @connect api.dailymotion.com
// @connect api.github.com
// @connect soundcloud.com
// @connect vimeo.com
// @connect www.googleapis.com
// @connect * // @connect *
// @grant GM_getValue // @grant GM_getValue
// @grant GM_setValue // @grant GM_setValue
@ -157,7 +175,7 @@ docSet = function() {
}; };
g = { g = {
VERSION: '1.14.2.1', VERSION: '1.14.3.0',
NAMESPACE: '4chan X.', NAMESPACE: '4chan X.',
boards: {} boards: {}
}; };
@ -5361,12 +5379,56 @@ CrossOrigin = (function() {
}); });
}, },
json: (function() { json: (function() {
var callbacks, responses; var callbacks, failure, results, success;
callbacks = {}; callbacks = {};
responses = {}; results = {};
return function(url, cb) { success = function(url, result) {
if (responses[url]) { var cb, j, len, ref;
cb(responses[url]); ref = callbacks[url];
for (j = 0, len = ref.length; j < len; j++) {
cb = ref[j];
$.queueTask(function() {
return cb.call(result);
});
}
delete callbacks[url];
return results[url] = result;
};
failure = function(url) {
var cb, j, len, ref;
ref = callbacks[url];
for (j = 0, len = ref.length; j < len; j++) {
cb = ref[j];
$.queueTask(function() {
return cb.call({});
});
}
return delete callbacks[url];
};
return function(url, cb, bypassCache) {
var req;
if (!(((typeof GM !== "undefined" && GM !== null ? GM.xmlHttpRequest : void 0) != null) || (typeof GM_xmlhttpRequest !== "undefined" && GM_xmlhttpRequest !== null))) {
if (bypassCache) {
$.cleanCache(function(url2) {
return url2 === url;
});
}
if ((req = $.cache(url, cb, {
responseType: 'json'
}))) {
$.on(req, 'abort error', function() {
return cb.call({});
});
} else {
cb.call({});
}
return;
}
if (bypassCache) {
delete results[url];
}
if (results[url]) {
cb.call(results[url]);
return; return;
} }
if (callbacks[url]) { if (callbacks[url]) {
@ -5378,21 +5440,24 @@ CrossOrigin = (function() {
method: "GET", method: "GET",
url: url + '', url: url + '',
onload: function(xhr) { onload: function(xhr) {
var j, len, ref, response; var response, status, statusText;
status = xhr.status, statusText = xhr.statusText;
try {
response = JSON.parse(xhr.responseText); response = JSON.parse(xhr.responseText);
ref = callbacks[url]; return success(url, {
for (j = 0, len = ref.length; j < len; j++) { status: status,
cb = ref[j]; statusText: statusText,
cb(response); response: response
});
} catch (_error) {
return failure(url);
} }
delete callbacks[url];
return responses[url] = response;
}, },
onerror: function() { onerror: function() {
return delete callbacks[url]; return failure(url);
}, },
onabort: function() { onabort: function() {
return delete callbacks[url]; return failure(url);
} }
}); });
}; };
@ -6024,7 +6089,7 @@ Fetcher = (function() {
}; };
Fetcher.prototype.archivedPost = function() { Fetcher.prototype.archivedPost = function() {
var archive, url; var archive, encryptionOK, that, url;
if (!Conf['Resurrect Quotes']) { if (!Conf['Resurrect Quotes']) {
return false; return false;
} }
@ -6035,33 +6100,23 @@ Fetcher = (function() {
return false; return false;
} }
archive = Redirect.data.post[this.boardID]; archive = Redirect.data.post[this.boardID];
if (/^https:\/\//.test(url) || location.protocol === 'http:') { encryptionOK = /^https:\/\//.test(url) || location.protocol === 'http:';
$.cache(url, (function(_this) { if (encryptionOK || Conf['Exempt Archives from Encryption']) {
return function(e) { that = this;
return _this.parseArchivedPost(e.target.response, url, archive); CrossOrigin.json(url, function() {
}; var key, media, ref, ref1;
})(this), { if (!encryptionOK && ((ref = this.response) != null ? ref.media : void 0)) {
responseType: 'json', media = this.response.media;
withCredentials: archive.withCredentials
});
return true;
} else if (Conf['Exempt Archives from Encryption']) {
CrossOrigin.json(url, (function(_this) {
return function(response) {
var key, media, ref;
media = response.media;
if (media) {
for (key in media) { for (key in media) {
if (/_link$/.test(key)) { if (/_link$/.test(key)) {
if (!((ref = media[key]) != null ? ref.match(/^http:\/\//) : void 0)) { if (!((ref1 = media[key]) != null ? ref1.match(/^http:\/\//) : void 0)) {
delete media[key]; delete media[key];
} }
} }
} }
} }
return _this.parseArchivedPost(response, url, archive); return that.parseArchivedPost(this.response, url, archive);
}; });
})(this));
return true; return true;
} }
return false; return false;
@ -7568,7 +7623,7 @@ Redirect = (function() {
return Redirect.data = o; return Redirect.data = o;
}, },
update: function(cb) { update: function(cb) {
var i, j, k, len, len1, load, nloaded, ref, ref1, responses, url, urls; var err, fail, i, j, k, len, len1, load, nloaded, ref, ref1, response, responses, url, urls;
urls = []; urls = [];
responses = []; responses = [];
nloaded = 0; nloaded = 0;
@ -7583,21 +7638,16 @@ Redirect = (function() {
urls.push(url); urls.push(url);
} }
} }
fail = function(url, action, msg) {
return new Notice('warning', "Error " + action + " archive data from\n" + url + "\n" + msg, 20);
};
load = function(i) { load = function(i) {
return function() { return function() {
var err, fail, response; var response;
fail = function(action, msg) {
return new Notice('warning', "Error " + action + " archive data from\n" + urls[i] + "\n" + msg, 20);
};
if (this.status !== 200) { if (this.status !== 200) {
return fail('fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error')); return fail(urls[i], 'fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'));
}
try {
response = JSON.parse(this.response);
} catch (_error) {
err = _error;
return fail('parsing', err.message);
} }
response = this.response;
if (!(response instanceof Array)) { if (!(response instanceof Array)) {
response = [response]; response = [response];
} }
@ -7612,15 +7662,19 @@ Redirect = (function() {
for (i = k = 0, len1 = urls.length; k < len1; i = ++k) { for (i = k = 0, len1 = urls.length; k < len1; i = ++k) {
url = urls[i]; url = urls[i];
if ((ref1 = url[0]) === '[' || ref1 === '{') { if ((ref1 = url[0]) === '[' || ref1 === '{') {
try {
response = JSON.parse(url);
} catch (_error) {
err = _error;
fail(url, 'parsing', err.message);
continue;
}
load(i).call({ load(i).call({
status: 200, status: 200,
response: url response: response
}); });
} else { } else {
$.ajax(url, { CrossOrigin.json(url, load(i), true);
responseType: 'text',
onloadend: load(i)
});
} }
} }
} else { } else {
@ -15022,19 +15076,13 @@ Embedding = (function() {
return Embedding.flushTitles(service); return Embedding.flushTitles(service);
} }
} else { } else {
if (!$.cache(service.api(uid), (function() { return CrossOrigin.json(service.api(uid), (function() {
return Embedding.cb.title(this, data); return Embedding.cb.title(this, data);
}), { }));
responseType: 'json'
})) {
return $.extend(link, {
innerHTML: "[" + E(key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
});
}
} }
}, },
flushTitles: function(service) { flushTitles: function(service) {
var cb, data, j, len, queue; var cb, data, queue;
queue = service.queue; queue = service.queue;
if (!(queue != null ? queue.length : void 0)) { if (!(queue != null ? queue.length : void 0)) {
return; return;
@ -15047,7 +15095,7 @@ Embedding = (function() {
Embedding.cb.title(this, data); Embedding.cb.title(this, data);
} }
}; };
if (!$.cache(service.api((function() { return CrossOrigin.json(service.api((function() {
var j, len, results; var j, len, results;
results = []; results = [];
for (j = 0, len = queue.length; j < len; j++) { for (j = 0, len = queue.length; j < len; j++) {
@ -15055,16 +15103,7 @@ Embedding = (function() {
results.push(data.uid); results.push(data.uid);
} }
return results; return results;
})()), cb, { })()), cb);
responseType: 'json'
})) {
for (j = 0, len = queue.length; j < len; j++) {
data = queue[j];
$.extend(data.link, {
innerHTML: "[" + E(data.key) + "] <span class=\"warning\">Title Link Blocked</span> (are you using NoScript?)</a>"
});
}
}
}, },
preview: function(data) { preview: function(data) {
var key, link, service, uid; var key, link, service, uid;
@ -15132,6 +15171,9 @@ Embedding = (function() {
}, },
title: function(req, data) { title: function(req, data) {
var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid; var base1, j, k, key, len, len1, link, link2, options, post, post2, ref, ref1, service, status, text, uid;
if (!req.status) {
return;
}
key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post; key = data.key, uid = data.uid, options = data.options, link = data.link, post = data.post;
status = req.status; status = req.status;
service = Embedding.types[key].title; service = Embedding.types[key].title;
@ -15275,9 +15317,7 @@ Embedding = (function() {
hidden: true, hidden: true,
id: "gist-embed-" + (counter++) id: "gist-embed-" + (counter++)
}); });
$.ajax("https://api.github.com/gists/" + a.dataset.uid, { CrossOrigin.json("https://api.github.com/gists/" + a.dataset.uid, function() {
responseType: 'json',
onload: function() {
el.textContent = Object.values(this.response.files)[0].content; el.textContent = Object.values(this.response.files)[0].content;
el.className = 'prettyprint'; el.className = 'prettyprint';
$.global(function() { $.global(function() {
@ -15286,7 +15326,6 @@ Embedding = (function() {
id: el.id id: el.id
}); });
return el.hidden = false; return el.hidden = false;
}
}); });
return el; return el;
}; };

Binary file not shown.

View File

@ -3,7 +3,7 @@
"4chan-x@4chan-x.net": { "4chan-x@4chan-x.net": {
"updates": [ "updates": [
{ {
"version": "1.14.2.1", "version": "1.14.3.0",
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx" "update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
} }
] ]

View File

@ -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.2.1' /> <updatecheck codebase='https://www.4chan-x.net/builds/4chan-X-beta.crx' version='1.14.3.0' />
</app> </app>
</gupdate> </gupdate>

View File

@ -3,7 +3,7 @@
"4chan-x@4chan-x.net": { "4chan-x@4chan-x.net": {
"updates": [ "updates": [
{ {
"version": "1.14.2.1", "version": "1.14.3.0",
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx" "update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
} }
] ]

View File

@ -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.2.1' /> <updatecheck codebase='https://www.4chan-x.net/builds/4chan-X.crx' version='1.14.3.0' />
</app> </app>
</gupdate> </gupdate>

View File

@ -1,4 +1,4 @@
{ {
"version": "1.14.2.1", "version": "1.14.3.0",
"date": "2018-06-22T06:12:54.498Z" "date": "2018-09-18T11:28:33.974Z"
} }