From 97902bbfcc6fdbeab24c462484593dfd7c8cd45b Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 20 Feb 2012 21:36:43 +0100 Subject: [PATCH] Fix #248. --- 4chan_x.user.js | 4 ++-- changelog | 2 ++ script.coffee | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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