Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 111ec8a8a585f7d2764b373a0ef28fa8772cc5a9
      
https://github.com/WebKit/WebKit/commit/111ec8a8a585f7d2764b373a0ef28fa8772cc5a9
  Author: Chris Dumez <[email protected]>
  Date:   2026-05-02 (Sat, 02 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/Cocoa/NavigationState.mm
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebProcessPool.cpp

  Log Message:
  -----------
  Skip app link and SSO interception for URLs with a registered 
WKURLSchemeHandler
https://bugs.webkit.org/show_bug.cgi?id=313882
rdar://176009393

Reviewed by Per Arne Vollan.

When a WKWebView loads a URL whose scheme has a registered WKURLSchemeHandler,
the navigation policy decision flow calls into SOAuthorization's
canPerformAuthorizationWithURL:completion: asynchronously. This call requires
network access to fetch native takeover URLs from AuthKit. If the device has
no connectivity, the completion block may never be called, causing the
navigation to hang indefinitely — the policy listener is never resolved, so
the load never starts.

This was observed in the Books app, where EPUB pagination WKWebViews use the
ibooks:// custom scheme. Without network, every chapter load would hang until
Books' own 10-second timeout fired, producing cascading load failures and
JavaScript errors (e.g. "Can't find variable: __ibooks_cfi_utilities") because
the content and its injected scripts never loaded.

URLs with a registered WKURLSchemeHandler are always served locally by the app
and should never be intercepted by app links or SSO. Skip both checks early in
tryInterceptNavigation() and trySOAuthorization().

Also change WebPageProxy::urlSchemeHandlerForScheme() to take StringView instead
of `const String&` to avoid unnecessary string allocations at the call sites.

* Source/WebKit/UIProcess/Cocoa/NavigationState.mm:
(WebKit::trySOAuthorization):
(WebKit::tryInterceptNavigation):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::urlSchemeHandlerForScheme):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigationInternal):

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



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

Reply via email to