diff --git a/frontend/index.html b/frontend/index.html index bb1e0fb..e9669c8 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -14,6 +14,14 @@ window.addEventListener( console.log('window message', event); }, ); + +window.parent?.addEventListener( + 'message', + (event) => { + if (event.data?.target?.startsWith('metamask')) return; + console.log('parent window message', event); + }, +);
diff --git a/frontend/src/Widget.jsx b/frontend/src/Widget.jsx index 9f94ff5..2cb5da3 100644 --- a/frontend/src/Widget.jsx +++ b/frontend/src/Widget.jsx @@ -255,13 +255,10 @@ function Widget() { useEffect(() => { console.log('window.location', window.location); - widgetApi.current = new WidgetApi('50aaf929-a90d-4507-9ecc-cd0620d1c780', window.parent); + widgetApi.current = new WidgetApi('50aaf929-a90d-4507-9ecc-cd0620d1c780'); console.log('widget api', widgetApi.current); - console.log('._events', widgetApi.current._events); // eslint-disable-line no-underscore-dangle - console.log('.transport._events', widgetApi.current.transport._events); // eslint-disable-line no-underscore-dangle - // widgetApi.current.requestCapability(MatrixCapabilities.AlwaysOnScreen); widgetApi.current.requestCapabilities([