hakimel 3 年之前
父节点
当前提交
31407082eb
共有 5 个文件被更改,包括 8 次插入2 次删除
  1. 0 0
      plugin/math/math.esm.js
  2. 0 0
      plugin/math/math.js
  3. 0 0
      plugin/notes/notes.esm.js
  4. 0 0
      plugin/notes/notes.js
  5. 8 2
      plugin/notes/plugin.js

文件差异内容过多而无法显示
+ 0 - 0
plugin/math/math.esm.js


文件差异内容过多而无法显示
+ 0 - 0
plugin/math/math.js


文件差异内容过多而无法显示
+ 0 - 0
plugin/notes/notes.esm.js


文件差异内容过多而无法显示
+ 0 - 0
plugin/notes/notes.js


+ 8 - 2
plugin/notes/plugin.js

@@ -203,8 +203,14 @@ const Plugin = () => {
 					// that we remain connected to the notes even if the presentation
 					// that we remain connected to the notes even if the presentation
 					// is reloaded.
 					// is reloaded.
 					window.addEventListener( 'message', event => {
 					window.addEventListener( 'message', event => {
-						if( !speakerWindow ) {
-							let data = JSON.parse( event.data );
+						if( !speakerWindow && typeof event.data === 'string' ) {
+							let data;
+
+							try {
+								data = JSON.parse( event.data );
+							}
+							catch( error ) {}
+
 							if( data && data.namespace === 'reveal-notes' && data.type === 'heartbeat' ) {
 							if( data && data.namespace === 'reveal-notes' && data.type === 'heartbeat' ) {
 								reconnectSpeakerWindow( event.source );
 								reconnectSpeakerWindow( event.source );
 							}
 							}

部分文件因为文件数量过多而无法显示