We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ed9203 commit 8d58707Copy full SHA for 8d58707
unity/Assets/WebGLTemplates/Modern/index.html
@@ -86,6 +86,10 @@
86
}
87
88
89
+
90
+ function confirmUnload(event) {
91
+ return confirm("All unsaved progress will be lost.");
92
+ }
93
94
var buildUrl = "Build";
95
var loaderUrl = buildUrl + "/{{{ LOADER_FILENAME }}}";
@@ -142,6 +146,10 @@
142
146
progressBarFull.style.width = 100 * progress + "%";
143
147
}).then((unityInstance) => {
144
148
loadingBar.style.display = "none";
149
150
+ // If you want to warn the player before they close the tab,
151
+ // uncomment the following:
152
+ //window.onbeforeunload = confirmUnload;
145
153
}).catch((message) => {
154
alert(message);
155
});
@@ -151,4 +159,4 @@
159
document.onfullscreenchange = rebuildFullscreenGUI;
160
</script>
161
</body>
-</html>
162
+</html>
0 commit comments