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 1 commit
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
Prev Previous commit
Next Next commit
Making fixes for review comments from tunetheweb and Josh-Cena
  • Loading branch information
chrisdavidmills committed Jul 17, 2023
commit 277949561fe34a762d17b1db285969aad62e087a
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ function returnNRR() {
The `PerformanceNavigationTiming.notRestoredReasons` property returns an object with the following structure, which represents the blocked state of the top-level frame:

```js
{
({
blocked: true,
children: [],
id: "",
name: "",
reasons: [ "Internal Error", "Unload handler" ],
reasons: ["Internal Error", "Unload handler"],
src: "",
url: "a.com"
}
url: "a.com",
});
```

The properties are as follows:
Expand All @@ -78,19 +78,43 @@ When a page has same-origin frames embedded, the returned `notRestoredReasons` v
For example:

```js
{
({
blocked: false,
children: [
{ url: "a.com", src: "b.a.com", id: "b", name: "b", blocked: false, reasons: [], children: [] },
{ url: "a.com", src: "c.a.com", id: "c", name: "c", blocked: true, reasons: [ "BroadcastChannel" ], children: [] },
{ url: "a.com", src: "d.a.com", id: "d", name: "d", blocked: false, reasons: [], children: [] }
{
url: "a.com",
src: "b.a.com",
id: "b",
name: "b",
blocked: false,
reasons: [],
children: [],
},
{
url: "a.com",
src: "c.a.com",
id: "c",
name: "c",
blocked: true,
reasons: ["BroadcastChannel"],
children: [],
},
{
url: "a.com",
src: "d.a.com",
id: "d",
name: "d",
blocked: false,
reasons: [],
children: [],
},
],
id: "",
name: "",
reasons: [],
src: "",
url:"a.com"
}
url: "a.com",
});
```

### Reporting bfcache blocking in cross-origin frames
Expand All @@ -100,47 +124,85 @@ When a page has cross-origin frames embedded, we limit the amount of information
For example:

```js
{
({
blocked: false,
children: [
{ url: "a.com", src: "c.a.com", id: "c", name: "c", blocked: true, reasons: [ "ScreenReader" ], children: [] },
{
url: "a.com",
src: "c.a.com",
id: "c",
name: "c",
blocked: true,
reasons: ["ScreenReader"],
children: [],
},
/* cross-origin frame */
{ url: "", src: "b.com", id: "d", name: "d", blocked: true, reasons: [], children: [] }
{
url: "",
src: "b.com",
id: "d",
name: "d",
blocked: true,
reasons: [],
children: [],
},
],
id: "",
name: "",
reasons: [],
src: "",
url:"a.com"
}
url: "a.com",
});
```

If multiple cross-origin frames have blocking reasons, we randomly select one cross-origin frame and report whether it blocked bfcache or not. For the rest of the frames, we report `null` for the `blocked` value. This is to stop bad actors from inferring information about user state on sites they don't control by embedding multiple third-party frames into a page and then comparing the blocking information from each.
If multiple cross-origin frames have blocking reasons, we randomly select one cross-origin frame and report whether it blocked bfcache or not. For the rest of the frames, we report `null` for the `blocked` value. This is to stop bad actors from inferring information about user state on sites they don't control by embedding multiple third-party frames into a page and then comparing the blocking information from each. For example, a page could embed 20 different social media sites and infer which sites the user is logged in on, by querying the not restored reasons data.

```js
{
({
blocked: false,
children: [
/* cross-origin frames */
{url: "", src: "b.com", id: "b", name: "b", blocked: null, reasons: [], children: []},
{url: "", src: "c.com", id: "c", name: "c", blocked: true, reasons: [], children: []},
{url: "", src: "d.com", id: "d", name: "d", blocked: null, reasons: [], children: []}
]
{
url: "",
src: "b.com",
id: "b",
name: "b",
blocked: null,
reasons: [],
children: [],
},
{
url: "",
src: "c.com",
id: "c",
name: "c",
blocked: true,
reasons: [],
children: [],
},
{
url: "",
src: "d.com",
id: "d",
name: "d",
blocked: null,
reasons: [],
children: [],
},
],
id: "",
name: "",
reasons: [],
src: "",
url:"a.com"
}
url: "a.com",
});
```

> **Note:** See the [Security and privacy](https://github.com/rubberyuzu/bfcache-not-retored-reason/blob/main/NotRestoredReason.md#security-and-privacy) section in the explainer for more details about security and privacy considerations.
> **Note:** `notRestoredReasons` is not available inside embedded cross-origin frames. It is availale only in the top-level document in such cases.

## Blocking reasons

As noted earlier, there are many different reasons why blocking could occur. Google has compiled a [spreadsheet](https://docs.google.com/spreadsheets/d/1li0po_ETJAIybpaSX5rW_lUN62upQhY0tH4pR5UPt60/edit#gid=0) showing all the reason strings and explaining what they mean.

As an example, Chrome's implementation has a few major categories of reasons:
There are many different reasons why blocking could occur, and these reasons are browser-specific. As an example, Chrome's implementation has a few major categories of reasons:

- `Circumstantial`: This refers to blocking reasons not directly related to the developer's page code. For example, a related component crashed, something went wrong with the loading process, the page is in a temporary state that can't be cached, bfcache is disabled due to insufficient memory, or a [service worker](/en-US/docs/Web/API/Service_Worker_API) did something to the page that disqualifies it from being cached.
- `Extensions`: There are a few different reason messages related to extensions. There are several different reasons combined into the "Extensions" reason. The reasons concerning extension-related blocking are intentionally vague because it would be bad for privacy to give away too much information about what extensions the user has installed, which ones are active on the page, what they are doing, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ function returnNRR() {
The `PerformanceNavigationTiming.notRestoredReasons` property returns an object with the following structure, which represents the blocked state of the top-level frame:

```js
{
({
blocked: true,
children: [],
id: "",
name: "",
reasons: [ "Internal Error", "Unload handler" ],
reasons: ["Internal Error", "Unload handler"],
src: "",
url: "a.com"
}
url: "a.com",
});
```

## Specifications
Expand Down