fix: Open external URLs in system browser on iOS #308
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.
What?
Updates the iOS WebView navigation policy to correctly open external URLs in the system browser while allowing embedded content (videos, iframes) to load within the editor.
Why?
Fixes CMM-1172.
The WPCOM upsell button uses
window.top.location.href = url(JavaScript navigation), which bypassed the original.linkActivated-only check. This caused the editor WebView to navigate to WordPress.com checkout pages instead of opening them in Safari.How?
Introduces
EditorNavigationPolicyto evaluate navigation requests based on:file://,gbk-cache-https://,gbk-media-file://).linkActivated.other.reload,.backForward,.formSubmittedThis ensures:
Testing Instructions
Upsell Navigation (the bug fix)
Important
Requires testing with the WordPress app.
Video Playback (regression test)
Link Clicks
Accessibility Testing Instructions
No UI changes - navigation behavior only.