khalidabuhakmeh, I made a ServiceWorker intercept #HTMX calls and manage state inside of the ServiceWorker process all in-browser.
The downside is it takes a few seconds for the service worker lifecycle to start, so it's likely only available on page refreshes. Still a neat concept.
Service worker handling click events for HTMX with count going up on each click.