Browse Source

fixes for firefox bug

https://bugzilla.mozilla.org/show_bug.cgi?id=1633280
Gregg Tavares 5 years ago
parent
commit
568309e9e0
2 changed files with 6 additions and 4 deletions
  1. 4 2
      threejs/resources/lessons-helper.js
  2. 2 2
      threejs/resources/lessons-worker-helper.js

+ 4 - 2
threejs/resources/lessons-helper.js

@@ -389,16 +389,18 @@
     setupLesson = function() {};
 
     if (canvas) {
-      canvas.addEventListener('webglcontextlost', function(e) {
+      canvas.addEventListener('webglcontextlost', function() {
           // the default is to do nothing. Preventing the default
           // means allowing context to be restored
-          e.preventDefault();
+          // e.preventDefault();  // can't do this because firefox bug - https://bugzilla.mozilla.org/show_bug.cgi?id=1633280
           addContextLostHTML();
       });
+      /* can't do this because firefox bug - https://bugzilla.mozilla.org/show_bug.cgi?id=1633280
       canvas.addEventListener('webglcontextrestored', function() {
           // just reload the page. Easiest.
           window.location.reload();
       });
+      */
     }
 
     if (isInIFrame()) {

+ 2 - 2
threejs/resources/lessons-worker-helper.js

@@ -79,10 +79,10 @@
     setupLesson = function() {};
 
     if (canvas) {
-      canvas.addEventListener('webglcontextlost', function(e) {
+      canvas.addEventListener('webglcontextlost', function() {
           // the default is to do nothing. Preventing the default
           // means allowing context to be restored
-          e.preventDefault();
+          // e.preventDefault();  // can't do this because firefox bug - https://bugzilla.mozilla.org/show_bug.cgi?id=1633280
           sendMessage({
             type: 'lostContext',
           });