Do not ever cancel requests when handling opening URLs, especially those with target=_blank as they will NOT have a parent tab! This is because when a URL is cancelled, if the user hits allow to open it, then a NEW request is made and all of the entire navigationAction/State is completely lost. The new URL will not have the same privileges, it will not open in a CHILD tab, and it will not have the syntheticClickType or navigationActionType as its parent! This is important to determine if a URL has been opened by a user action vs. by Javascript.
Second problem is that we block opening of external URLs in third-party frames, but a lot of websites now outsource universal links to third-party service providers which for some odd reason always seems to open the URL with target=_blank, and since we block this, the applications don't open. This behaviour is undesired as all other browser EXCEPT brave can handle such URLs. Instead, we should either handle the specific case of sms/tel URLs like Safari does, OR we allow it in third-party frames but only for active tabs.
This pull request fixes #7835
This pull request fixes #8494
Submitter Checklist:
[x] Unit Tests are updated to cover new or changed functionality
[x] User-facing strings use NSLocalizableString()
[x] New or updated UI has been tested across:
[x] Light & dark mode
[x] Different size classes (iPhone, landscape, iPad)
Summary of Changes
Do not ever cancel requests when handling opening URLs, especially those with
target=_blank
as they will NOT have aparent
tab! This is because when a URL is cancelled, if the user hitsallow
to open it, then a NEW request is made and all of the entire navigationAction/State is completely lost. The new URL will not have the same privileges, it will not open in a CHILD tab, and it will not have thesyntheticClickType
ornavigationActionType
as its parent! This is important to determine if a URL has been opened by a user action vs. by Javascript.Second problem is that we block opening of external URLs in third-party frames, but a lot of websites now outsource universal links to third-party service providers which for some odd reason always seems to open the URL with
target=_blank
, and since we block this, the applications don't open. This behaviour is undesired as all other browser EXCEPT brave can handle such URLs. Instead, we should either handle the specific case ofsms/tel
URLs like Safari does, OR we allow it in third-party frames but only foractive
tabs.This pull request fixes #7835 This pull request fixes #8494
Submitter Checklist:
NSLocalizableString()
Reviewer Checklist:
QA/(Yes|No)
bug
/enhancement