diff --git a/4chan_x.user.js b/4chan_x.user.js index a4b74be2c..89fe9fbf3 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1223,7 +1223,7 @@ $.before(form, link); } g.callbacks.push(this.node); - if (engine === 'webkit') { + if (/chrome/i.test(navigator.userAgent)) { qr.status({ ready: true }); @@ -1832,7 +1832,7 @@ reader.readAsBinaryString(reply.file); return; } - if (engine === 'webkit') { + if (/chrome/i.test(navigator.userAgent)) { qr.message.post(post); return; } diff --git a/changelog b/changelog index 6560e094b..496914583 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Fix posting on Safari. 2.26.4 - Mayhem diff --git a/script.coffee b/script.coffee index d2b2d593a..57b15dd6d 100644 --- a/script.coffee +++ b/script.coffee @@ -900,7 +900,8 @@ qr = $.before form, link g.callbacks.push @node - if engine is 'webkit' + # CORS is ignored for content script on Chrome, but not Safari/Oprah/Firefox. + if /chrome/i.test navigator.userAgent qr.status ready: true else iframe = $.el 'iframe', @@ -1405,7 +1406,8 @@ qr = reader.readAsBinaryString reply.file return - if engine is 'webkit' + # CORS is ignored for content script on Chrome, but not Safari/Oprah/Firefox. + if /chrome/i.test navigator.userAgent qr.message.post post return qr.message.send post