Open Bug 1703297 Opened 3 years ago Updated 3 years ago

COOP same-origin blocks BFCache

Categories

(Core :: DOM: Navigation, defect, P3)

78 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: alex_y_xu, Unassigned)

References

(Depends on 1 open bug)

Details

Steps to reproduce:

  1. Add the following content to a page:
<script>
window.addEventListener('pageshow', function (event) {
    console.log("page showed", event.persisted);
});
window.addEventListener('pagehide', function (event) {
    console.log("page hidden", event.persisted);
});
</script>
<a href="/">same-origin link</a>
<a href="https://example.com">cross-origin link</a>
  1. Serve the page with and without Cross-Origin-Opener-Policy: same-origin.
  2. Navigate to the page, then click one link, then the back button, then the other, then back.

Expected behavior:

All back navigations are successfully loaded from BFCache.

Actual behavior:

Back navigations except cross-origin with Cross-Origin-Opener-Policy: same-origin set are loaded from BFCache. "D/PageCache no saved presentation for uri" is logged in that case, implying that COOP same-origin causes the page to be totally unloaded.

Additional information:

I believe this is a bug, because navigating using an ordinary <a> tag (i.e. without target attribute) does not set opener in the resulting Window. Therefore, there should be no difference whether Cross-Origin-Opener-Policy is or is not set.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Navigation' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: Navigation
Product: Firefox → Core
Severity: -- → S3
No longer depends on: fission-bfcache
Priority: -- → P3
Severity: S3 → --
Priority: P3 → --

For cross-origin one we need Fission+bfcache.

Severity: -- → S3
Depends on: fission-bfcache
Priority: -- → P3
No longer depends on: fission-bfcache

Olli, can you confirm that this works correctly with Fission and BFCache enabled?

Flags: needinfo?(bugs)
No longer blocks: fission-bfcache
Depends on: fission-bfcache
Flags: needinfo?(bugs)

Using https://first-party-test.glitch.me/coop as a testcase, bfcache in fission seems to fix this.

You need to log in before you can comment on or make changes to this bug.