diff --git a/CHANGELOG.md b/CHANGELOG.md index d4ee7cabc..7921d945d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ ### v1.14.5 +**v1.14.5.3** *(2018-12-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.3/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.3/builds/4chan-X-noupdate.crx)] +- Fix bugs in cross-site data access. + **v1.14.5.2** *(2018-12-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.2/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.2/builds/4chan-X-noupdate.crx)] - All Thread Watcher functionality is now supported on and across Tinyboard/vichan sites, including auto-updating, the unread count, and lighting up upon replies, with the exception that threads from sites without JSON APIs will not be updated when the thread watcher is refreshed. - The `Unread Count`, `Unread Line`, `Scroll to Last Read Post`, and `Desktop Notifications` are now supported on Tinyboard/vichan sites. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 184e8f4e9..9ef27656e 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 d01249435..05cffd8f4 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.2 +// @version 1.14.5.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 6a27f2b73..0adb1dbd7 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.2 +// @version 1.14.5.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.2', + VERSION: '1.14.5.3', NAMESPACE: '4chan X.', boards: {} }; @@ -5843,6 +5843,9 @@ DataBoard = (function() { var boardID, postID, siteID, threadID; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; siteID || (siteID = Site.hostname); + if (!this.data[siteID]) { + return; + } return this.save((function(_this) { return function() { var ref; @@ -5875,6 +5878,9 @@ DataBoard = (function() { DataBoard.prototype.deleteIfEmpty = function(arg) { var boardID, siteID, threadID; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; + if (!this.data[siteID]) { + return; + } if (threadID) { if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { delete this.data[siteID].boards[boardID][threadID]; @@ -5897,13 +5903,16 @@ DataBoard = (function() { }; DataBoard.prototype.setUnsafe = function(arg) { - var base, base1, base2, boardID, postID, siteID, threadID, val; + var base, base1, base2, base3, boardID, postID, siteID, threadID, val; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; siteID || (siteID = Site.hostname); + (base = this.data)[siteID] || (base[siteID] = { + boards: {} + }); if (postID !== void 0) { - return ((base = ((base1 = this.data[siteID].boards)[boardID] || (base1[boardID] = {})))[threadID] || (base[threadID] = {}))[postID] = val; + return ((base1 = ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val; } else if (threadID !== void 0) { - return ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = {}))[threadID] = val; + return ((base3 = this.data[siteID].boards)[boardID] || (base3[boardID] = {}))[threadID] = val; } else { return this.data[siteID].boards[boardID] = val; } @@ -5948,10 +5957,10 @@ DataBoard = (function() { }; DataBoard.prototype.get = function(arg) { - var ID, board, boardID, defaultValue, i, len, postID, siteID, thread, threadID, val; + var ID, board, boardID, defaultValue, i, len, postID, ref, siteID, thread, threadID, val; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue; siteID || (siteID = Site.hostname); - if (board = this.data[siteID].boards[boardID]) { + if (board = (ref = this.data[siteID]) != null ? ref.boards[boardID] : void 0) { if (threadID == null) { if (postID != null) { for (thread = i = 0, len = board.length; i < len; thread = ++i) { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index afab139e1..8c17e5cd5 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 894bfa2be..e8d49dbdd 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.2 +// @version 1.14.5.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.2', + VERSION: '1.14.5.3', NAMESPACE: '4chan X.', boards: {} }; @@ -5843,6 +5843,9 @@ DataBoard = (function() { var boardID, postID, siteID, threadID; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; siteID || (siteID = Site.hostname); + if (!this.data[siteID]) { + return; + } return this.save((function(_this) { return function() { var ref; @@ -5875,6 +5878,9 @@ DataBoard = (function() { DataBoard.prototype.deleteIfEmpty = function(arg) { var boardID, siteID, threadID; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; + if (!this.data[siteID]) { + return; + } if (threadID) { if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { delete this.data[siteID].boards[boardID][threadID]; @@ -5897,13 +5903,16 @@ DataBoard = (function() { }; DataBoard.prototype.setUnsafe = function(arg) { - var base, base1, base2, boardID, postID, siteID, threadID, val; + var base, base1, base2, base3, boardID, postID, siteID, threadID, val; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; siteID || (siteID = Site.hostname); + (base = this.data)[siteID] || (base[siteID] = { + boards: {} + }); if (postID !== void 0) { - return ((base = ((base1 = this.data[siteID].boards)[boardID] || (base1[boardID] = {})))[threadID] || (base[threadID] = {}))[postID] = val; + return ((base1 = ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val; } else if (threadID !== void 0) { - return ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = {}))[threadID] = val; + return ((base3 = this.data[siteID].boards)[boardID] || (base3[boardID] = {}))[threadID] = val; } else { return this.data[siteID].boards[boardID] = val; } @@ -5948,10 +5957,10 @@ DataBoard = (function() { }; DataBoard.prototype.get = function(arg) { - var ID, board, boardID, defaultValue, i, len, postID, siteID, thread, threadID, val; + var ID, board, boardID, defaultValue, i, len, postID, ref, siteID, thread, threadID, val; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue; siteID || (siteID = Site.hostname); - if (board = this.data[siteID].boards[boardID]) { + if (board = (ref = this.data[siteID]) != null ? ref.boards[boardID] : void 0) { if (threadID == null) { if (postID != null) { for (thread = i = 0, len = board.length; i < len; thread = ++i) { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 0a88435eb..084bf1a76 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 90d386b8b..6c419e40d 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.2 +// @version 1.14.5.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 1c1f66ee3..942521ebb 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.2 +// @version 1.14.5.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.2', + VERSION: '1.14.5.3', NAMESPACE: '4chan X.', boards: {} }; @@ -5843,6 +5843,9 @@ DataBoard = (function() { var boardID, postID, siteID, threadID; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID; siteID || (siteID = Site.hostname); + if (!this.data[siteID]) { + return; + } return this.save((function(_this) { return function() { var ref; @@ -5875,6 +5878,9 @@ DataBoard = (function() { DataBoard.prototype.deleteIfEmpty = function(arg) { var boardID, siteID, threadID; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID; + if (!this.data[siteID]) { + return; + } if (threadID) { if (!Object.keys(this.data[siteID].boards[boardID][threadID]).length) { delete this.data[siteID].boards[boardID][threadID]; @@ -5897,13 +5903,16 @@ DataBoard = (function() { }; DataBoard.prototype.setUnsafe = function(arg) { - var base, base1, base2, boardID, postID, siteID, threadID, val; + var base, base1, base2, base3, boardID, postID, siteID, threadID, val; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, val = arg.val; siteID || (siteID = Site.hostname); + (base = this.data)[siteID] || (base[siteID] = { + boards: {} + }); if (postID !== void 0) { - return ((base = ((base1 = this.data[siteID].boards)[boardID] || (base1[boardID] = {})))[threadID] || (base[threadID] = {}))[postID] = val; + return ((base1 = ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = {})))[threadID] || (base1[threadID] = {}))[postID] = val; } else if (threadID !== void 0) { - return ((base2 = this.data[siteID].boards)[boardID] || (base2[boardID] = {}))[threadID] = val; + return ((base3 = this.data[siteID].boards)[boardID] || (base3[boardID] = {}))[threadID] = val; } else { return this.data[siteID].boards[boardID] = val; } @@ -5948,10 +5957,10 @@ DataBoard = (function() { }; DataBoard.prototype.get = function(arg) { - var ID, board, boardID, defaultValue, i, len, postID, siteID, thread, threadID, val; + var ID, board, boardID, defaultValue, i, len, postID, ref, siteID, thread, threadID, val; siteID = arg.siteID, boardID = arg.boardID, threadID = arg.threadID, postID = arg.postID, defaultValue = arg.defaultValue; siteID || (siteID = Site.hostname); - if (board = this.data[siteID].boards[boardID]) { + if (board = (ref = this.data[siteID]) != null ? ref.boards[boardID] : void 0) { if (threadID == null) { if (postID != null) { for (thread = i = 0, len = board.length; i < len; thread = ++i) { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 7744a14e3..24fe0a7eb 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 247efc452..ca71b9829 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.2", + "version": "1.14.5.3", "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 30e3a76a1..8f0f88358 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 e36670270..f17125d3f 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.5.2", + "version": "1.14.5.3", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index acae2f8a0..ba1264495 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index cf4d35ba7..d949e0ad0 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.5.2", - "date": "2018-12-07T05:18:16.194Z" + "version": "1.14.5.3", + "date": "2018-12-07T07:37:49.493Z" } \ No newline at end of file