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 b05095d3a..7d1cf92ac 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/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 diff --git a/src/Monitoring/Unread.coffee b/src/Monitoring/Unread.coffee index 257be4440..f2f3f9c57 100644 --- a/src/Monitoring/Unread.coffee +++ b/src/Monitoring/Unread.coffee @@ -131,19 +131,16 @@ 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 + 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 84e63a819..e38abf672 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -206,22 +206,19 @@ 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 + notif.onclick = -> 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: [] @@ -489,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/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 diff --git a/src/config/Config.coffee b/src/config/Config.coffee index 9249beaa3..e417f70ad 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.' @@ -455,12 +451,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 - ] 'Show Upload Progress': [ true 'Track progress of file uploads as percentage in submit button.' diff --git a/src/platform/$.coffee b/src/platform/$.coffee index e86cb7de4..23cdd5dfa 100644 --- a/src/platform/$.coffee +++ b/src/platform/$.coffee @@ -57,12 +57,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 # connection error or content blocker $.on r, 'error', -> c.error "4chan X failed to load: #{url}" unless r.status @@ -119,11 +113,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() 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