remove some console.logs

This commit is contained in:
Tamius Han 2022-03-22 01:21:18 +01:00
parent 1cd06040da
commit 3423aac49a
2 changed files with 2 additions and 6 deletions

View File

@ -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];

View File

@ -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';
}
}