---
name: "up:location:restore"
area: "API"
kind: "DOM event"
parent: "up.history module"
url: "https://unpoly.com/api/up:location:restore"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.history module](https://unpoly.com/api/up.history.md)</nav>

# up:location:restore

This event is emitted when the user is [restoring a previous history entry](https://unpoly.com/learn/restoring-history.md), usually by pressing the back button.

Listeners may prevent `up:location:restore` or mutate `event.renderOptions` to [customize the restoration behavior](https://unpoly.com/learn/restoring-history.md#custom-behavior).

When this event is emitted, the [browser location](https://unpoly.com/api/up.history.location.md) has already been updated.

<nav aria-label="Guides">

- [Learn: Restoring history](https://unpoly.com/learn/restoring-history.md)

</nav>

---

## Event properties {#properties}

### event.location {#event.location}

(required)

The URL for the restored history entry.

Type: string

### event.renderOptions {#event.renderOptions}

(required)

An object with [render options](https://unpoly.com/api/up.render.md#parameters) for the render pass that will restore content for this history entry.

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

Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects)

### event.preventDefault() {#event.preventDefault}

(required)

Prevents Unpoly from restoring content for this history entry.

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

