aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library_browser.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js
index 6b2dfeff..c42cef14 100644
--- a/src/library_browser.js
+++ b/src/library_browser.js
@@ -69,6 +69,11 @@ mergeInto(LibraryManager.library, {
#endif
// Set the background of the WebGL canvas to black
canvas.style.backgroundColor = "black";
+
+ // Warn on context loss
+ canvas.addEventListener('webglcontextlost', function(event) {
+ alert('WebGL context lost. You will need to reload the page.');
+ }, false);
}
if (setInModule) {
Module.ctx = ctx;