Bug 1251507 - Safari parity for url and scheme handling #1576
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.
This patch gives us parity with Safari with regards to custom scheme and url handling. The patch special cases three types of destinations in the following order:
tel:
,facetime:
,facetime-audio:
- These all trigger a prompt that displays the phone or account number with the option to Cancel or to Call. Exactly like Safari.http://maps.apple.com
,http://itunes.apple.com
- These are recognized as URLs that should be opened withopenURL()
so that the native Maps and App Store apps are triggered.http:
,https:
- These are opened in FirefoxAfter that, the default is to open the URL with
UIApplication.openURL()
without making a call tocanOpenURL()
. This gives us the following behaviour:twitter
trigger an iOS provided prompt that says 'Firefox wants to open Twitter` with the option to Cancel or Open.WKWebView
that automatically handleshttp://maps.google.com
correctly where it either opens in Firefox or in the native Google Maps app if it is installed.mailto:
andsms:
links, which are opened without prompting in Mail.app and Messages.appitms-books:
orvideos:
without prompting.This patch gives us 99% parity with Safari. The only thing that does not work as in Safari are
http://www.youtube.com
links. iOS has traditionally handled those in a special way, opening the native app if present. If we want that same behaviour then we need to add theyoutube:
scheme to ourInfo.plist
so that we have the capability to detect if the YouTube app is installed. I think we should wait with this until we have some user feedback.Test matrix at https://docs.google.com/spreadsheets/d/1Mfyl6Tw1iSjjiH2CvK22oVtGVxMsJc0sdcqNPezM35w/edit#gid=0