htmx.config.extensions
Restricts extension registration by name
The htmx.config.extensions option restricts extension registration to listed names.
<meta name="htmx-config" content='extensions:"preload,hx-pending"'> <script src="/htmx.js"></script> <script src="/hx-preload.js"></script> <script src="/hx-pending.js"></script>
Both extension scripts still need to be loaded. The config only controls whether their calls to htmx.registerExtension() succeed.
Default
""
An empty string allows every loaded extension to register.
Extension Names
List names passed to htmx.registerExtension(), separated by commas:
htmx.registerExtension('preload', { /* ... */ })
htmx.registerExtension('hx-pending', { /* ... */ }) Configure Before Loading htmx
htmx reads the extension allowlist during initialization. Put the htmx-config meta element before the htmx script.
Changing htmx.config.extensions afterward does not change the active allowlist.
See Also
Licensed under the Zero-Clause BSD License.
https://four.htmx.org/reference/config/htmx-config-extensions/