Return from app to Safari Mobile in same browser tab

Scenario:

  • User opens web page https://source-url.test in Safari Mobile browser tab A
  • User clicks a link https://app-associated-domain.example.com/my-deep-link which triggers the app because it implements continued user activities (Universal Link feature)
  • App has by some means received a "return URL" which it opens once the user has finished their actions (example: confirm a payment in a bank app, then return to previous session in web browser)
    • If the app opens https://source-url.test (or an equivalent one such as https://source-url.test#mykey=myvalue-in-a-hash-fragment), Safari Mobile will open up in browser tab A (same as source). The page can implement the `hashchange` event to recognize this (tab does not reload but "jumps" to the given hash).
    • If the app opens a URL which is not seen as equivalent to the existing browser tab's URL, a new browser tab B will open. In this case, any association with browser tab A is lost (including for example the `window.parent` association for popups).


So obviously, there is a working way to return to the same browser tab, namely by returning to the source URL (or an equivalent).


My question is: can developers trust on this behavior of Safari Mobile. Is it guaranteed for the next iOS and Safari releases to come? Is the behavior documented as proof that we can rely on it? Or is there maybe a better way to implement this, assuming that we have no control over the app implementation but can only pass a "forwarding URL" which the app must open after completing user activities?

Return from app to Safari Mobile in same browser tab
 
 
Q