"Navigated message" is displayed too early
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: ycw7788, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0
Steps to reproduce:
- creates a script, and appends it to index.html
location.replace('another.html')
throw new Error()
- in firefox, opens console, enables Persist Logs, then visit index.html
Actual results:
in console, "Navigated to another.html" was logged, followed by the Error
Expected results:
I expected that console logs the Error before showing the navigation info.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
reproducible with data:text/html,<meta charset=utf8><button>Reload</button><script>document.querySelector("button").addEventListener("click", function(){ location.reload();throw new Error("booh") })</script>
Updated•2 years ago
|
Comment 3•2 years ago
|
||
We currently subtract an offset for a navigation event at https://searchfox.org/mozilla-central/rev/e77d89c414eac63a295a2124600045775a6f4715/devtools/server/actors/resources/parent-process-document-event.js#143 which can cause a sorting issues in this case.
On DevTools side, we could change the sorting to be based on the target/window but that would be a massive change which might have performance issues. Otherwise we can hope for a better timing from platform for this navigation event (see comments in file).
Description
•