Closed
Bug 1769189
Opened 3 years ago
Closed 2 years ago
replaceState does not work in beforeunload listener
Categories
(Core :: DOM: Navigation, defect, P3)
Tracking
()
RESOLVED
FIXED
108 Branch
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
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 years 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 years ago
|
Component: Printing: Output → DOM: Navigation
Assignee | ||
Comment 2•3 years 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 years ago
|
||
Ok, this is a SHIP regression.
Blocks: ship-regressions
Flags: needinfo?(sam9072000)
Assignee | ||
Updated•3 years ago
|
Summary: beforeunload listener not triggered when refresh button is pressed → replaceState does not work in beforeunload listener
Updated•3 years ago
|
Severity: -- → S3
Priority: -- → P3
Assignee | ||
Comment 4•2 years ago
|
||
Updated•2 years ago
|
Assignee: nobody → smaug
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7111ffbafc64
ensure history state is updated if beforeunload listener calls replaceState, r=peterv
Comment 6•2 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
status-firefox108:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•