diff --git a/src/General/Settings.coffee b/src/General/Settings.coffee index 25c7165d9..8fbaf929b 100644 --- a/src/General/Settings.coffee +++ b/src/General/Settings.coffee @@ -167,6 +167,8 @@ Settings = $('div[data-name="Remember QR Size"]', section).hidden = true if $.perProtocolSettings or location.protocol isnt 'https:' $('div[data-name="Redirect to HTTPS"]', section).hidden = true + if $.platform isnt 'crx' + $('div[data-name="Work around CORB Bug"]', section).hidden = true $.get items, (items) -> for key, val of items diff --git a/src/config/Config.coffee b/src/config/Config.coffee index be0d59efb..1cc2ecbe1 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -129,6 +129,10 @@ Config = true 'Rewrite the URL of the current page, removing slugs and excess slashes, and changing /res/ to /thread/.' ] + 'Work around CORB Bug': [ + true + 'Leave this checked until your garbage browser is fixed.' + ] 'Disable Autoplaying Sounds': [ false 'Prevent sounds on the page from autoplaying.' @@ -1163,7 +1167,6 @@ Config = 'Max Replies': 1000 'Autohiding Scrollbar': false - 'Chromium CORB Bug': false position: 'embedding.position': 'top: 50px; right: 0px;' diff --git a/src/platform/$.coffee b/src/platform/$.coffee index bc195b1df..0f490fdda 100644 --- a/src/platform/$.coffee +++ b/src/platform/$.coffee @@ -79,7 +79,7 @@ $.ajax = do -> url = url.replace /^((?:https?:)?\/\/(?:\w+\.)?(?:4chan|4channel|4cdn)\.org)\/adv\//, '$1//adv/' <% if (type === 'crx') { %> # XXX https://bugs.chromium.org/p/chromium/issues/detail?id=920638 - if Conf['Chromium CORB Bug'] and g.SITE.software is 'yotsuba' and !options.testCORB + if Conf['Work around CORB Bug'] and g.SITE.software is 'yotsuba' and !options.testCORB return $.ajaxPage url, options <% } %> {onloadend, timeout, responseType, withCredentials, type, onprogress, form, headers} = options @@ -95,8 +95,8 @@ $.ajax = do -> <% if (type === 'crx') { %> # XXX https://bugs.chromium.org/p/chromium/issues/detail?id=920638 $.on r, 'load', -> - if !Conf['Chromium CORB Bug'] and r.readyState is 4 and r.status is 200 and r.statusText is '' and r.response is null - $.set 'Chromium CORB Bug', (Conf['Chromium CORB Bug'] = Date.now()) + if !Conf['Work around CORB Bug'] and r.readyState is 4 and r.status is 200 and r.statusText is '' and r.response is null + $.set 'Work around CORB Bug', (Conf['Work around CORB Bug'] = Date.now()) <% } %> r.send form catch err @@ -114,14 +114,6 @@ do -> requests = $.dict() $.ajaxPageInit = -> - if Conf['Chromium CORB Bug'] and g.SITE.software is 'yotsuba' - unless 0 <= Date.now() - Conf['Chromium CORB Bug'] < 2 * $.DAY - $.ajax "#{location.protocol}//a.4cdn.org/boards.json", - testCORB: true - onloadend: -> - if @response - $.set 'Chromium CORB Bug', (Conf['Chromium CORB Bug'] = false) - $.global -> window.FCX.requests = Object.create(null)