We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fb6505 commit e075d0dCopy full SHA for e075d0d
packages/ide/src/client.ts
@@ -35,9 +35,12 @@ export abstract class IdeClient {
35
36
let appWindow: Window | undefined;
37
38
- window.onbeforeunload = () => {
39
- return "Are you sure you want to navigate away?";
40
- }
+ window.addEventListener("beforeunload", (e) => {
+ let confirmationMessage = "Are you sure you want to navigate away?";
+ (e || window.event).returnValue = confirmationMessage; //IE
41
+
42
+ return confirmationMessage; // webkit, safari, chrome
43
+ });
44
45
window.addEventListener("message", (event) => {
46
if (event.data === "app") {
0 commit comments