status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
297 stars 79 forks source link

Internal URL launches browser #16695

Open felicio opened 19 hours ago

felicio commented 19 hours ago

Bug Report

Steps to reproduce

Image

  1. Visit about:blank
  2. Open Chrome console
  3. Paste const url = 'status-app://c/G3kAAMSQtb05kog3aGbr3kiaxN4tFZxy4BAGEkkLwILk2z3GcoYlm5hSJXGn7J3laft-tnTwDWmYJ18dP_3bgX96dqr_8E3qKAvxDf3NrrCMUBp4R9EYkQez9XSM4486mXoC3mIln2zc-fNdvjdfL9eHVZ-mGgs='
  4. Paste
    window.open(
    url,
    '_self',
    'noopener'
    )
  5. Click Open Status
  6. See that https://status.app/c/G3kAAMSQtb05kog3aGbr3kiaxN4tFZxy4BAGEkkLwILk2z3GcoYlm5hSJXGn7J3laft-tnTwDWmYJ18dP_3bgX96dqr_8E3qKAvxDf3NrrCMUBp4R9EYkQez9XSM4486mXoC3mIln2zc-fNdvjdfL9eHVZ-mGgs= is opened

Expected behavior

Additional Information

anastasiyaig commented 12 hours ago

reproduced as described

jrainville commented 12 hours ago

@felicio just to confirm here, the issue is that an invalid deep link should still open the app?

@anastasiyaig just tested that a valid deep link to the Status community does open it.

felicio commented 12 hours ago

@jrainville those links (/u, /c and /cc) should not launch user's browser nor navigate user away from the app. Valid or invalid.

jrainville commented 12 hours ago

@jrainville those links (/u, /c and /cc) should not launch user's browser nor navigate user away from the app. Valid or invalid.

@felicio I'm not sure I understand. Shouldn't deep links, at least valid ones, open Status Desktop or put Status Desktop active if it's already open? (eg: status-app://c/G3kAAMSQtb05kog3aGbr3kiaxN4tZZxy4BAGEkkLwILk2z3GcoYlm5hSJXGn7J3laft-tnTwDWmYJ18dP_3bgX96dqr_8E3qKAvxDf3NrrCMUBp4R9EYkQez9XSM4486mXoC3mIln2zc-UtdvjdfL9eHVZ-mGgs=#zQ3shZeEJqTC1xhGUjxuS4rtHSrhJ8vUYp64v6qWkLpvdy9L9 )

What do you expect should happen when someone sends that type of deep link?

From what I gather, it redirected to https://status.app/c/... when it shouldn't have?

felicio commented 12 hours ago

Shouldn't deep links, at least valid ones, open Status Desktop or put Status Desktop

Yes, but that's not what this issue is about.

Did you try to repro?

anastasiyaig commented 12 hours ago

the issue is that there is extra tab opened with deep link along with status app

https://github.com/user-attachments/assets/82a6ba46-190b-4180-b4d3-9fb6f4f8daf7

jrainville commented 12 hours ago

Shouldn't deep links, at least valid ones, open Status Desktop or put Status Desktop

Yes, but that's not what this issue is about.

Did you try to repro?

Sorry, I don't have Mac, so I can't test it for myself, so I'm going through some sort of telephone game haha.

Anyway @anastasiyaig just explained to me how it looks like and what the issue is. I get it now.

It does open Status as it should, but it also opens a browser tab, which is useless.

I wanted to be sure that deep links still work as expected for the app itself, which it seems it does, so at least the issue is not a regression. Phew 😄

I'll put this in 2.32. I expected it's probably simple to fix, probably a setting in the Mac files.