Open
Bug 1769189
Opened 3 months ago
Updated 22 days ago
replaceState does not work in beforeunload listener
Categories
(Core :: DOM: Navigation, defect, P3)
Tracking
()
ASSIGNED
People
(Reporter: sam9072000, Assigned: smaug)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:100.0) Gecko/20100101 Firefox/100.0
Steps to reproduce:
- Include this script into a simple html page
console.log(window.history.state);
window.addEventListener('beforeunload', () => {
window.history.replaceState({ data: true }, '');
});
- Visit page
- Press refresh button to refresh page
Actual results:
- After refreshing the page with the refresh button, the console prints null.
Expected results:
- After refreshing the page with the refresh button, the console should print {data: true}
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Component: Untriaged → Printing: Output
Product: Firefox → Core
![]() |
||
Updated•3 months ago
|
Component: Printing: Output → DOM: Navigation
Assignee | ||
Comment 2•3 months ago
|
||
Is this a regression? In other words, did this work before?
(I'm not even sure this is a bug.)
The bug title isn't quite right though. beforeunload is triggered, it is just that calling replaceState so late doesn't do anything.
Flags: needinfo?(sam9072000)
Assignee | ||
Comment 3•3 months ago
|
||
Ok, this is a SHIP regression.
Blocks: ship-regressions
Flags: needinfo?(sam9072000)
Assignee | ||
Updated•3 months ago
|
Summary: beforeunload listener not triggered when refresh button is pressed → replaceState does not work in beforeunload listener
Updated•2 months ago
|
Severity: -- → S3
Priority: -- → P3
Assignee | ||
Comment 4•22 days ago
|
||
Updated•22 days ago
|
Assignee: nobody → smaug
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
You need to log in
before you can comment on or make changes to this bug.
Description
•