Releases: Digicreon/muJS
1.4.8
New feature
Fix non-GET clicks using prefetch cache and adding to history.
The "&" character in mu-target and mu-patch-target is replaced by the trigger element's ID selector, enabling relative targeting without server-generated IDs. If the trigger has no ID, one is auto-generated. Useful for reusable components (e.g. mu-target="& > .list").
Debug
Fix non-GET clicks using prefetch cache and adding to history.
Non-GET requests (POST, PUT, PATCH, DELETE) triggered by click on elements with mu-method were incorrectly treated as navigation: served from prefetch cache, stored in cache, and added to browser history. Now prefetch cache is skipped for non-GET methods in _loadExec, and _onClick defaults to history=false for non-GET methods (same as _onSubmit already does for non-GET forms). Also harmonized HTTP method comparisons in _loadExec to use lowercase like the rest of the codebase.
1.4.7
1.4.6
Fix hash link navigation triggering full page reload
Remove location.reload() fallback in _onPopState when state has no µJS flag. Browsers may fire popstate for #fragment navigation with null state, causing an unwanted reload. Simply ignoring non-µJS popstate entries is safer — this also removes the root cause of the Safari infinite loop.
1.4.5
Fix Safari infinite loop in _onPopState
Replace window.location.href assignment with location.reload() to prevent Safari from firing a spurious popstate event on same-URL assignment. Also skip _saveScroll during popstate — the history entry has already changed to the destination, so saving scroll would overwrite the wrong state.
Fix head element deduplication when tagName is lowercase
Normalize tagName with toUpperCase() in _elKey and _mergeHead before comparison. Prevents duplicate <link> and <style> elements from being added to <head> when the browser returns lowercase tagNames (e.g. XHTML documents served as application/xhtml+xml).
1.4.4
Support relative URLs and absolute same-origin URLs.
URLs like "../page.html", "page.html", and "https://same-domain.com/page" are now resolved and intercepted.
Previously, only paths starting with "/" were processed. Uses native URL constructor with same-origin check.
Refactor: code factorization.
Refactor: reduce minified size (progress bar cssText, deduplicate hasAttribute checks)
1.4.3
Debug
Fix View Transition timing and form Content-Type.
mu:after-render,pushStateandscrollran beforestartViewTransition()applied the DOM update. Post-render logic now waits forupdateCallbackDone.- Form POST sent
multipart/form-dataregardless of enctype. Now sends URL-encoded by default, multipart only forenctype="multipart/form-data".
1.4.2
1.4.1
1.4.0
Features
- 9 injection modes:
replace,update,prepend,append,before,after,remove,none,patch - Patch mode: multiple DOM fragments updated in a single response
- Forms: GET and POST, HTML5 validation, custom validation (
mu-validate), quit confirmation (mu-confirm-quit) - HTTP methods:
GET,POST,PUT,PATCH,DELETEviamu-method - Triggers:
click,submit,change,blur,focus,loadviamu-trigger - Debounce (
mu-debounce) and polling (mu-repeat) - Server-Sent Events via
mu-method="sse" - Prefetch on hover (50 ms delay, GET only)
- Independent
mu-historyandmu-scrollcontrols with context-dependent defaults - Scroll restoration on back/forward navigation
- DOM morphing via Idiomorph (optional, auto-detected)
- View Transitions API support (optional, auto-detected)
- Built-in progress bar
- Additive
<head>merging (stylesheets, scripts) - Link filtering: external URLs,
target,download, modifier keys,mu-disabled - Custom events:
mu:init,mu:before-fetch,mu:before-render,mu:after-render,mu:fetch-error
Stats
- Single file, no dependencies
- Source: 59 KB / Minified: 15 KB / Gzipped: 4.9 KB
Browser support
Chrome 66+, Firefox 57+, Safari 12.1+, Edge 79+