Skip to content

macOS 11.x crash: WKWebViewConfiguration.upgradeKnownHostsToHTTPS unrecognized selector#2767

Open
liuyanqing wants to merge 1 commit intopichillilorenzo:masterfrom
liuyanqing:fix/macos-upgradeKnownHostsToHTTPS-runtime-check
Open

macOS 11.x crash: WKWebViewConfiguration.upgradeKnownHostsToHTTPS unrecognized selector#2767
liuyanqing wants to merge 1 commit intopichillilorenzo:masterfrom
liuyanqing:fix/macos-upgradeKnownHostsToHTTPS-runtime-check

Conversation

@liuyanqing
Copy link

Summary

Fix crash on macOS 11.x caused by calling
WKWebViewConfiguration.upgradeKnownHostsToHTTPS
when the selector is not available at runtime.

Details

Although upgradeKnownHostsToHTTPS is marked as
API_AVAILABLE(macos(11.3)) in the SDK headers,
the corresponding Objective-C selector
setUpgradeKnownHostsToHTTPS: is missing from
WebKit at runtime on macOS 11.x (Big Sur).

Calling it results in:
-[WKWebViewConfiguration setUpgradeKnownHostsToHTTPS:]: unrecognized selector sent to instance

This PR guards the assignment with a runtime selector check,
preventing the crash while preserving behavior on macOS 12+.

Affected platforms

  • macOS 11.x (Big Sur)

Refs #2741

@probot-autolabeler probot-autolabeler bot added iOS macOS macOS platform labels Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iOS macOS macOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant