diff --git a/4chan_x.user.js b/4chan_x.user.js index c01bdd971..979700ab4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1497,7 +1497,7 @@ $.on($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode); qr.captchaTime = Date.now(); qr.spoiler = $('.postarea label') ? '' : ''; - qr.acceptFiles = $('.rules').textContent.match(/: (.+) /)[1].replace(/\w+/g, function(type) { + qr.acceptFiles = $('.rules').textContent.match(/: (.+)/)[1].replace(/\w+/g, function(type) { switch (type) { case 'JPG': return 'image/JPEG'; diff --git a/script.coffee b/script.coffee index 637ad3bd8..7632d65c1 100644 --- a/script.coffee +++ b/script.coffee @@ -1123,7 +1123,7 @@ qr = qr.captchaTime = Date.now() qr.spoiler = if $('.postarea label') then '' else '' - qr.acceptFiles = $('.rules').textContent.match(/: (.+) /)[1].replace /\w+/g, (type) -> + qr.acceptFiles = $('.rules').textContent.match(/: (.+)/)[1].replace /\w+/g, (type) -> switch type when 'JPG' 'image/JPEG'