This is a pre-release. djust 1.0.0 has shipped since: read the djust 1.0.0 release notes.
Before you upgrade, read the upgrade guide.
Fixed
- Cross-origin
dj-navigate/live_redirect/live_patchno longer throwsSecurityError(#1599). Reported from production djust.org: clicking<a dj-navigate="https://djustlive.com/">(or any cross-origin URL) crashed the JS runtime withUncaught SecurityError: Failed to execute 'pushState' on 'History': A history state object with URL 'https://djustlive.com/' cannot be created in a document with origin 'https://djust.org'. Root cause:handleLiveRedirect()andhandleLivePatch()inpython/djust/static/djust/src/18-navigation.jsboth buildnewUrl = new URL(data.path, window.location.origin)— whendata.pathis an absolute URL, theURL()base argument is ignored, sonewUrlbecomes the cross-origin URL. The subsequentpushStatethen triggers the browser's same-origin policy (history API forbids cross-origin pushState). Fix: detectnewUrl.origin !== window.location.originBEFORE the pushState call in both handlers; on cross-origin, fall back towindow.location.href = newUrl.toString()which performs a full-page navigation — the caller's intent — and avoids the crash. Preserves all same-origin behavior unchanged._executePatch()(thedj-patchclick handler) was incidentally safe because it buildsnewUrlfromwindow.location.hrefand only overwrites pathname when patchValue starts with/— but a defense-in-depth grep for this pattern in nav-touching code is a candidate Stage 11 reviewer check (filed as candidate action-tracker rule). Covered by 3 new regression cases intests/js/navigation.test.jsunder theissue #1599 — cross-origin pushState guarddescribe block:handleLiveRedirect with cross-origin path does NOT call pushState,handleLivePatch with cross-origin path does NOT call pushState, andsame-origin paths still use pushState (regression backstop for guard breadth). Gate-the-fix-off self-test (Action #1200/#1468) passes: stripping both cross-origin guards from the source, exactly 2 of 24 navigation tests fail (the cross-origin cases) — the same-origin backstop + all 21 pre-existing tests continue to pass.