FIX: Feature detect globalThis (#14410)

FIX: Feature detect globalThis (#14410)

  • FIX: Feature detect globalThis

So browsers without support will receive a warning and browse our JS-less view.

diff --git a/app/assets/javascripts/browser-detect.js b/app/assets/javascripts/browser-detect.js
index c13298d..3b93c14 100644
--- a/app/assets/javascripts/browser-detect.js
+++ b/app/assets/javascripts/browser-detect.js
@@ -1,4 +1,4 @@
-if (!window.WeakMap || !window.Promise) {
+if (!window.WeakMap || !window.Promise || typeof globalThis === "undefined") {
   window.unsupportedBrowser = true;
 } else {
   // Some implementations of `WeakMap.prototype.has` do not accept false

GitHub sha: a4cef67e14d9ae4cc58438bd47e44f60f1fd7579

This commit appears in #14410 which was approved by pmusaraj. It was merged by Falco.