From b7bfa04dbd48c062ac4be4cc6c436fd14bb01401 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 02:41:49 -0700 Subject: [PATCH 1/9] Remove workaround for lack of responseType='json'. #904 --- src/platform/$.coffee | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/platform/$.coffee b/src/platform/$.coffee index 8efc55ad3..6d89ac0b6 100644 --- a/src/platform/$.coffee +++ b/src/platform/$.coffee @@ -76,12 +76,6 @@ $.ajax = do -> if /\.json$/.test url options.responseType ?= 'json' $.extend r, options - # XXX https://code.google.com/p/chromium/issues/detail?id=119256 (Maxthon is still on Chromium 30) - if options.responseType is 'json' and r.responseType isnt 'json' and delete r.response - Object.defineProperty r, 'response', - configurable: true - enumerable: true - get: -> return JSON.parse r.responseText $.extend r.upload, upCallbacks r.send form r From f2f6f1be6cbd5c1b21453832c31bea89cf319477 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 03:05:23 -0700 Subject: [PATCH 2/9] Remove crude shim for ES6 Set. #904 --- src/classes/ShimSet.coffee | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 src/classes/ShimSet.coffee diff --git a/src/classes/ShimSet.coffee b/src/classes/ShimSet.coffee deleted file mode 100644 index 599834c75..000000000 --- a/src/classes/ShimSet.coffee +++ /dev/null @@ -1,18 +0,0 @@ -class ShimSet - constructor: -> - @elements = {} - @size = 0 - has: (value) -> - value of @elements - add: (value) -> - return if @elements[value] - @elements[value] = true - @size++ - delete: (value) -> - return unless @elements[value] - delete @elements[value] - @size-- - -window.Set = ShimSet unless 'Set' of window - -return ShimSet From 386ebfbbb7c26c8541d4c7cfbee49926d961e9d9 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 03:17:54 -0700 Subject: [PATCH 3/9] Remove workaround for SeaMonkey < 2.35 Notification crash. #904 --- src/Monitoring/Unread.coffee | 24 +++++++++++------------- src/Posting/QR.coffee | 30 ++++++++++++++---------------- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 257be4440..f9232c8a6 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -131,19 +131,17 @@ Unread = openNotification: (post) -> return unless Header.areNotificationsEnabled - # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1130502 (SeaMonkey) - try - notif = new Notification "#{post.info.nameBlock} replied to you", - body: post.info.commentDisplay - icon: Favicon.logo - notif.onclick = -> - Header.scrollToIfNeeded post.nodes.root, true - # XXX https://github.com/derjanb/tampermonkey/issues/253 - $.global -> window.focus() - notif.onshow = -> - setTimeout -> - notif.close() - , 7 * $.SECOND + notif = new Notification "#{post.info.nameBlock} replied to you", + body: post.info.commentDisplay + icon: Favicon.logo + notif.onclick = -> + Header.scrollToIfNeeded post.nodes.root, true + # XXX https://github.com/derjanb/tampermonkey/issues/253 + $.global -> window.focus() + notif.onshow = -> + setTimeout -> + notif.close() + , 7 * $.SECOND onUpdate: (e) -> if !e.detail[404] diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index a7511b526..f52f78877 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -206,22 +206,20 @@ QR = unless Header.areNotificationsEnabled alert el.textContent if d.hidden and not QR.cooldown.auto else if d.hidden or not (focusOverride or d.hasFocus()) - # XXX https://bugzilla.mozilla.org/show_bug.cgi?id=1130502 (SeaMonkey) - try - notif = new Notification el.textContent, - body: el.textContent - icon: Favicon.logo - # XXX https://github.com/derjanb/tampermonkey/issues/253 - notif.onclick = -> $.global -> window.focus() - if $.engine isnt 'gecko' - # Firefox automatically closes notifications - # so we can't control the onclose properly. - notif.onclose = -> notice.close() - notif.onshow = -> - setTimeout -> - notif.onclose = null - notif.close() - , 7 * $.SECOND + notif = new Notification el.textContent, + body: el.textContent + icon: Favicon.logo + # XXX https://github.com/derjanb/tampermonkey/issues/253 + notif.onclick = -> $.global -> window.focus() + if $.engine isnt 'gecko' + # Firefox automatically closes notifications + # so we can't control the onclose properly. + notif.onclose = -> notice.close() + notif.onshow = -> + setTimeout -> + notif.onclose = null + notif.close() + , 7 * $.SECOND notifications: [] From fca71d22d626ee75202648b2924c0586b82f9e83 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 03:35:27 -0700 Subject: [PATCH 4/9] Remove old Tampermonkey issue (#656) workaround. #904 --- src/Monitoring/Unread.coffee | 3 +-- src/Posting/QR.coffee | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index f9232c8a6..f2f3f9c57 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -136,8 +136,7 @@ Unread = icon: Favicon.logo notif.onclick = -> Header.scrollToIfNeeded post.nodes.root, true - # XXX https://github.com/derjanb/tampermonkey/issues/253 - $.global -> window.focus() + window.focus() notif.onshow = -> setTimeout -> notif.close() diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index f52f78877..56058d634 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -209,8 +209,7 @@ QR = notif = new Notification el.textContent, body: el.textContent icon: Favicon.logo - # XXX https://github.com/derjanb/tampermonkey/issues/253 - notif.onclick = -> $.global -> window.focus() + notif.onclick = -> window.focus() if $.engine isnt 'gecko' # Firefox automatically closes notifications # so we can't control the onclose properly. From d1232b474d0b20f210102ad7df333a29b69282ac Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 04:12:36 -0700 Subject: [PATCH 5/9] Remove old MutationObserver workaround for MS Edge. #904 --- src/platform/$.coffee | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/platform/$.coffee b/src/platform/$.coffee index 6d89ac0b6..7433ec760 100644 --- a/src/platform/$.coffee +++ b/src/platform/$.coffee @@ -124,11 +124,6 @@ $.asap = (test, cb) -> $.onExists = (root, selector, cb) -> if el = $ selector, root return cb el - # XXX Edge doesn't notify MutationObservers of nodes added as document loads. - if $.engine is 'edge' and d.readyState is 'loading' - $.asap (-> d.readyState isnt 'loading' or $ selector, root), -> - $.onExists root, selector, cb - return observer = new MutationObserver -> if el = $ selector, root observer.disconnect() From 5beaba0c80eb8c4583fa1a468f36ea36259a17cf Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 04:16:24 -0700 Subject: [PATCH 6/9] Remove migration for old custom board title settings format from < v1.9.23.8. #904 --- src/Miscellaneous/Banner.coffee | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/Miscellaneous/Banner.coffee b/src/Miscellaneous/Banner.coffee index 89a879447..e5e12b26a 100644 --- a/src/Miscellaneous/Banner.coffee +++ b/src/Miscellaneous/Banner.coffee @@ -87,20 +87,6 @@ Banner = for event in ['click', 'keydown', 'blur'] $.on child, event, Banner.cb[event] - # XXX Migrate old settings. - string = "#{g.BOARD}.#{className}" - string2 = "#{string}.orig" - items = {} - items[string] = '' - items[string2] = child.textContent - $.get items, (items) -> - if items[string] - Banner.db.set - boardID: g.BOARD.ID - threadID: className - val: {title: items[string], orig: items[string2]} - $.delete [string, string2] - if data = Banner.db.get {boardID: g.BOARD.ID, threadID: className} if Conf['Persistent Custom Board Titles'] or data.orig is child.textContent Banner.original[className] = child.cloneNode true From 07e05961c510719097f1591667282f4961c1cc7e Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 04:20:45 -0700 Subject: [PATCH 7/9] Remove 'Show Name and Subject' option. #904 --- src/Posting/QR.coffee | 5 ----- src/config/Config.coffee | 6 ------ 2 files changed, 11 deletions(-) diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 56058d634..060936cdd 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -486,11 +486,6 @@ QR = if Conf['Show New Thread Option in Threads'] $.addClass QR.nodes.el, 'show-new-thread-option' - if Conf['Show Name and Subject'] - $.addClass QR.nodes.name, 'force-show' - $.addClass QR.nodes.sub, 'force-show' - QR.nodes.email.placeholder = 'E-mail' - QR.forcedAnon = !!$ 'form[name="post"] input[name="name"][type="hidden"]' if QR.forcedAnon $.addClass QR.nodes.el, 'forced-anon' diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 9307977f6..4731769a8 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -455,12 +455,6 @@ Config = 'Show the option to post a new / different thread from inside a thread.' 1 ] - # XXX This has been migrated to Name Sync and will be removed from 4chan X in a future version. - 'Show Name and Subject': [ - false - 'Show the classic name, email, and subject fields in the QR, even when 4chan doesn\'t use them all.' - 1 - ] 'Cooldown': [ true 'Indicate the remaining time before posting again.' From 8ab49a22146e6e476fd29ca7b8df65d1aab766d8 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 17 May 2016 04:25:30 -0700 Subject: [PATCH 8/9] Remove 'Restart when Opened' option. #904 --- src/Images/ImageCommon.coffee | 6 ------ src/Images/ImageExpand.coffee | 2 -- src/Images/ImageHover.coffee | 3 --- src/config/Config.coffee | 4 ---- 4 files changed, 15 deletions(-) diff --git a/src/Images/ImageCommon.coffee b/src/Images/ImageCommon.coffee index 489905755..5fb2e054b 100644 --- a/src/Images/ImageCommon.coffee +++ b/src/Images/ImageCommon.coffee @@ -6,12 +6,6 @@ ImageCommon = $.off video, 'volumechange', Volume.change video.muted = true - rewind: (el) -> - if el.nodeName is 'VIDEO' - el.currentTime = 0 if el.readyState >= el.HAVE_METADATA - else if /\.gif$/.test el.src - $.queueTask -> el.src = el.src - pushCache: (el) -> ImageCommon.cache = el $.on el, 'error', ImageCommon.cacheError diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index d804abc44..11d2a03fc 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -146,7 +146,6 @@ ImageExpand = ImageCommon.pause el for eventName, cb of ImageExpand.videoCB $.off el, eventName, cb - ImageCommon.rewind file.thumb if Conf['Restart when Opened'] delete file.fullImage $.queueTask -> # XXX Work around Chrome/Chromium not firing mouseover on the thumbnail. @@ -169,7 +168,6 @@ ImageExpand = else if ImageCommon.cache?.dataset.fullID is post.fullID el = file.fullImage = ImageCommon.popCache() $.on el, 'error', ImageExpand.error - ImageCommon.rewind el if Conf['Restart when Opened'] and el.id isnt 'ihover' el.removeAttribute 'id' else el = file.fullImage = $.el (if isVideo then 'video' else 'img') diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index 75008e6f3..2bcf50d7b 100644 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -34,9 +34,6 @@ ImageHover = $.on el, 'error', error el.src = file.url - if Conf['Restart when Opened'] - ImageCommon.rewind el - ImageCommon.rewind @ el.id = 'ihover' $.add Header.hover, el if isVideo diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 4731769a8..b10d9914a 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -254,10 +254,6 @@ Config = true 'Videos begin playing immediately when opened.' ] - 'Restart when Opened': [ - false - 'Restart GIFs and WebMs when you hover over or expand them.' - ] 'Show Controls': [ true 'Show controls on videos expanded inline.' From 58da030e3bcb04aabb7603d90752900ae144ac65 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 8 Jun 2016 23:09:58 -0700 Subject: [PATCH 9/9] Remove obsolete workarounds for fixed JS Blocker bugs. #904 --- src/platform/CrossOrigin.coffee | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/platform/CrossOrigin.coffee b/src/platform/CrossOrigin.coffee index 65419f977..d4e9bcd06 100644 --- a/src/platform/CrossOrigin.coffee +++ b/src/platform/CrossOrigin.coffee @@ -51,21 +51,15 @@ CrossOrigin = i++ else data = new Uint8Array xhr.response - if typeof xhr.responseHeaders is 'object' - # XXX https://github.com/infernoboy/JavaScript-Blocker/issues/35 - contentType = xhr.responseHeaders['Content-Type'] - contentDisposition = xhr.responseHeaders['Content-Disposition'] - else - contentType = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)?[1] - contentDisposition = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)?[1] + contentType = xhr.responseHeaders.match(/Content-Type:\s*(.*)/i)?[1] + contentDisposition = xhr.responseHeaders.match(/Content-Disposition:\s*(.*)/i)?[1] cb data, contentType, contentDisposition onerror: -> cb null onabort: -> cb null if workaround - # XXX https://github.com/infernoboy/JavaScript-Blocker/issues/35 - options.overrideMimeType = options.mimeType = 'text/plain; charset=x-user-defined' + options.overrideMimeType = 'text/plain; charset=x-user-defined' else options.responseType = 'arraybuffer' GM_xmlhttpRequest options