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

  Changed paths:
    A Tools/SwiftBrowser/Source/Extensions/String+Extras.swift
    A Tools/SwiftBrowser/Source/Extensions/URL+Extras.swift
    M Tools/SwiftBrowser/Source/SwiftBrowser.swift
    M Tools/SwiftBrowser/Source/ViewModel/BrowserViewModel.swift

  Log Message:
  -----------
  [SwiftBrowser] Typing webkit.org in the URL bar leads to a failed provisional 
navigation
https://bugs.webkit.org/show_bug.cgi?id=321172
rdar://184219290

Reviewed by Richard Robinson.

Currently, typing a URL with only the host and not the protocol scheme
produces a failed provisional navigation, since WebKit expectedly does
not know what to do with a URL request consisting of a URL without a
protocol.

In this patch, we remedy the situation by following precedent set by
MiniBrowser and (a) tacking on, as needed,  a `http://` to URLs entered
in the address bar, and (b) passing the URL through -[NSURL
_webkit_URLWithUserTypedString:].

To facilitate these changes, we introduce two extensions to String and
URL, which simply provide convenient wrappers for (a) and (b).

* Tools/SwiftBrowser/Source/Extensions/String+Extras.swift: Added.
(String.addingProtocolIfNecessary):
* Tools/SwiftBrowser/Source/Extensions/URL+Extras.swift: Added.
* Tools/SwiftBrowser/Source/SwiftBrowser.swift:
(SwiftBrowserApp.body):
(SwiftBrowserApp.addProtocolIfNecessary(to:)): Deleted.
* Tools/SwiftBrowser/Source/ViewModel/BrowserViewModel.swift:
(BrowserViewModel.navigateToSubmittedURL):

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



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

Reply via email to