clean up redirect tab

This commit is contained in:
Simon Knott 2024-11-08 15:21:33 +01:00
parent 44364f3b64
commit cf0d3ecf57
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -325,8 +325,10 @@ class HtmlBuilder {
const hmrURL = new URL('http://localhost:44224'); // dev server, port is harcoded in build.js
const popup = window.open(hmrURL);
window.addEventListener('message', evt => {
if (evt.source === popup && evt.data === 'ready')
if (evt.source === popup && evt.data === 'ready') {
popup!.postMessage((window as any).playwrightReportBase64, hmrURL.origin);
window.close();
}
}, { once: true });
}