|
@@ -383,6 +383,13 @@
|
|
|
|
|
|
window.addEventListener( 'message', function( event ) {
|
|
window.addEventListener( 'message', function( event ) {
|
|
|
|
|
|
|
|
+ // Validate the origin of all messages to avoid parsing messages
|
|
|
|
+ // that aren't meant for us. Ignore when running off file:// so
|
|
|
|
+ // that the speaker view continues to work without a web server.
|
|
|
|
+ if( window.location.origin !== event.origin && window.location.origin !== 'file://' ) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
clearTimeout( connectionTimeout );
|
|
clearTimeout( connectionTimeout );
|
|
connectionStatus.style.display = 'none';
|
|
connectionStatus.style.display = 'none';
|
|
|
|
|