Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: acf8a9bd09120f8b9dd8974c16cc499047fd8d56
      
https://github.com/WebKit/WebKit/commit/acf8a9bd09120f8b9dd8974c16cc499047fd8d56
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-08-07 (Fri, 07 Aug 2026)

  Changed paths:
    M Tools/SwiftBrowser/Source/ViewModel/BrowserViewModel.swift
    M Tools/SwiftBrowser/Source/Views/ContentView.swift

  Log Message:
  -----------
  [SwiftBrowser] URL field does not reflect the committed URL after navigation
https://bugs.webkit.org/show_bug.cgi?id=321267
rdar://184318736

Reviewed by Pascoe and Richard Robinson.

SwiftBrowser consumed the async navigation sequence but it only printed
each event and did not invoke didReceiveNavigationEvent(). This is the
method responsible  for syncinc displayedURL against page.url after a
navigation is committed. As such, the field kept whatever text was
submitted, and did not reflect the final URL the page committed to.

This bug manifested itself in a stale address bar for navigations that
produced a known-host HTTPS upgrade (such as apple.com).

To fix this, we simply route navigation events through the correct
handler. We also include the event's URL in the logging to make
navigation state easier to follow.

A couple of drive-by fixes:
1. Mark the pre-existing "Exported PDF to …" log as privacy: .sensitive
   for consistency.
2. Drop the now redundant addingProtocolIfNecessary() adjustment in
   navigateToSubmittedURL(). The userTypedString: init already applies
   scheme inference and the field is now drive entirely by page.url.

* Tools/SwiftBrowser/Source/ViewModel/BrowserViewModel.swift:
(BrowserViewModel.didReceiveNavigationEvent(_:)):
(BrowserViewModel.navigateToSubmittedURL):
(BrowserViewModel.didExportPDF(_:any:)):
* Tools/SwiftBrowser/Source/Views/ContentView.swift:
(ContentView.body):

Canonical link: https://commits.webkit.org/318811@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to