Skip to content

Commit 73a6fb2

Browse files
author
John McCambridge
committed
Refactor for compatability
1 parent 956f143 commit 73a6fb2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/ide/src/client.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ export abstract class IdeClient {
3636
let appWindow: Window | undefined;
3737

3838
window.addEventListener("beforeunload", (e) => {
39-
const confirmationMessage = "Are you sure you want to navigate away?";
40-
(e || window.event).returnValue = confirmationMessage; //IE
41-
42-
return confirmationMessage; // webkit, safari, chrome
39+
e.preventDefault(); // FireFox
40+
e.returnValue = ""; // Chrome
4341
});
4442

4543
window.addEventListener("message", (event) => {

0 commit comments

Comments
 (0)