Skip to content

Going forward in history does not trigger pageshow #39798

@jdm

Description

@jdm

a1.html

<script>
  onpageshow = () => console.log('a1 pageshow! ' + location.href);
</script>
<a href="a2.html">a2</a>
<button onclick="history.forward()">forward</button>
<button onclick="history.back()">back</button>

a2.html

<script>
  onpageshow = () => console.log('a2 pageshow! ' + location.href);
</script>
<a href="a1.html">a1</a>
<button onclick="history.forward()">forward</button>
<button onclick="history.back()">back</button>

./mach run http://localhost:8000/a1.html, then press the a2 link, then press back, then press forward.

Expected:

a1 pageshow http://localhost:8000/a1.html
a2 pageshow http://localhost:8000/a2html
a1 pageshow http://localhost:8000/a1.html
a2 pageshow http://localhost:8000/a2html

Actual:

a1 pageshow http://localhost:8000/a1.html
a2 pageshow http://localhost:8000/a2html
a1 pageshow http://localhost:8000/a1.html

Any further history traversals in any direction do not trigger pageshow events.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions