diff --git a/src/csui/PlayerUiBase.vue b/src/csui/PlayerUiBase.vue index 1783fc0..807d58b 100644 --- a/src/csui/PlayerUiBase.vue +++ b/src/csui/PlayerUiBase.vue @@ -225,7 +225,7 @@ export default { * to the correct function down the line. */ handleMessage(event) { - console.log('[handleMessage] will handle event:', event) + if (event.data.action === 'uwui-probe') { if (event.data.cmd === 'uwui-probe') { if (!this.site) { this.site = event.origin.split('//')[1]; diff --git a/src/ext/lib/uwui/UI.js b/src/ext/lib/uwui/UI.js index e1a5c1c..bf35c81 100644 --- a/src/ext/lib/uwui/UI.js +++ b/src/ext/lib/uwui/UI.js @@ -71,7 +71,6 @@ class UI { } } - console.warn('coords:', coords, 'uiURI:', uiURI); // ask the iframe to check whether there's a clickable element iframe.contentWindow.postMessage( @@ -90,7 +89,6 @@ class UI { } rootDiv.appendChild(iframe); - console.log('ui created') // subscribe to events coming back to us window.addEventListener('message', (event) => this.handleMessage(event)); @@ -106,14 +104,12 @@ class UI { handleMessage(event) { console.log('[main] received event:', event.origin, this.uiURI, this.extensionBase, event) if (event.origin === this.extensionBase) { - console.log('this is the event we want', this.uiIframe ); + if (event.data.action === 'uwui-clickable') { if (event.data.cmd === 'uwui-clickable') { if (event.data.ts < this.lastProbeResponseTs) { - console.log('event too early') return; } this.lastProbeResponseTs = event.data.ts; - console.log('---- event is clickable?', event.data.clickable) this.uiIframe.style.pointerEvents = event.data.clickable ? 'auto' : 'none'; } }