diff --git a/CHANGELOG.md b/CHANGELOG.md index 352f05582..407809490 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ### v1.14.5 +**v1.14.5.13** *(2019-03-08)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.13/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.13/builds/4chan-X-noupdate.crx)] +- Fix bugs related to additional permissions requests. #2230 +- Revert changes in thread watcher that caused performance decrease. +- Fix thread watcher highlighting when quoted on boards with unusual characters in name (e.g. some lainchan boards). + **v1.14.5.12** *(2019-01-28)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.12/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.12/builds/4chan-X-noupdate.crx)] - Recover as well as possible from data corruption caused by ad filter interaction with Tampermonkey. #2218 diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index d3aeec993..55390a6e8 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 3cf053f62..8ff33536f 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.14.5.12 +// @version 1.14.5.13 // @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 21654f7be..79201e1a2 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.14.5.12 +// @version 1.14.5.13 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.12', + VERSION: '1.14.5.13', NAMESPACE: '4chan X.', boards: {} }; @@ -4603,14 +4603,14 @@ $ = (function() { pageXHR = XMLHttpRequest; } return function(url, options, extra) { - var err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; + var bypassCache, err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; if (options == null) { options = {}; } if (extra == null) { extra = {}; } - type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form; + type = extra.type, whenModified = extra.whenModified, bypassCache = extra.bypassCache, upCallbacks = extra.upCallbacks, form = extra.form; if (/\.json$/.test(url)) { if (options.responseType == null) { options.responseType = 'json'; @@ -4622,7 +4622,7 @@ $ = (function() { if ($.engine === 'blink') { params.push("s=" + whenModified); } - if (Site.software === 'yotsuba') { + if (Site.software === 'yotsuba' && bypassCache) { params.push("t=" + (Date.now())); } url0 = url; @@ -5559,7 +5559,10 @@ CrossOrigin = (function() { } }); }; - })() + })(), + permission: function(cb) { + return cb(); + } }; return CrossOrigin; @@ -19378,7 +19381,8 @@ ThreadStats = (function() { return $.ajax(location.protocol + "//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", { onload: ThreadStats.onThreadsLoad }, { - whenModified: 'ThreadStats' + whenModified: 'ThreadStats', + bypassCache: true }); }, onThreadsLoad: function() { @@ -19716,7 +19720,8 @@ ThreadUpdater = (function() { onloadend: ThreadUpdater.cb.load, timeout: $.MINUTE }, { - whenModified: 'ThreadUpdater' + whenModified: 'ThreadUpdater', + bypassCache: true }); }, updateThreadStatus: function(type, status) { @@ -20231,6 +20236,8 @@ ThreadWatcher = (function() { return ThreadWatcher.parseStatus.call(this, thread); }, timeout: $.MINUTE + }, { + whenModified: force ? false : 'ThreadWatcher' }); } else { req = { @@ -20314,7 +20321,7 @@ ThreadWatcher = (function() { while (match = regexp.exec(postObj.com)) { if (QuoteYou.db.get({ siteID: siteID, - boardID: match[1] || boardID, + boardID: match[1] ? encodeURIComponent(match[1]) : boardID, threadID: match[2] || threadID, postID: match[3] || match[2] || threadID })) { @@ -22464,20 +22471,22 @@ QR = (function() { } }, handleUrl: function(urlDefault) { - var url; QR.open(); QR.selected.preventAutoPost(); - url = prompt('Enter a URL:', urlDefault); - if (url === null) { - return; - } - QR.nodes.fileButton.focus(); - return CrossOrigin.file(url, function(blob) { - if (blob && !/^text\//.test(blob.type)) { - return QR.handleFiles([blob]); - } else { - return QR.error("Can't load file."); + return CrossOrigin.permission(function() { + var url; + url = prompt('Enter a URL:', urlDefault); + if (url === null) { + return; } + QR.nodes.fileButton.focus(); + return CrossOrigin.file(url, function(blob) { + if (blob && !/^text\//.test(blob.type)) { + return QR.handleFiles([blob]); + } else { + return QR.error("Can't load file."); + } + }); }); }, handleFiles: function(files) { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 8b8b536a9..69e186cc5 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 9eebfeff0..f99b44b36 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.14.5.12 +// @version 1.14.5.13 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.12', + VERSION: '1.14.5.13', NAMESPACE: '4chan X.', boards: {} }; @@ -4603,14 +4603,14 @@ $ = (function() { pageXHR = XMLHttpRequest; } return function(url, options, extra) { - var err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; + var bypassCache, err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; if (options == null) { options = {}; } if (extra == null) { extra = {}; } - type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form; + type = extra.type, whenModified = extra.whenModified, bypassCache = extra.bypassCache, upCallbacks = extra.upCallbacks, form = extra.form; if (/\.json$/.test(url)) { if (options.responseType == null) { options.responseType = 'json'; @@ -4622,7 +4622,7 @@ $ = (function() { if ($.engine === 'blink') { params.push("s=" + whenModified); } - if (Site.software === 'yotsuba') { + if (Site.software === 'yotsuba' && bypassCache) { params.push("t=" + (Date.now())); } url0 = url; @@ -5559,7 +5559,10 @@ CrossOrigin = (function() { } }); }; - })() + })(), + permission: function(cb) { + return cb(); + } }; return CrossOrigin; @@ -19378,7 +19381,8 @@ ThreadStats = (function() { return $.ajax(location.protocol + "//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", { onload: ThreadStats.onThreadsLoad }, { - whenModified: 'ThreadStats' + whenModified: 'ThreadStats', + bypassCache: true }); }, onThreadsLoad: function() { @@ -19716,7 +19720,8 @@ ThreadUpdater = (function() { onloadend: ThreadUpdater.cb.load, timeout: $.MINUTE }, { - whenModified: 'ThreadUpdater' + whenModified: 'ThreadUpdater', + bypassCache: true }); }, updateThreadStatus: function(type, status) { @@ -20231,6 +20236,8 @@ ThreadWatcher = (function() { return ThreadWatcher.parseStatus.call(this, thread); }, timeout: $.MINUTE + }, { + whenModified: force ? false : 'ThreadWatcher' }); } else { req = { @@ -20314,7 +20321,7 @@ ThreadWatcher = (function() { while (match = regexp.exec(postObj.com)) { if (QuoteYou.db.get({ siteID: siteID, - boardID: match[1] || boardID, + boardID: match[1] ? encodeURIComponent(match[1]) : boardID, threadID: match[2] || threadID, postID: match[3] || match[2] || threadID })) { @@ -22464,20 +22471,22 @@ QR = (function() { } }, handleUrl: function(urlDefault) { - var url; QR.open(); QR.selected.preventAutoPost(); - url = prompt('Enter a URL:', urlDefault); - if (url === null) { - return; - } - QR.nodes.fileButton.focus(); - return CrossOrigin.file(url, function(blob) { - if (blob && !/^text\//.test(blob.type)) { - return QR.handleFiles([blob]); - } else { - return QR.error("Can't load file."); + return CrossOrigin.permission(function() { + var url; + url = prompt('Enter a URL:', urlDefault); + if (url === null) { + return; } + QR.nodes.fileButton.focus(); + return CrossOrigin.file(url, function(blob) { + if (blob && !/^text\//.test(blob.type)) { + return QR.handleFiles([blob]); + } else { + return QR.error("Can't load file."); + } + }); }); }, handleFiles: function(files) { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index ed96b3f93..50f05c72c 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 e1a8736d7..26daf5353 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.5.12 +// @version 1.14.5.13 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 53892fb86..791bd293b 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.5.12 +// @version 1.14.5.13 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.12', + VERSION: '1.14.5.13', NAMESPACE: '4chan X.', boards: {} }; @@ -4603,14 +4603,14 @@ $ = (function() { pageXHR = XMLHttpRequest; } return function(url, options, extra) { - var err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; + var bypassCache, err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; if (options == null) { options = {}; } if (extra == null) { extra = {}; } - type = extra.type, whenModified = extra.whenModified, upCallbacks = extra.upCallbacks, form = extra.form; + type = extra.type, whenModified = extra.whenModified, bypassCache = extra.bypassCache, upCallbacks = extra.upCallbacks, form = extra.form; if (/\.json$/.test(url)) { if (options.responseType == null) { options.responseType = 'json'; @@ -4622,7 +4622,7 @@ $ = (function() { if ($.engine === 'blink') { params.push("s=" + whenModified); } - if (Site.software === 'yotsuba') { + if (Site.software === 'yotsuba' && bypassCache) { params.push("t=" + (Date.now())); } url0 = url; @@ -5559,7 +5559,10 @@ CrossOrigin = (function() { } }); }; - })() + })(), + permission: function(cb) { + return cb(); + } }; return CrossOrigin; @@ -19378,7 +19381,8 @@ ThreadStats = (function() { return $.ajax(location.protocol + "//a.4cdn.org/" + ThreadStats.thread.board + "/threads.json", { onload: ThreadStats.onThreadsLoad }, { - whenModified: 'ThreadStats' + whenModified: 'ThreadStats', + bypassCache: true }); }, onThreadsLoad: function() { @@ -19716,7 +19720,8 @@ ThreadUpdater = (function() { onloadend: ThreadUpdater.cb.load, timeout: $.MINUTE }, { - whenModified: 'ThreadUpdater' + whenModified: 'ThreadUpdater', + bypassCache: true }); }, updateThreadStatus: function(type, status) { @@ -20231,6 +20236,8 @@ ThreadWatcher = (function() { return ThreadWatcher.parseStatus.call(this, thread); }, timeout: $.MINUTE + }, { + whenModified: force ? false : 'ThreadWatcher' }); } else { req = { @@ -20314,7 +20321,7 @@ ThreadWatcher = (function() { while (match = regexp.exec(postObj.com)) { if (QuoteYou.db.get({ siteID: siteID, - boardID: match[1] || boardID, + boardID: match[1] ? encodeURIComponent(match[1]) : boardID, threadID: match[2] || threadID, postID: match[3] || match[2] || threadID })) { @@ -22464,20 +22471,22 @@ QR = (function() { } }, handleUrl: function(urlDefault) { - var url; QR.open(); QR.selected.preventAutoPost(); - url = prompt('Enter a URL:', urlDefault); - if (url === null) { - return; - } - QR.nodes.fileButton.focus(); - return CrossOrigin.file(url, function(blob) { - if (blob && !/^text\//.test(blob.type)) { - return QR.handleFiles([blob]); - } else { - return QR.error("Can't load file."); + return CrossOrigin.permission(function() { + var url; + url = prompt('Enter a URL:', urlDefault); + if (url === null) { + return; } + QR.nodes.fileButton.focus(); + return CrossOrigin.file(url, function(blob) { + if (blob && !/^text\//.test(blob.type)) { + return QR.handleFiles([blob]); + } else { + return QR.error("Can't load file."); + } + }); }); }, handleFiles: function(files) { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 4668c4404..6854de245 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.json b/builds/updates-beta.json index 72ddea3a1..8a22664d0 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.5.12", + "version": "1.14.5.13", "update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx" } ] diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index 1e0911580..cd87d0c64 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.json b/builds/updates.json index 6e99a6828..7608ac039 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.5.12", + "version": "1.14.5.13", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index de84c5940..3f9605aaf 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index f0f35f99e..f87a5ddbd 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.5.12", - "date": "2019-01-28T10:07:50.479Z" + "version": "1.14.5.13", + "date": "2019-03-08T23:32:11.908Z" } \ No newline at end of file