Edit this page

up.history up:location:restore
DOM event

This event is emitted when the user is restoring a previous history entry, usually by pressing the back button.

Listeners may prevent up:location:restore or mutate event.renderOptions to customize the restoration behavior.

When this event is emitted, the browser location has already been updated.

Restoring history


Event properties

event.location
required

The URL for the restored history entry.

string
event.renderOptions
required

An object with render options for the render pass that will restore content for this history entry.

Listeners may inspect and modify these options. Render options cannot stop the browser from restoring the URL in the address bar.

event.preventDefault()
required

Prevent Unpoly from restoring content for this history entry.

Preventing the event will not stop the browser from restoring the URL in the address bar.