Tag:
%gLiteral %: %%
"
});
ref = $$('.warning', section);
for (j = 0, len = ref.length; j < len; j++) {
@@ -11086,11 +11106,11 @@ UI = (function() {
var bottom, clientX, clientY, left, right, style, top;
clientX = e.clientX, clientY = e.clientY;
left = clientX - this.dx;
- left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%';
+ left = left < 10 ? 0 : this.width - left < 10 ? '' : left / this.screenWidth * 100 + '%';
top = clientY - this.dy;
- top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? null : top / this.screenHeight * 100 + '%';
- right = left === null ? 0 : null;
- bottom = top === null ? this.bottomBorder + 'px' : null;
+ top = top < (10 + this.topBorder) ? this.topBorder + 'px' : this.height - top < (10 + this.bottomBorder) ? '' : top / this.screenHeight * 100 + '%';
+ right = left === '' ? 0 : '';
+ bottom = top === '' ? this.bottomBorder + 'px' : '';
style = this.style;
style.left = left;
style.right = right;
@@ -11172,7 +11192,7 @@ UI = (function() {
if (!this.isImage) {
threshold = Math.max(threshold, this.clientWidth - 400);
}
- ref = clientX <= threshold ? [clientX + 45 + 'px', null] : [null, this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
+ ref = clientX <= threshold ? [clientX + 45 + 'px', ''] : ['', this.clientWidth - clientX + 45 + 'px'], left = ref[0], right = ref[1];
style = this.style;
style.top = top + 'px';
style.left = left;
@@ -11473,9 +11493,7 @@ Gallery = (function() {
'webm': 'video',
'pdf': 'iframe'
}[ext] || 'img';
- file = $.el(elType, {
- title: thumb.title
- });
+ file = $.el(elType);
$.extend(file.dataset, thumb.dataset);
$.on(file, 'error', errorCB);
file.src = thumb.href;
@@ -11726,7 +11744,7 @@ Gallery = (function() {
style.minHeight = minHeight + 'px';
return style.minWidth = (width / height * minHeight) + 'px';
} else {
- return style.minHeight = style.minWidth = null;
+ return style.minHeight = style.minWidth = '';
}
}),
setDelay: function() {
@@ -16020,7 +16038,7 @@ Nav = (function() {
if (extra > 0) {
return d.body.style.marginBottom = extra + "px";
} else {
- d.body.style.marginBottom = null;
+ d.body.style.marginBottom = '';
delete Nav.haveExtra;
return $.off(d, 'scroll', Nav.removeExtra);
}
@@ -18884,7 +18902,7 @@ Captcha = {};
});
QR.captcha.load();
if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = null;
+ QR.nodes.el.style.top = '';
return QR.nodes.el.style.bottom = '0px';
}
},
@@ -19232,7 +19250,7 @@ Captcha = {};
}
},
setupIFrame: function(iframe) {
- var ref;
+ var ref, ref1;
if (!doc.contains(iframe)) {
return;
}
@@ -19248,7 +19266,7 @@ Captcha = {};
f = document.querySelector('#qr iframe');
return f.focus = f.blur = function() {};
});
- if ($.engine === 'blink' && (ref = iframe.parentNode, indexOf.call($$('#qr .captcha-container > div > div:first-of-type'), ref) >= 0)) {
+ if (((ref = $.engine) === 'blink' || ref === 'edge') && (ref1 = iframe.parentNode, indexOf.call($$('#qr .captcha-container > div > div:first-of-type'), ref1) >= 0)) {
return $.on(iframe.parentNode, 'scroll', function() {
return this.scrollTop = 0;
});
@@ -19256,7 +19274,7 @@ Captcha = {};
},
fixQRPosition: function() {
if (QR.nodes.el.getBoundingClientRect().bottom > doc.clientHeight) {
- QR.nodes.el.style.top = null;
+ QR.nodes.el.style.top = '';
return QR.nodes.el.style.bottom = '0px';
}
},
@@ -21266,7 +21284,7 @@ QR = (function() {
} else {
this.updateFilename();
}
- this.nodes.el.style.backgroundImage = null;
+ this.nodes.el.style.backgroundImage = '';
if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) {
return this.fileError('Unsupported file type.');
} else if (/^(image|video)\//.test(this.file.type)) {
@@ -21392,7 +21410,7 @@ QR = (function() {
delete this.filesize;
this.nodes.el.removeAttribute('title');
QR.nodes.filename.removeAttribute('title');
- this.nodes.el.style.backgroundImage = null;
+ this.nodes.el.style.backgroundImage = '';
$.rmClass(this.nodes.el, 'has-file');
this.showFileData();
URL.revokeObjectURL(this.URL);
@@ -22433,9 +22451,9 @@ Main = (function() {
}
window['4chan X antidup'] = true;
if (location.hostname === 'www.google.com') {
- $.get('Captcha Fixes', true, function(arg1) {
+ $.get('Captcha Fixes', true, function(arg) {
var enabled;
- enabled = arg1['Captcha Fixes'];
+ enabled = arg['Captcha Fixes'];
if (enabled) {
return $.ready(function() {
return Captcha.fixes.init();
@@ -22495,56 +22513,21 @@ Main = (function() {
Conf['QR Shortcut'] = true;
Conf['Bottom QR Link'] = true;
Conf['Toggleable Thread Watcher'] = true;
- if ($.platform === 'crx') {
- $.global(function() {
- var k, key, len1, oldFun, ref1, whitelist;
- whitelist = document.currentScript.dataset.whitelist;
- whitelist = whitelist.split('\n').filter(function(x) {
- return x[0] !== "'";
- });
- whitelist.push(location.protocol + "//" + location.host);
- oldFun = {};
- ref1 = ['createElement', 'write'];
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- key = ref1[k];
- oldFun[key] = document[key];
- document[key] = (function(key) {
- return function(arg) {
- var s;
- s = document.currentScript;
- if (s && s.src && whitelist.indexOf(s.src.split('/').slice(0, 3).join('/')) < 0) {
- throw Error();
- }
- return oldFun[key].call(document, arg);
- };
- })(key);
- }
- return document.addEventListener('csp-ready', function() {
- var results;
- results = [];
- for (key in oldFun) {
- results.push(document[key] = oldFun[key]);
- }
- return results;
- }, false);
- }, {
- whitelist: Conf['jsWhitelist']
- });
- }
+ ($.getSync || $.get)({
+ 'jsWhitelist': Conf['jsWhitelist']
+ }, function(arg) {
+ var jsWhitelist;
+ jsWhitelist = arg.jsWhitelist;
+ return $.addCSP("script-src " + (jsWhitelist.replace(/^#.*$/mg, '').replace(/[\s;]+/g, ' ').trim()));
+ });
items = {};
for (key in Conf) {
items[key] = void 0;
}
items['previousversion'] = void 0;
return ($.getSync || $.get)(items, function(items) {
- var jsWhitelist, ref1;
- jsWhitelist = (ref1 = items['jsWhitelist']) != null ? ref1 : Conf['jsWhitelist'];
- $.addCSP("script-src " + (jsWhitelist.replace(/[\s;]+/g, ' ')));
- if ($.platform === 'crx') {
- $.event('csp-ready');
- }
return $.asap(docSet, function() {
- var ref2, val;
+ var ref1, val;
if ($.cantSet) {
} else if (items.previousversion == null) {
@@ -22557,7 +22540,7 @@ Main = (function() {
}
for (key in Conf) {
val = Conf[key];
- Conf[key] = (ref2 = items[key]) != null ? ref2 : val;
+ Conf[key] = (ref1 = items[key]) != null ? ref1 : val;
}
return Main.initFeatures();
});
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index e34177590..77060a8d6 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 6a853c815..d0d89184c 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.12.2.1
+// @version 1.12.3.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index d3789fb11..ce9090b00 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.12.2.1
+// @version 1.12.3.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -136,7 +136,7 @@ docSet = function() {
};
g = {
- VERSION: '1.12.2.1',
+ VERSION: '1.12.3.0',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -229,7 +229,7 @@ Config = (function() {
'Images and Videos': {
'Image Expansion': [true, 'Expand images / videos.'],
'Image Hover': [true, 'Show full image / video on mouseover.'],
- 'Image Hover in Catalog': [false, 'Show full image / video on mouseover in 4chan X catalog.'],
+ 'Image Hover in Catalog': [true, 'Show full image / video on mouseover in 4chan X catalog.'],
'Gallery': [true, 'Adds a simple and cute image gallery.'],
'Fullscreen Gallery': [false, 'Open gallery in fullscreen mode.', 1],
'PDF in Gallery': [false, 'Show PDF files in gallery.', 1],
@@ -342,9 +342,9 @@ Config = (function() {
threadWatcher: {
'Current Board': [false, 'Only show watched threads from the current board.'],
'Auto Update Thread Watcher': [true, 'Periodically check status of watched threads.'],
- 'Auto Watch': [false, 'Automatically watch threads you start.'],
- 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'],
- 'Auto Prune': [false, 'Automatically remove dead threads.'],
+ 'Auto Watch': [true, 'Automatically watch threads you start.'],
+ 'Auto Watch Reply': [true, 'Automatically watch threads you reply to.'],
+ 'Auto Prune': [true, 'Automatically remove dead threads.'],
'Show Unread Count': [true, 'Show number of unread posts in watched threads.']
},
filter: {
@@ -396,7 +396,7 @@ Config = (function() {
'QR.personas': "#options:\"sage\";boards:jp;always",
sjisPreview: false
},
- jsWhitelist: 'http://s.4cdn.org\nhttps://s.4cdn.org\nhttp://www.google.com\nhttps://www.google.com\nhttps://www.gstatic.com\nhttp://cdn.mathjax.org\nhttps://cdn.mathjax.org\n\'self\'\n\'unsafe-inline\'\n\'unsafe-eval\'',
+ jsWhitelist: 'http://s.4cdn.org\nhttps://s.4cdn.org\nhttp://www.google.com\nhttps://www.google.com\nhttps://www.gstatic.com\nhttp://cdn.mathjax.org\nhttps://cdn.mathjax.org\n\'self\'\n\'unsafe-inline\'\n\'unsafe-eval\'\n\n# Banner ads\n#http://s.zkcdn.net/ados.js\n#https://s.zkcdn.net/ados.js\n#http://engine.4chan-ads.org\n#https://engine.4chan-ads.org',
captchaLanguage: '',
time: '%m/%d/%y(%a)%H:%M:%S',
backlink: '>>%id',
@@ -2545,10 +2545,12 @@ input.field.tripped:not(:hover):not(:focus) {\n\
width: 304px;\n\
}\n\
/* XXX scrollable with scroll bar hidden; prevents scroll on space press */\n\
-:root.ua-blink #qr .captcha-container > div {\n\
+:root.ua-blink #qr .captcha-container > div,\n\
+:root.ua-edge #qr .captcha-container > div {\n\
overflow: hidden;\n\
}\n\
-:root.ua-blink #qr .captcha-container > div > div:first-of-type {\n\
+:root.ua-blink #qr .captcha-container > div > div:first-of-type,\n\
+:root.ua-edge #qr .captcha-container > div > div:first-of-type {\n\
overflow-y: scroll;\n\
overflow-x: hidden;\n\
padding-right: 15px;\n\
@@ -2567,6 +2569,7 @@ input.field.tripped:not(:hover):not(:focus) {\n\
}\n\
#qr .captcha-counter > a {\n\
pointer-events: auto;\n\
+ display: inline-block; /* XXX https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8851747/ */\n\
}\n\
#qr:not(.captcha-open) .captcha-counter > a {\n\
display: block;\n\
@@ -3936,7 +3939,15 @@ $ = (function() {
extra = {};
}
type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form;
+ if (/\.json$/.test(url)) {
+ if (options.responseType == null) {
+ options.responseType = 'json';
+ }
+ }
url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/');
+ if ($.engine === 'blink' && whenModified) {
+ url += "?s=" + whenModified;
+ }
r = new XMLHttpRequest();
type || (type = form && 'post' || 'get');
try {
@@ -3949,11 +3960,6 @@ $ = (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);
$.extend(r.upload, upCallbacks);
$.on(r, 'error', function() {
@@ -4387,12 +4393,17 @@ $ = (function() {
$.platform = 'userscript';
- try {
- localStorage.getItem('x');
- $.hasStorage = true;
- } catch (_error) {
- $.hasStorage = false;
- }
+ $.hasStorage = (function() {
+ try {
+ if (localStorage[g.NAMESPACE + 'hasStorage'] === 'true') {
+ return true;
+ }
+ localStorage[g.NAMESPACE + 'hasStorage'] = 'true';
+ return localStorage[g.NAMESPACE + 'hasStorage'] === 'true';
+ } catch (_error) {
+ return false;
+ }
+ })();
$.item = function(key, val) {
var item;
@@ -6258,7 +6269,6 @@ Redirect = (function() {
{ "uid": 4, "name": "Nyafuu Archive", "domain": "archive.nyafuu.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "asp", "c", "e", "n", "news", "out", "p", "toy", "vp", "w", "wg", "wsr" ], "files": [ "asp", "c", "e", "n", "news", "out", "p", "toy", "vp", "w", "wg", "wsr" ] },
{ "uid": 8, "name": "Rebecca Black Tech", "domain": "archive.rebeccablacktech.com", "http": false, "https": true, "software": "fuuka", "boards": [ "cgl", "g", "mu" ], "files": [ "cgl", "g", "mu" ] },
{ "uid": 10, "name": "warosu", "domain": "warosu.org", "http": false, "https": true, "software": "fuuka", "boards": [ "3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr" ], "files": [ "3", "biz", "cgl", "ck", "diy", "fa", "g", "ic", "jp", "lit", "sci", "tg", "vr" ] },
- { "uid": 23, "name": "Desuarchive", "domain": "desuarchive.org", "http": true, "https": true, "software": "foolfuuka", "boards": [ "a", "aco", "an", "c", "co", "d", "fit", "gif", "his", "int", "k", "m", "mlp", "qa", "r9k", "tg", "trash", "vr", "wsg" ], "files": [ "a", "aco", "an", "c", "co", "d", "fit", "gif", "his", "int", "k", "m", "mlp", "qa", "r9k", "tg", "trash", "vr", "wsg" ] },
{ "uid": 24, "name": "fireden.net", "domain": "boards.fireden.net", "http": false, "https": true, "software": "foolfuuka", "boards": [ "a", "cm", "ic", "sci", "tg", "v", "vg", "y" ], "files": [ "a", "cm", "ic", "sci", "tg", "v", "vg", "y" ] },
{ "uid": 25, "name": "arch.b4k.co", "domain": "arch.b4k.co", "http": true, "https": true, "software": "foolfuuka", "boards": [ "g", "jp", "mlp", "v" ], "files": [] },
{ "uid": 5, "name": "Love is Over", "domain": "archive.loveisover.me", "http": true, "https": false, "software": "foolfuuka", "boards": [ "c", "d", "e", "i", "lgbt", "t", "u" ], "files": [ "c", "d", "e", "i", "lgbt", "t", "u" ] },
@@ -8413,9 +8423,7 @@ Header = (function() {
}
$.off(window, 'scroll', Header.hideBarOnScroll);
$.rmClass(Header.bar, 'scroll');
- if (!Conf['Header auto-hide']) {
- return $.rmClass(Header.bar, 'autohide');
- }
+ return Header.bar.classList.toggle('autohide', Conf['Header auto-hide']);
},
toggleHideBarOnScroll: function() {
var hide;
@@ -10197,11 +10205,16 @@ Settings = (function() {
}
},
upgrade: function(data, version) {
- var addCSS, addSauces, boardID, changes, compareString, j, key, len, name, record, ref, ref1, ref2, ref3, ref4, ref5, rice, set, type, uids, value;
+ var addCSS, addSauces, boardID, changes, compareString, j, k, key, len, len1, name, record, ref, ref1, ref2, ref3, ref4, ref5, ref6, rice, set, setD, type, uids, value;
changes = {};
set = function(key, value) {
return data[key] = changes[key] = value;
};
+ setD = function(key, value) {
+ if (data[key] == null) {
+ return set(key, value);
+ }
+ };
addSauces = function(sauces) {
if (data['sauces'] != null) {
sauces = sauces.filter(function(s) {
@@ -10369,6 +10382,13 @@ Settings = (function() {
set('Persistent Thread Watcher', !data['Toggleable Thread Watcher']);
}
}
+ if (compareString < '00001.00012.00003.00000') {
+ ref6 = ['Image Hover in Catalog', 'Auto Watch', 'Auto Watch Reply', 'Auto Prune'];
+ for (k = 0, len1 = ref6.length; k < len1; k++) {
+ key = ref6[k];
+ setD(key, false);
+ }
+ }
return changes;
},
loadSettings: function(data, cb) {
@@ -10441,7 +10461,7 @@ Settings = (function() {
advanced: function(section) {
var applyCSS, boardSelect, customCSS, event, input, inputs, interval, items, itemsArchive, j, k, l, len, len1, len2, len3, m, name, ref, ref1, ref2, ref3, table, updateArchives, warning;
$.extend(section, {
- innerHTML: "