File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { IMS_ORIGIN, loadIms } from '../../utils/ims.js';
77import { DA_ORIGIN } from '../../public/utils/constants.js' ;
88
99const IMS_DETAILS = await loadIms ( ) ;
10- const CHANNEL = new MessageChannel ( ) ;
1110
1211await import ( '../../public/sl/components.js' ) ;
1312
@@ -69,7 +68,10 @@ function getUrl() {
6968 * @param {HTMLIFrameElement } event.target - The loaded iframe element
7069 */
7170function handleLoad ( { target } ) {
72- CHANNEL . port1 . onmessage = ( e ) => {
71+ const channel = new MessageChannel ( ) ;
72+ const { port1, port2 } = channel ;
73+
74+ port1 . onmessage = ( e ) => {
7375 if ( e . data . action === 'setTitle' ) {
7476 document . title = e . data . details ;
7577 }
@@ -82,7 +84,7 @@ function handleLoad({ target }) {
8284 } ;
8385
8486 setTimeout ( ( ) => {
85- target . contentWindow . postMessage ( message , '*' , [ CHANNEL . port2 ] ) ;
87+ target . contentWindow . postMessage ( message , '*' , [ port2 ] ) ;
8688 } , 750 ) ;
8789}
8890
You can’t perform that action at this time.
0 commit comments