diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee24fa0e8..7b0c1eb79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor
### v1.11.34
+**v1.11.34.3** *(2016-05-18)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.34.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.34.3/builds/4chan-X-noupdate.crx "Chromium version")]
+- Improve handling of errors due to interaction of 4chan X with ad blockers and NoScript.
+
**v1.11.34.2** *(2016-05-17)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.34.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.34.2/builds/4chan-X-noupdate.crx "Chromium version")]
- Approximately sync replaced WebM thumbnails with hover preview.
- Change default archive list update URL to https://mayhemydg.github.io/archives.json/archives.json.
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index 7645da3f3..d2bcae1b1 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 57cf9cce1..1f1921a42 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.11.34.2
+// @version 1.11.34.3
// @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 f29467f6b..b04b3696e 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.11.34.2
+// @version 1.11.34.3
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -134,7 +134,7 @@ docSet = function() {
};
g = {
- VERSION: '1.11.34.2',
+ VERSION: '1.11.34.3',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -3938,23 +3938,8 @@ $ = (function() {
};
$.ajax = (function() {
- var blockedError, blockedURLs, lastModified;
+ var lastModified;
lastModified = {};
- blockedURLs = {};
- blockedError = function(url) {
- var message;
- if (blockedURLs[url]) {
- return;
- }
- blockedURLs[url] = true;
- message = $.el('div', {
- innerHTML: "4chan X was blocked from loading the following URL:
[More info]"
- });
- $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
- return new Notice('warning', message, 30, function() {
- return delete blockedURLs[url];
- });
- };
return function(url, options, extra) {
var err, event, form, i, len, r, ref, ref1, type, upCallbacks, whenModified;
if (options == null) {
@@ -3969,42 +3954,48 @@ $ = (function() {
type || (type = form && 'post' || 'get');
try {
r.open(type, url, true);
+ if (whenModified) {
+ if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) {
+ r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
+ }
+ $.on(r, 'load', function() {
+ return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
+ });
+ }
+ if (/\.json$/.test(url)) {
+ if (options.responseType == null) {
+ options.responseType = 'json';
+ }
+ }
+ $.extend(r, options);
+ if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
+ Object.defineProperty(r, 'response', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return JSON.parse(r.responseText);
+ }
+ });
+ }
+ $.extend(r.upload, upCallbacks);
+ $.on(r, 'error', function() {
+ if (!r.status) {
+ return c.error("4chan X failed to load: " + url);
+ }
+ });
+ r.send(form);
} catch (_error) {
err = _error;
- blockedError(url);
- ref = ['error', 'loadend'];
- for (i = 0, len = ref.length; i < len; i++) {
- event = ref[i];
+ if (err.result !== 0x805e0006) {
+ throw err;
+ }
+ ref1 = ['error', 'loadend'];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ event = ref1[i];
r["on" + event] = options["on" + event];
$.queueTask($.event, event, null, r);
}
- return;
}
- if (whenModified) {
- if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
- r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
- }
- $.on(r, 'load', function() {
- return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
- });
- }
- if (/\.json$/.test(url)) {
- if (options.responseType == null) {
- options.responseType = 'json';
- }
- }
- $.extend(r, options);
- if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
- Object.defineProperty(r, 'response', {
- configurable: true,
- enumerable: true,
- get: function() {
- return JSON.parse(r.responseText);
- }
- });
- }
- $.extend(r.upload, upCallbacks);
- r.send(form);
return r;
};
})();
@@ -6362,10 +6353,10 @@ Redirect = (function() {
return function() {
var err, fail, response;
fail = function(action, msg) {
- return new Notice('warning', "Error " + action + " archive data from " + urls[i] + "\n" + msg, 20);
+ return new Notice('warning', "Error " + action + " archive data from\n" + urls[i] + "\n" + msg, 20);
};
if (this.status !== 200) {
- return fail('fetching', (this.status ? this.status + " " + this.statusText : 'Connection Error'));
+ return fail('fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'));
}
try {
response = JSON.parse(this.response);
@@ -9271,7 +9262,7 @@ Index = (function() {
return;
}
if ((ref = req.status) !== 200 && ref !== 304) {
- err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
+ err = "Index refresh failed. " + (req.status ? "Error " + req.statusText + " (" + req.status + ")" : 'Connection Error');
if (notice) {
notice.setType('warning');
notice.el.lastElementChild.textContent = err;
@@ -17096,7 +17087,7 @@ ThreadUpdater = (function() {
}
ThreadUpdater.setInterval();
if (!req.status) {
- return ThreadUpdater.set('status', 'Connection Failed', 'warning');
+ return ThreadUpdater.set('status', 'Connection Error', 'warning');
} else if (req.status !== 304) {
return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
}
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 6b621c08c..1e1a09a7d 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 69e1d6883..725c884f8 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.11.34.2
+// @version 1.11.34.3
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -134,7 +134,7 @@ docSet = function() {
};
g = {
- VERSION: '1.11.34.2',
+ VERSION: '1.11.34.3',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -3938,23 +3938,8 @@ $ = (function() {
};
$.ajax = (function() {
- var blockedError, blockedURLs, lastModified;
+ var lastModified;
lastModified = {};
- blockedURLs = {};
- blockedError = function(url) {
- var message;
- if (blockedURLs[url]) {
- return;
- }
- blockedURLs[url] = true;
- message = $.el('div', {
- innerHTML: "4chan X was blocked from loading the following URL:
[More info]"
- });
- $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
- return new Notice('warning', message, 30, function() {
- return delete blockedURLs[url];
- });
- };
return function(url, options, extra) {
var err, event, form, i, len, r, ref, ref1, type, upCallbacks, whenModified;
if (options == null) {
@@ -3969,42 +3954,48 @@ $ = (function() {
type || (type = form && 'post' || 'get');
try {
r.open(type, url, true);
+ if (whenModified) {
+ if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) {
+ r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
+ }
+ $.on(r, 'load', function() {
+ return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
+ });
+ }
+ if (/\.json$/.test(url)) {
+ if (options.responseType == null) {
+ options.responseType = 'json';
+ }
+ }
+ $.extend(r, options);
+ if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
+ Object.defineProperty(r, 'response', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return JSON.parse(r.responseText);
+ }
+ });
+ }
+ $.extend(r.upload, upCallbacks);
+ $.on(r, 'error', function() {
+ if (!r.status) {
+ return c.error("4chan X failed to load: " + url);
+ }
+ });
+ r.send(form);
} catch (_error) {
err = _error;
- blockedError(url);
- ref = ['error', 'loadend'];
- for (i = 0, len = ref.length; i < len; i++) {
- event = ref[i];
+ if (err.result !== 0x805e0006) {
+ throw err;
+ }
+ ref1 = ['error', 'loadend'];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ event = ref1[i];
r["on" + event] = options["on" + event];
$.queueTask($.event, event, null, r);
}
- return;
}
- if (whenModified) {
- if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
- r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
- }
- $.on(r, 'load', function() {
- return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
- });
- }
- if (/\.json$/.test(url)) {
- if (options.responseType == null) {
- options.responseType = 'json';
- }
- }
- $.extend(r, options);
- if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
- Object.defineProperty(r, 'response', {
- configurable: true,
- enumerable: true,
- get: function() {
- return JSON.parse(r.responseText);
- }
- });
- }
- $.extend(r.upload, upCallbacks);
- r.send(form);
return r;
};
})();
@@ -6362,10 +6353,10 @@ Redirect = (function() {
return function() {
var err, fail, response;
fail = function(action, msg) {
- return new Notice('warning', "Error " + action + " archive data from " + urls[i] + "\n" + msg, 20);
+ return new Notice('warning', "Error " + action + " archive data from\n" + urls[i] + "\n" + msg, 20);
};
if (this.status !== 200) {
- return fail('fetching', (this.status ? this.status + " " + this.statusText : 'Connection Error'));
+ return fail('fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'));
}
try {
response = JSON.parse(this.response);
@@ -9271,7 +9262,7 @@ Index = (function() {
return;
}
if ((ref = req.status) !== 200 && ref !== 304) {
- err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
+ err = "Index refresh failed. " + (req.status ? "Error " + req.statusText + " (" + req.status + ")" : 'Connection Error');
if (notice) {
notice.setType('warning');
notice.el.lastElementChild.textContent = err;
@@ -17096,7 +17087,7 @@ ThreadUpdater = (function() {
}
ThreadUpdater.setInterval();
if (!req.status) {
- return ThreadUpdater.set('status', 'Connection Failed', 'warning');
+ return ThreadUpdater.set('status', 'Connection Error', 'warning');
} else if (req.status !== 304) {
return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
}
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index e1aba8cd4..b7f548e10 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 3cbd41a16..62dcf7d53 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.11.34.2
+// @version 1.11.34.3
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 35b9550c6..c545d285f 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.11.34.2
+// @version 1.11.34.3
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -134,7 +134,7 @@ docSet = function() {
};
g = {
- VERSION: '1.11.34.2',
+ VERSION: '1.11.34.3',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -3938,23 +3938,8 @@ $ = (function() {
};
$.ajax = (function() {
- var blockedError, blockedURLs, lastModified;
+ var lastModified;
lastModified = {};
- blockedURLs = {};
- blockedError = function(url) {
- var message;
- if (blockedURLs[url]) {
- return;
- }
- blockedURLs[url] = true;
- message = $.el('div', {
- innerHTML: "4chan X was blocked from loading the following URL:
[More info]"
- });
- $('span', message).textContent = (/^\/\//.test(url) ? location.protocol : '') + url;
- return new Notice('warning', message, 30, function() {
- return delete blockedURLs[url];
- });
- };
return function(url, options, extra) {
var err, event, form, i, len, r, ref, ref1, type, upCallbacks, whenModified;
if (options == null) {
@@ -3969,42 +3954,48 @@ $ = (function() {
type || (type = form && 'post' || 'get');
try {
r.open(type, url, true);
+ if (whenModified) {
+ if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) {
+ r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
+ }
+ $.on(r, 'load', function() {
+ return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
+ });
+ }
+ if (/\.json$/.test(url)) {
+ if (options.responseType == null) {
+ options.responseType = 'json';
+ }
+ }
+ $.extend(r, options);
+ if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
+ Object.defineProperty(r, 'response', {
+ configurable: true,
+ enumerable: true,
+ get: function() {
+ return JSON.parse(r.responseText);
+ }
+ });
+ }
+ $.extend(r.upload, upCallbacks);
+ $.on(r, 'error', function() {
+ if (!r.status) {
+ return c.error("4chan X failed to load: " + url);
+ }
+ });
+ r.send(form);
} catch (_error) {
err = _error;
- blockedError(url);
- ref = ['error', 'loadend'];
- for (i = 0, len = ref.length; i < len; i++) {
- event = ref[i];
+ if (err.result !== 0x805e0006) {
+ throw err;
+ }
+ ref1 = ['error', 'loadend'];
+ for (i = 0, len = ref1.length; i < len; i++) {
+ event = ref1[i];
r["on" + event] = options["on" + event];
$.queueTask($.event, event, null, r);
}
- return;
}
- if (whenModified) {
- if (((ref1 = lastModified[whenModified]) != null ? ref1[url] : void 0) != null) {
- r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]);
- }
- $.on(r, 'load', function() {
- return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified');
- });
- }
- if (/\.json$/.test(url)) {
- if (options.responseType == null) {
- options.responseType = 'json';
- }
- }
- $.extend(r, options);
- if (options.responseType === 'json' && r.responseType !== 'json' && delete r.response) {
- Object.defineProperty(r, 'response', {
- configurable: true,
- enumerable: true,
- get: function() {
- return JSON.parse(r.responseText);
- }
- });
- }
- $.extend(r.upload, upCallbacks);
- r.send(form);
return r;
};
})();
@@ -6362,10 +6353,10 @@ Redirect = (function() {
return function() {
var err, fail, response;
fail = function(action, msg) {
- return new Notice('warning', "Error " + action + " archive data from " + urls[i] + "\n" + msg, 20);
+ return new Notice('warning', "Error " + action + " archive data from\n" + urls[i] + "\n" + msg, 20);
};
if (this.status !== 200) {
- return fail('fetching', (this.status ? this.status + " " + this.statusText : 'Connection Error'));
+ return fail('fetching', (this.status ? "Error " + this.statusText + " (" + this.status + ")" : 'Connection Error'));
}
try {
response = JSON.parse(this.response);
@@ -9271,7 +9262,7 @@ Index = (function() {
return;
}
if ((ref = req.status) !== 200 && ref !== 304) {
- err = "Index refresh failed. Error " + req.statusText + " (" + req.status + ")";
+ err = "Index refresh failed. " + (req.status ? "Error " + req.statusText + " (" + req.status + ")" : 'Connection Error');
if (notice) {
notice.setType('warning');
notice.el.lastElementChild.textContent = err;
@@ -17096,7 +17087,7 @@ ThreadUpdater = (function() {
}
ThreadUpdater.setInterval();
if (!req.status) {
- return ThreadUpdater.set('status', 'Connection Failed', 'warning');
+ return ThreadUpdater.set('status', 'Connection Error', 'warning');
} else if (req.status !== 304) {
return ThreadUpdater.set('status', req.statusText + " (" + req.status + ")", 'warning');
}
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index da5827236..9f1a269ae 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 55ca64be9..2af549c50 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 6b64e2e8e..d8322cdea 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/version.json b/version.json
index df1aff52f..4b0c1046e 100644
--- a/version.json
+++ b/version.json
@@ -1,4 +1,4 @@
{
- "version": "1.11.34.2",
- "date": "2016-05-17T14:02:06.612Z"
+ "version": "1.11.34.3",
+ "date": "2016-05-18T05:42:48.351Z"
}
\ No newline at end of file