session-desktop icon indicating copy to clipboard operation
session-desktop copied to clipboard

Add option to disable "open this link in browser" popup.

Open altsst opened this issue 2 years ago • 5 comments

Describe the bug The session client on android/mac/windows is asking if I want to open a link in the browser.

There should be an option to disable that popup and open it directly in the browser.

To Reproduce

  1. Send a link to someone
  2. Click on link to try and open it in the browser

Screenshots or Logs image

Other information (please complete the following information):

  • Device: MacOS, Windows, Android
  • OS: MacOS 12.6, Windows 10, Android 13
  • Session Version or Git commit hash: Session 1.10.4, 991ddd1cbaa1948c865b5e8ad9b2b8137f04641c

altsst avatar Feb 05 '23 08:02 altsst

Yeah i think this is a good idea, would support putting an option in the modal, something like "Don't show me this again"

KeeJef avatar Aug 18 '23 05:08 KeeJef

Yeah i think this is a good idea, would support putting an option in the modal, something like "Don't show me this again"

I think it would be better to add "Trust this domain" button which adds this exact hostname to list of trusted and put "Disable link warnings" in settings instead. Users presented with "don't show me this again" will usually click it, because it removes extra time-wasting step for them (risking security), and by adding option to disable these popups to settings we add extra customization for users who took their time to search for settings for this exact option and who take responsibility of clicking on unknown links.

VityaSchel avatar Apr 27 '24 13:04 VityaSchel

I noticed that in current implementation pressing "esc" while in this modal copies link to clipboard. Is this intentional? Looks like bug because SessionConfirm modal is used.

I created separate component SessionOpenExternalLinkDialog and separate modal state OpenExternalLinkModalState, moved showLinkVisitWarningDialog from SessionConfirm to OpenExternalLinkDialog so we don't mix these two modals in same file and took some design ideas from discord to put all four possible actions in popup: 1) close popup 2) copy link 3) just open 4) open and trust in future

Here is reference from Discord: image

Here is what I made: image image

Here is patch for this: 0001-chore-refactor-redesign-external-links-modal.patch

And for trusted websites feature: image image

I added TrustWebsitesController which is a simplier copy of BlockedNumberController that stores trusted hostnames in db by trusted-websites key.

image image image

By the way, I fixed this issue when options were shrinking because of too small resolution. This is fixed by applying flex-shrink: 0. image became: image Also this arrow should be reversed (pointing downwards when closed) so I fixed it too image

However, I noticed that trusted-websites key does not get saved in database, while blocked does. I need these changes to be reviewed and approved anyway, so please keep in mind this issue with persisting trusted hostnames string set.

Here is final patch with yarn ready executed:

0001-feat-trusted-websites-list-and-trust-hostname-btn.patch

And I'll create a pull request when GitHub support detach my bot framework repo and I'll be able to fork session desktop client repo again.

VityaSchel avatar Apr 27 '24 16:04 VityaSchel

Thanks for taking a stab at this @VityaSchel , after looking at this further, i think we want to take this in house as we want to support this feature cross platform and potentially sync the URL list cross platform, which extends this from being a simple PR into something more complex. Tracking this via Jira internally as https://optf.atlassian.net/browse/SES-1808

KeeJef avatar Apr 29 '24 05:04 KeeJef

Thanks for taking a stab at this @VityaSchel , after looking at this further, i think we want to take this in house as we want to support this feature cross platform and potentially sync the URL list cross platform, which extends this from being a simple PR into something more complex. Tracking this via Jira internally as https://optf.atlassian.net/browse/SES-1808

I was finally able to create PR with my code #3088 so feel free to take anything from it, if it helps :)

VityaSchel avatar Apr 29 '24 23:04 VityaSchel