From db57564cbca8732132c88e24673f6a0bc64151ae Mon Sep 17 00:00:00 2001 From: Udo Schroeter Date: Tue, 6 Feb 2024 14:31:37 +0100 Subject: [PATCH] Fix NW.JS compatibility When running on NW, Howler mistakenly detects the environment as Node.js, breaking pure web apps on the platform. By removing the else statement, the Howler object is available in both the global AND the window context. --- src/howler.core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/howler.core.js b/src/howler.core.js index 5198bdfc..ec10ac0a 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -2578,7 +2578,8 @@ global.Howler = Howler; global.Howl = Howl; global.Sound = Sound; - } else if (typeof window !== 'undefined') { // Define globally in case AMD is not available or unused. + } + if (typeof window !== 'undefined') { // Define globally in case AMD is not available or unused. window.HowlerGlobal = HowlerGlobal; window.Howler = Howler; window.Howl = Howl;