Closed Bug 1998121 Opened 1 month ago Closed 23 days ago

Navigation event has wrong navigationType for clicks to the current URL

Categories

(Core :: DOM: Navigation, defect)

Firefox 146
defect

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed
firefox147 --- fixed

People

(Reporter: hbenl, Assigned: farre)

References

(Blocks 1 open bug)

Details

(Keywords: webcompat:platform-bug)

User Story

user-impact-score:270

Attachments

(2 files)

When clicking on a link that points to the URL of the current page, the navigation event has navigationType set to push even though the click reloads the page replacing the current navigation history entry instead of adding a new one. In Chrome, the navigationType is replace.

STR:

Expected: the console shows "replace"
Actual: the console shows "push"

Furthermore I've noticed that after clicking the link, navigation.canGoBack is true even if the browser's back button is disabled and the 2 entries in navigation.activation have different keys. In Chrome, navigation.canGoBack is false in this case and the 2 entries in navigation.activation have the same key (see https://developer.mozilla.org/en-US/docs/Web/API/NavigateEvent/navigationType#:~:text=This%20new%20entry%20will%20reuse%20the%20same%20key%2C%20but%20be%20assigned%20a%20different%20id).

Version: unspecified → Firefox 146
Assignee: nobody → afarre
Status: NEW → ASSIGNED
User Story: (updated)

This is again a missing push -> replace conversion, but this time for #following-hyperlinks-2. This is a scary one-liner, so I'm running a fairly big try for this.

Attachment #9524667 - Attachment description: WIP: Bug 1998121 - Make following a hyperlink do push/replace conversion. → Bug 1998121 - Make following a hyperlink do push/replace conversion.
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
QA Whiteboard: [qa-triage-done-c147/b146][qa-ver-needed-c147/b146]
Flags: qe-verify+
QA Contact: mchiorean

I was able to reproduce the issue on Win11x64 using FF build 146.0a1(20251104214230) I see push in the browser console like on description.
Issue also reproduces on beta 146.0b2 and also on 147.0a1.
Andreas, is there something that I am missing?

Flags: needinfo?(afarre)
Status: RESOLVED → REOPENED
QA Whiteboard: [qa-triage-done-c147/b146][qa-ver-needed-c147/b146] → [qa-triage-done-c147/b146][qa-ver-needed-c147/b146][qa-reopen-c147/b146]
Flags: qe-verify+
Resolution: FIXED → ---
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/56085 for changes under testing/web-platform/tests
Status: REOPENED → RESOLVED
Closed: 1 month ago23 days ago
Resolution: --- → FIXED
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
Flags: needinfo?(afarre)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: