Skip to content

Commit d54d6e3

Browse files
committed
Support Firefox Reality on Hololens 2
1 parent 3156232 commit d54d6e3

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Assets/WebGLTemplates/WebXR/webxr.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,15 @@
451451
initWebXRManager();
452452
}
453453
}
454+
455+
// A workaround to make it work under Firefox Reality that does not implement isContextLost()
456+
// Thanks Rufus31415
457+
// https://github.com/Rufus31415/Simple-WebXR-Unity/blob/28331fc890e316e13401618a8e0da1e84bad7a39/Assets/SimpleWebXR.jspre#L6
458+
if(!WebGLRenderingContext.prototype.isContextLost) {
459+
WebGLRenderingContext.prototype.isContextLost = function() {
460+
return false;
461+
}
462+
}
454463

455464
init();
456465
})();

Assets/WebGLTemplates/WebXRFullView/webxr.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,15 @@
451451
initWebXRManager();
452452
}
453453
}
454+
455+
// A workaround to make it work under Firefox Reality that does not implement isContextLost()
456+
// Thanks Rufus31415
457+
// https://github.com/Rufus31415/Simple-WebXR-Unity/blob/28331fc890e316e13401618a8e0da1e84bad7a39/Assets/SimpleWebXR.jspre#L6
458+
if(!WebGLRenderingContext.prototype.isContextLost) {
459+
WebGLRenderingContext.prototype.isContextLost = function() {
460+
return false;
461+
}
462+
}
454463

455464
init();
456465
})();

Build/webxr.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,15 @@
451451
initWebXRManager();
452452
}
453453
}
454+
455+
// A workaround to make it work under Firefox Reality that does not implement isContextLost()
456+
// Thanks Rufus31415
457+
// https://github.com/Rufus31415/Simple-WebXR-Unity/blob/28331fc890e316e13401618a8e0da1e84bad7a39/Assets/SimpleWebXR.jspre#L6
458+
if(!WebGLRenderingContext.prototype.isContextLost) {
459+
WebGLRenderingContext.prototype.isContextLost = function() {
460+
return false;
461+
}
462+
}
454463

455464
init();
456465
})();

0 commit comments

Comments
 (0)