Open chat links in regular browser tabs #4198
Open
+24
−8
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.
Content
Open web hyperlinks in chat messages in the user's regular, preferred web browser. Fixes bug introduced in v0.6.5.
Closes #3885
Motivation and context
In 5baefd4, a link to a "help" web page was added to the
MessagesView
. Since this page is essentially part of the app, it should and does open in an "in-app" Chrome Custom Tab, where supported.Unfortunately, this change affects every link in the messages view, including links sent in chat messages. As of v0.6.5, links in chat messages now open in a Custom Tab instead of the user's configured "full" web browser. This is a UX nuisance.
Separate "regular" links from "help" links with a different callback for each.
onLinkClick
is modified to use standard browser tabsonHelpLinkClick
prefers a Chrome Custom Tab where possibleThe
LearnMoreConfig.IDENTITY_CHANGE_URL
is now presented toonHelpLinkClick()
. The regularonLinkClick()
is used everywhere else.Alternatively, the first patch in this PR removes the Custom Tab behavior from
MessagesView
entirely. This is likely not the preferred end result, however.Screenshots / GIFs
Tests
Build F-Droid version with
Install on device.
Sign in to Element.
Open a chat room. Find a message which includes an
https://
web link.Tap on the link.
Observe that the link is opened in the "full" web browser with the full browser UI and other tabs. (See screenshots.)
I have not tried to force an identity change to test that the identity change help still loads in a Chrome Custom Tab. I'm not sure what the best way to test that is.
This PR should not introduce any new Android APIs. If API 24 emulator testing is required, can the project recommend an emulator?
Tested devices
Checklist