Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Editorial review: Add docs for notRestoredReasons #32920

Merged
merged 69 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
7fa1cdf
Adds docs for notRestoredReasons
chrisdavidmills Jul 14, 2023
79a4efb
Merge branch 'main' into notrestoredreasons
chrisdavidmills Jul 17, 2023
e039269
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Jul 17, 2023
3c288fb
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Jul 17, 2023
2779495
Making fixes for review comments from tunetheweb and Josh-Cena
chrisdavidmills Jul 17, 2023
55dcabe
Merge branch 'main' into notrestoredreasons
chrisdavidmills Jul 17, 2023
b3640fd
Add explainer link
chrisdavidmills Jul 17, 2023
4210490
Merge branch 'notrestoredreasons' of github.com:chrisdavidmills/conte…
chrisdavidmills Jul 17, 2023
9bd464a
Merge branch 'main' into notrestoredreasons
chrisdavidmills Jul 20, 2023
827ee71
Merge branch 'main' into notrestoredreasons
chrisdavidmills Oct 10, 2023
bc5cd31
Add content to explain NotRestoredReasons empty cases
chrisdavidmills Oct 10, 2023
fa9b2b1
Make small change to regenerate preview pages
chrisdavidmills Mar 21, 2024
7dc4028
Update content for final implementation of notRestoredReasons
chrisdavidmills Mar 27, 2024
30a8cfb
Merge branch 'main' into notrestoredreasons
chrisdavidmills Mar 27, 2024
4e5e37e
Fixes for tunetheweb review comments
chrisdavidmills Mar 29, 2024
b9c2066
Merge branch 'main' into notrestoredreasons
chrisdavidmills Mar 29, 2024
c3418d4
Update files/en-us/web/api/notrestoredreasons/index.md
chrisdavidmills Apr 5, 2024
0ef8e2a
Update files/en-us/web/api/notrestoredreasondetails/index.md
chrisdavidmills Apr 5, 2024
8849f1d
Update files/en-us/web/api/notrestoredreasons/index.md
chrisdavidmills Apr 5, 2024
f927124
Update files/en-us/web/api/performancenavigationtiming/index.md
chrisdavidmills Apr 5, 2024
e0bb956
Update files/en-us/web/api/notrestoredreasons/tojson/index.md
chrisdavidmills Apr 5, 2024
c7613a0
Update files/en-us/web/api/notrestoredreasondetails/tojson/index.md
chrisdavidmills Apr 5, 2024
e097dea
Merge branch 'main' into notrestoredreasons
chrisdavidmills Apr 5, 2024
46ebe06
Fix linter errors
chrisdavidmills Apr 5, 2024
2d38733
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
a078e52
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
2a39a6e
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
b3a0250
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
27eb90b
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
bd377c7
Update files/en-us/web/api/performance_api/index.md
chrisdavidmills Apr 10, 2024
60023a4
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
f1ee3b8
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
4b421c2
Update files/en-us/web/api/performancenavigationtiming/notrestoredrea…
chrisdavidmills Apr 10, 2024
ea861dd
Update files/en-us/web/api/performancenavigationtiming/notrestoredrea…
chrisdavidmills Apr 10, 2024
dcc0ccc
Update files/en-us/web/api/performancenavigationtiming/index.md
chrisdavidmills Apr 10, 2024
d11b03e
Update files/en-us/web/api/notrestoredreasons/reasons/index.md
chrisdavidmills Apr 10, 2024
5848e1d
Update files/en-us/web/api/notrestoredreasons/index.md
chrisdavidmills Apr 10, 2024
db1f261
Update files/en-us/web/api/notrestoredreasondetails/reason/index.md
chrisdavidmills Apr 10, 2024
a1f52cb
Update files/en-us/web/api/notrestoredreasondetails/reason/index.md
chrisdavidmills Apr 10, 2024
aa279ef
Update files/en-us/web/api/notrestoredreasondetails/index.md
chrisdavidmills Apr 10, 2024
cb23c7b
Update files/en-us/web/api/performance_api/reporting_backforward_cach…
chrisdavidmills Apr 10, 2024
34c5dff
Merge branch 'main' into notrestoredreasons
chrisdavidmills Apr 10, 2024
f025cb6
Fixes for Elchi3 review comments, bfcache glossary entry added
chrisdavidmills Apr 10, 2024
16c1f37
Update files/en-us/glossary/bfcache/index.md
chrisdavidmills Apr 12, 2024
afc07ae
Update files/en-us/web/api/notrestoredreasondetails/index.md
chrisdavidmills Apr 12, 2024
c770fde
Update files/en-us/web/api/notrestoredreasondetails/reason/index.md
chrisdavidmills Apr 12, 2024
ccb6a3c
Update files/en-us/web/api/notrestoredreasondetails/tojson/index.md
chrisdavidmills Apr 12, 2024
4615641
Update files/en-us/web/api/performancenavigationtiming/notrestoredrea…
chrisdavidmills Apr 12, 2024
9d9e159
Update files/en-us/web/api/notrestoredreasons/src/index.md
chrisdavidmills Apr 12, 2024
1576c7b
Update files/en-us/web/api/notrestoredreasondetails/reason/index.md
chrisdavidmills Apr 12, 2024
f138aa9
Update files/en-us/web/api/notrestoredreasons/url/index.md
chrisdavidmills Apr 12, 2024
1154a0b
Update files/en-us/web/api/notrestoredreasons/tojson/index.md
chrisdavidmills Apr 12, 2024
6cced22
Update files/en-us/web/api/notrestoredreasons/url/index.md
chrisdavidmills Apr 12, 2024
b680b17
Update files/en-us/web/api/notrestoredreasons/children/index.md
chrisdavidmills Apr 12, 2024
1254e86
Update files/en-us/web/api/notrestoredreasons/children/index.md
chrisdavidmills Apr 12, 2024
ae17c03
Update files/en-us/web/api/notrestoredreasons/src/index.md
chrisdavidmills Apr 12, 2024
5687f85
Update files/en-us/web/api/notrestoredreasons/id/index.md
chrisdavidmills Apr 12, 2024
a492d33
Update files/en-us/web/api/notrestoredreasons/id/index.md
chrisdavidmills Apr 12, 2024
c1b7a89
Update files/en-us/web/api/notrestoredreasons/index.md
chrisdavidmills Apr 12, 2024
31f8220
Update files/en-us/web/api/notrestoredreasons/reasons/index.md
chrisdavidmills Apr 12, 2024
d1b4736
Update files/en-us/web/api/notrestoredreasons/reasons/index.md
chrisdavidmills Apr 12, 2024
e3d87da
Update files/en-us/web/api/notrestoredreasons/index.md
chrisdavidmills Apr 12, 2024
5abb2b3
Update files/en-us/web/api/notrestoredreasons/name/index.md
chrisdavidmills Apr 12, 2024
07c7417
Update files/en-us/web/api/notrestoredreasons/name/index.md
chrisdavidmills Apr 12, 2024
5398fcc
Update files/en-us/web/api/notrestoredreasons/reasons/index.md
chrisdavidmills Apr 12, 2024
a80b30b
Merge branch 'main' into notrestoredreasons
chrisdavidmills Apr 12, 2024
90bc4f6
fix broken link
chrisdavidmills Apr 12, 2024
c0de6c8
Merge branch 'notrestoredreasons' of github.com:chrisdavidmills/conte…
chrisdavidmills Apr 12, 2024
c62199d
Add CC attribution note
chrisdavidmills Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions files/en-us/web/api/notrestoredreasondetails/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: NotRestoredReasonDetails
slug: Web/API/NotRestoredReasonDetails
page-type: web-api-interface
status:
- experimental
browser-compat: api.NotRestoredReasonDetails
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`NotRestoredReasonDetails`** interface of the {{domxref("Performance API", "Performance API", "", "nocode")}} represents a single reason why a navigated page was blocked from using the [back/forward cache (bfcache)](https://web.dev/articles/bfcache).
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

An array of `NotRestoredReasonDetails` objects can be accessed via the {{domxref("NotRestoredReasons.reasons")}} property.

## Instance properties

- {{domxref("NotRestoredReasonDetails.reason", "reason")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : A string describing a reason that the page was blocked from using the back/forward cache.

## Instance methods

- {{domxref("NotRestoredReasonDetails.toJSON", "toJSON()")}} {{Experimental_Inline}}
- : A {{Glossary("Serialization","serializer")}}; returns a JSON representation of the `NotRestoredReasonDetails` object.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
63 changes: 63 additions & 0 deletions files/en-us/web/api/notrestoredreasondetails/reason/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: "NotRestoredReasonDetails: reason property"
short-title: reason
slug: Web/API/NotRestoredReasonDetails/reason
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NotRestoredReasonDetails.reason
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`reason`** read-only property of the
{{domxref("NotRestoredReasonDetails")}} interface returns a string describing a reason that the page was blocked from using the [back/forward cache (bfcache)](https://web.dev/articles/bfcache).
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Value

A string.

There are many different reasons why blocking could occur, and browsers can choose to implement their own specific reasons for blocking, based on how they operate. Developers should avoid depending on specific wording for reasons and be prepared to handle new reasons being added and deleted.

The initial values listed in the specification are:

- `"fetch"`
- : While unloading, a fetch initiated by the current document (e.g. via {{domxref("fetch()")}}) was canceled while ongoing. As a result, the page was not in a stable state that could be stored in the bfcache.
- `"lock"`
- : While unloading, held locks and lock requests were terminated, so the page was not in a stable state that could be stored in the bfcache.
- `"masked"`
- : The exact reason is hidden for privacy purposes. This value can mean one of the following:
- The current document has children contained in a cross-origin {{htmlelement("iframe")}}, and they prevented storage in the bfcache.
- The current Document could not be stored in the bfcache for user agent-specific reasons.
- `"navigation-failure"`
- : The original navigation that created the current document errored, and storing the resulting error document in the bfcache was prevented.
- `"parser-aborted"`
- : The current document never finished its initial HTML parsing, and storing the unfinished document in the bfcache was prevented.
- `"websocket"`
- : While unloading, an open [WebSocket](/en-US/docs/Web/API/WebSockets_API) connect was shut down, so the page was not in a stable state that could be stored in the bfcache.

Additional blocking reasons may be used by some browsers, for example:

- `"unload-listener"`
- : The page registers an [`unload`](/en-US/docs/Web/API/Window/unload_event) handler, which prevents bfcache usage. This serves as a useful warning, as `unload` is deprecated. See [Deprecating the unload event](https://developer.chrome.com/docs/web-platform/deprecating-unload) for more information.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- `"response-cache-control-no-store"`
- : The page uses `no-store` as a {{httpheader("Cache-Control")}} header value.
- `"related-active-contents"`
- : The page was opened from another page that still has a reference to this page, for example using "duplicate tab" functionality.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
54 changes: 54 additions & 0 deletions files/en-us/web/api/notrestoredreasondetails/tojson/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: "NotRestoredReasonDetails: toJSON() method"
short-title: toJSON()
slug: Web/API/NotRestoredReasonDetails/toJSON
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.NotRestoredReasonDetails.toJSON
spec-urls: https://html.spec.whatwg.org/multipage/nav-history-apis.html#notrestoredreasondetails
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`toJSON()`** method of the {{domxref("NotRestoredReasonDetails")}} interface is a {{Glossary("Serialization","serializer")}}; it returns a JSON representation of the {{domxref("NotRestoredReasonDetails")}} object.

## Syntax

```js-nolint
toJSON()
```

### Parameters

None.

### Return value

A {{jsxref("JSON")}} object that is the serialization of the {{domxref("NotRestoredReasonDetails")}} object.

## Examples

The following function will return a JSON representation of the first `NotRestoredReasonDetails` object of the `NotRestoredReasons` object from the first `PerformanceNavigationTiming` object currently present in the performance timeline:

```js
function returnNRR() {
const navEntries = performance.getEntriesByType("navigation");
let navEntry = navEntries[0];
return navEntry.notRestoredReasons.reasons[0].toJSON();
}
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{jsxref("JSON")}}
- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
39 changes: 39 additions & 0 deletions files/en-us/web/api/notrestoredreasons/children/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "NotRestoredReasons: children property"
short-title: children
slug: Web/API/NotRestoredReasons/children
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NotRestoredReasons.children
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`children`** read-only property of the
{{domxref("NotRestoredReasons")}} interface returns an array of {{domxref("NotRestoredReasons")}} objects, one for each child {{htmlelement("iframe")}} embedded in the current document, which may contain reasons why the top-level frame was blocked relating to the child frames.

Each object has the same structure as the parent object — this way, any number of levels of embedded `<iframe>`s can be represented inside the object recursively.

## Value

An array of {{domxref("NotRestoredReasons")}} objects.

If the frame has no children, the array will be empty; if the document is in a cross-origin `<iframe>`, `children` will return `null`.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
37 changes: 37 additions & 0 deletions files/en-us/web/api/notrestoredreasons/id/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "NotRestoredReasons: id property"
short-title: id
slug: Web/API/NotRestoredReasons/id
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NotRestoredReasons.id
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`id`** read-only property of the
{{domxref("NotRestoredReasons")}} interface returns a string representing the `id` attribute value of the {{htmlelement("iframe")}} the document is contained in (for example `<iframe id="foo" src="...">`).

## Value

A string.

If the document is not in an `<iframe>` or the `<iframe>` has no `id` set, `id` will return `null`.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
51 changes: 51 additions & 0 deletions files/en-us/web/api/notrestoredreasons/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: NotRestoredReasons
slug: Web/API/NotRestoredReasons
page-type: web-api-interface
status:
- experimental
browser-compat: api.NotRestoredReasons
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`NotRestoredReasons`** interface of the {{domxref("Performance API", "Performance API", "", "nocode")}} provides report data containing reasons why the current document was blocked from using the [back/forward cache (bfcache)](https://web.dev/articles/bfcache) on navigation.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

These objects are accessed via the {{domxref("PerformanceNavigationTiming.notRestoredReasons")}} property.

## Instance properties

- {{domxref("NotRestoredReasons.children", "children")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : An array of `NotRestoredReasons` objects, one for each child {{htmlelement("iframe")}} embedded in the current document, which may contain reasons why the top-level frame was blocked relating to the child frames. Each object has the same structure as the parent object — this way, any number of levels of embedded `<iframe>`s can be represented inside the object recursively. If the frame has no children, the array will be empty; if the document is in a cross-origin `<iframe>`, `children` will return `null`.
- {{domxref("NotRestoredReasons.id", "id")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : A string representing the `id` attribute value of the `<iframe>` the document is contained in (for example `<iframe id="foo" src="...">`). If the document is not in an `<iframe>` or the `<iframe>` has no `id` set, `id` will return `null`.
- {{domxref("NotRestoredReasons.name", "name")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : A string representing the `name` attribute value of the `<iframe>` the document is contained in (for example `<iframe name="bar" src="...">`). If the document is not in an `<iframe>` or the `<iframe>` has no `name` set, `name` will return `null`.
- {{domxref("NotRestoredReasons.reasons", "reasons")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : An array of {{domxref("NotRestoredReasonDetails")}} objects, each representing a reason why the navigated page was blocked from using the bfcache. If the document is in a cross-origin `<iframe>`, `reasons` will return `null`, but the parent document may show a `reason` of `"masked"` if any `<iframe>`s blocked bfcache usage for the top-level frame.
- {{domxref("NotRestoredReasons.src", "src")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : A string representing the path to the source of the `<iframe>` the document is contained in (for example `<iframe src="exampleframe.html">`). If the document is not in an `<iframe>`, `src` will return `null`.
- {{domxref("NotRestoredReasons.url", "url")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : A string representing the URL of the navigated page or `<iframe>`. If the document is in a cross-origin `<iframe>`, `url` will return `null`.

## Instance methods

- {{domxref("NotRestoredReasons.toJSON", "toJSON()")}} {{Experimental_Inline}}
- : A {{Glossary("Serialization","serializer")}}; returns a JSON representation of the `NotRestoredReasons` object.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
37 changes: 37 additions & 0 deletions files/en-us/web/api/notrestoredreasons/name/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "NotRestoredReasons: name property"
short-title: name
slug: Web/API/NotRestoredReasons/name
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NotRestoredReasons.name
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`name`** read-only property of the
{{domxref("NotRestoredReasons")}} interface returns a string representing the `name` attribute value of the {{htmlelement("iframe")}} the document is contained in (for example `<iframe name="bar" src="...">`).

## Value

A string.

If the document is not in an `<iframe>` or the `<iframe>` has no `name` set, `name` will return `null`.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}
37 changes: 37 additions & 0 deletions files/en-us/web/api/notrestoredreasons/reasons/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: "NotRestoredReasons: reasons property"
short-title: reasons
slug: Web/API/NotRestoredReasons/reasons
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NotRestoredReasons.reasons
---

{{APIRef("Performance API")}}{{SeeCompatTable}}

The **`reasons`** read-only property of the
{{domxref("NotRestoredReasons")}} interface returns an array of {{domxref("NotRestoredReasonDetails")}} objects, each representing a reason why the navigated page was blocked from using the [back/forward cache (bfcache)](https://web.dev/articles/bfcache).
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Value

An array of {{domxref("NotRestoredReasonDetails")}} objects. See [Blocking reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons#blocking_reasons) for a list of the possible blocking reasons.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

If the document is in a cross-origin {{htmlelement("iframe")}}, `reasons` will return `null`, but the parent document may show a `reason` of `"masked"` if any `<iframe>`s blocked bfcache usage for the top-level frame.

## Examples

See [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons) for examples.
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Reporting back/forward cache not restored reasons](/en-US/docs/Web/API/Performance_API/Reporting_backforward_cache_not_restored_reasons)
chrisdavidmills marked this conversation as resolved.
Show resolved Hide resolved
- {{domxref("PerformanceNavigationTiming.notRestoredReasons")}}