diff --git a/4chan_x.user.js b/4chan_x.user.js index 7b2a01f44..f18158fa6 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1841,7 +1841,7 @@ }); ta.style.cssText = $.get('QR.size', ''); } - mimeTypes = $('.rules').firstChild.textContent.match(/: (.+) /)[1].toLowerCase().replace(/\w+/g, function(type) { + mimeTypes = $('.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { switch (type) { case 'jpg': return 'image/jpeg'; diff --git a/changelog b/changelog index f8413bbd0..01f9474ed 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - Mayhem Auto-GIF will not run in /gif/. + Fix QR filetype checking. 2.29.3 - Mayhem diff --git a/script.coffee b/script.coffee index 8e930ed96..0b0e49333 100644 --- a/script.coffee +++ b/script.coffee @@ -1405,7 +1405,7 @@ QR = ta.style.cssText = $.get 'QR.size', '' # Allow only this board's supported files. - mimeTypes = $('.rules').firstChild.textContent.match(/: (.+) /)[1].toLowerCase().replace /\w+/g, (type) -> + mimeTypes = $('.rules').firstElementChild.textContent.match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) -> switch type when 'jpg' 'image/jpeg'