From a4cef67e14d9ae4cc58438bd47e44f60f1fd7579 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Wed, 22 Sep 2021 11:39:41 -0300 Subject: [PATCH] FIX: Feature detect globalThis (#14410) * FIX: Feature detect globalThis So browsers without support will receive a warning and browse our JS-less view. --- app/assets/javascripts/browser-detect.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/browser-detect.js b/app/assets/javascripts/browser-detect.js index c13298dbb4f..3b93c144997 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