diff --git a/4chan_x.user.js b/4chan_x.user.js index 1475c7552..3623f8d83 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1836,7 +1836,7 @@ }); ta.style.cssText = $.get('QR.size', ''); } - mimeTypes = $('ul.rules').firstElementChild.textContent.match(/: (.+) /)[1].toLowerCase().replace(/\w+/g, function(type) { + mimeTypes = $('ul.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { switch (type) { case 'jpg': return 'image/jpeg'; diff --git a/script.coffee b/script.coffee index d15e27bcc..2d8f49d5d 100644 --- a/script.coffee +++ b/script.coffee @@ -1403,7 +1403,7 @@ QR = ta.style.cssText = $.get 'QR.size', '' # Allow only this board's supported files. - mimeTypes = $('ul.rules').firstElementChild.textContent.match(/: (.+) /)[1].toLowerCase().replace /\w+/g, (type) -> + mimeTypes = $('ul.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) -> switch type when 'jpg' 'image/jpeg'