From 36b6699cde5adf15d6bbcaf9f4b1442d644c52a4 Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 27 Aug 2015 08:12:47 -0500 Subject: [PATCH] * validate popup VRFS-3419 --- .../javascripts/react-components/MediaControls.js.jsx.coffee | 2 ++ .../react-components/PopupMediaControls.js.jsx.coffee | 5 ++++- .../react-components/PopupRecordingStartStop.js.jsx.coffee | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) 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({