mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 13:05:11 +00:00
utils/url_launcher: force opening http(s) links in external browser
The (mobile) platform implementations for url_launcher default to opening any http(s) link inside a webview instead of the platform browser. This seems to be a longer-time problem for iOS (https://gitlab.com/famedly/fluffychat/-/issues/519) but very recently started to affect Android as well. Force url_launcher to always use an external application (the browser, most likely, but possibly other apps might handle those links as well) as opening links from a messaging app in a webview provides terrible UX. (For instance a link might lead to some webpage where you start to fill in some info but then you need to ask someone via the messanger but can't go back without closing the webview and losing all state. Or if you happen to re-launch FluffyChat via the home-screen than it goes back to the home view and the webview state is completely lost as well.)
This commit is contained in:
parent
8fc8d7dd0f
commit
d318a2948f
1 changed files with 3 additions and 1 deletions
|
@ -84,7 +84,9 @@ class UrlLauncher {
|
|||
? 'xn--$hostPartPunycode'
|
||||
: hostPart;
|
||||
}).join('.');
|
||||
launchUrlString(uri.replace(host: newHost).toString());
|
||||
// Force LaunchMode.externalApplication, otherwise url_launcher will default
|
||||
// to opening links in a webview on mobile platforms.
|
||||
launchUrlString(uri.replace(host: newHost).toString(), mode: LaunchMode.externalApplication);
|
||||
}
|
||||
|
||||
void openMatrixToUrl() async {
|
||||
|
|
Loading…
Reference in a new issue