From d3cf221e779b1242c0d9a77651be86cf0ee42245 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 21 Jun 2015 15:13:04 -0700 Subject: [PATCH] Trying to access contentWindow caused error in FF+Greasemonkey. This works in both FF and Chromium. --- src/General/lib/connection.class | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/General/lib/connection.class b/src/General/lib/connection.class index ee23674ec..fc2c001be 100644 --- a/src/General/lib/connection.class +++ b/src/General/lib/connection.class @@ -3,7 +3,10 @@ class Connection $.on window, 'message', @onMessage targetWindow: -> - @target.contentWindow or @target + if @target instanceof window.HTMLIFrameElement + @target.contentWindow + else + @target send: (data) => @targetWindow().postMessage "#{g.NAMESPACE}#{JSON.stringify data}", @origin