htmx
htmx copied to clipboard
Add handleHistorySwap extension function
Closes #749.
This adds handleHistorySwap as a method for extensions to allow them to control the HTML swapping of browser history behavior. I considered just adding a new swapType of history and keep using handleSwap, but my concern was that older extensions wouldn't necessarily know to check for that and might start behaving incorrectly.
I didn't add any tests since history didn't have any, but I saw there were manual tests for it. If this is an acceptable change, I could add some manual test pages for it too.
Would it be possible to add a manual test for this in test/manual?
Pinging again on tests and docs on this. I'm going to cut a 1.7 release in a week or so, so lmk if you want it in for that.
Closing this PR because it's a year and a half old. Feel free to rebase and re-open if you're still interested.
Apologies on letting this go stale. Not currently working on the project I used htmx for so no worries, if someone else finds a need for this they can pick it back up!