From 9d8251362957691c067dc14e35bad09f131ca423 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Sun, 8 Mar 2026 12:14:52 +0100 Subject: [PATCH] tell htmx about nonce attributes --- cmd/web/client/html/header.html | 2 ++ cmd/web/client/js/index.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/cmd/web/client/html/header.html b/cmd/web/client/html/header.html index d498c4d..e2c2d55 100644 --- a/cmd/web/client/html/header.html +++ b/cmd/web/client/html/header.html @@ -23,6 +23,8 @@
diff --git a/cmd/web/client/js/index.js b/cmd/web/client/js/index.js index c1adc10..1987729 100644 --- a/cmd/web/client/js/index.js +++ b/cmd/web/client/js/index.js @@ -20,6 +20,10 @@ window._hyperscript.browserInit() // script changes htmx.config.allowScriptTags = false; +// attempt to fix the problems reported by some users +htmx.config.inlineScriptNonce = window.scriptNonce; +htmx.config.inlineStyleNonce = window.styleNonce; + // Define JSON encoding extension for htmx htmx.defineExtension('json-enc', { onEvent: function (name, evt) {