diff --git a/web/app/assets/javascripts/react-components/MediaControls.js.jsx.coffee b/web/app/assets/javascripts/react-components/MediaControls.js.jsx.coffee index 024f11103..5a2106c81 100644 --- a/web/app/assets/javascripts/react-components/MediaControls.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/MediaControls.js.jsx.coffee @@ -7,6 +7,8 @@ mixins = [] # this check ensures we attempt to listen if this component is created in a popup reactContext = if window.opener? then window.opener else window +# make sure this is actually us opening the window, not someone else (by checking for MixerStore) +reactContext = window unless 'MixerStore' in reactContext MixerStore = reactContext.MixerStore MixerActions = reactContext.MixerActions diff --git a/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee index 235fc1fd2..cada895b8 100644 --- a/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee @@ -3,7 +3,10 @@ logger = context.JK.logger mixins = [] -if window.opener? + +# make sure this is actually us opening the window, not someone else (by checking for MixerStore) + +if window.opener? && ('MixerStore' in window.opener) SessionActions = window.opener.SessionActions MediaPlaybackStore = window.opener.MediaPlaybackStore MixerActions = window.opener.MixerActions diff --git a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee index 7cb29df6e..a57836e76 100644 --- a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee @@ -2,8 +2,8 @@ context = window mixins = [] -# this check ensures we attempt to listen if this component is created in a popup -if window.opener +# make sure this is actually us opening the window, not someone else (by checking for MixerStore) +if window.opener && ('MixerStore' in window.opener) mixins.push(Reflux.listenTo(window.opener.RecordingStore,"onRecordingStateChanged")) @PopupRecordingStartStop = React.createClass({