This feature is experimental. Please share your experiences so we know what to keep or change.
Adds a new history entry and updates the browser's address bar.
Does not add a history entry if the given URL is already the current browser location.
If the URL did change, an event up:location:changed
is emitted.
When navigating (or rendering with { history: true }
)
Unpoly will update the browser location for you. You only need to call up.history.push()
to push
a new entry without rendering.
The new history entry will be owned by Unpoly. When the user navigates back to this history entry, Unpoly will restore the content at that URL.
To push a history entry that you want to restore yourself, use the browser's
history.pushState()
function,
or handle the up:location:changed
event.
The URL for the history entry to be added.