From cf837edfbb44edc36c07f37ea783f6d253cad456 Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 28 Oct 2026 12:18:21 -0400 Subject: [PATCH] Recherche partout (#68) : JS compatible ESM (test ObsiGate) --- static/js/recherche.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/static/js/recherche.js b/static/js/recherche.js index 77aec9f..3f396bd 100644 --- a/static/js/recherche.js +++ b/static/js/recherche.js @@ -39,6 +39,10 @@ */ (function (global) { "use strict"; + /* globalThis : le fichier est chargé comme script classique dans les + * navigateurs, requis en CJS par les tests TikTak/Kanbante/Flowdeck, + * et importé en ESM par le test ObsiGate (frontend/js est "type": + * "module") — où `this` de niveau supérieur vaut undefined. */ var PROD = { obsigate: "https://og.dracodev.net/", @@ -501,4 +505,10 @@ } else { init(); } -})(typeof window !== "undefined" ? window : this); +})( + typeof window !== "undefined" + ? window + : typeof globalThis !== "undefined" + ? globalThis + : this +);