Repository navigation
Conversation
Custom-scheme URLs are now opened with UIApplication.open so iOS can prompt and switch apps. http, https, mailto, tel, javascript, data, file, about, blob, and vbscript stay on the existing web and system handlers, and internal article image schemes remain excluded. Navigation for other named schemes is cancelled. Fixes Ranchero-Software#4866
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
On iOS, tapping an article link that uses a custom URI scheme such as octal:// or netnewswire:// does nothing. The same kind of link already opens the destination app on macOS.
The iOS article web view only handed a small allowlist of schemes to the system opener. Custom-scheme taps continued as WKWebView navigation, which cannot launch another app, so the tap had no effect.
Summary of the fix
Custom-scheme URLs are now opened with UIApplication.open so iOS can prompt and switch apps. http, https, mailto, tel, javascript, data, file, about, blob, and vbscript stay on the existing web and system handlers, and internal article image schemes remain excluded. Navigation for other named schemes is cancelled.
Verification
swift test --filter RSWebTestspassed Test externalApplicationURLsPassThroughUnchanged.swift test --filter RSWebTestspassed Test blocksNonExternalApplicationURLs.swift test --filter RSWebTestspassed Test excludesInternalSchemesCaseInsensitively.swift test --filter RSWebTestsfinished with 39 tests in 8 suites passing. The tests inModules/RSWeb/Tests/RSWebTests/URLPreparedForOpeningTests.swiftfail without the fix in the NetNewsWire URLConstants change (checked by reverting the source changes). The changed test Modules/RSWeb/Tests/RSWebTests/URLPreparedForOpeningTests.swift did not run here: no test runner for it was available.Fixes #4866
AI was used for assistance.