Merge pull request #3414 from dpalou/MOBILE-4081

MOBILE-4081 core: Only show warning if http
main
Pau Ferrer Ocaña 2022-10-24 10:00:37 +02:00 committed by GitHub
commit 153c8a6d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ export class CoreWindow {
* @return Promise resolved if confirmed, rejected if rejected. * @return Promise resolved if confirmed, rejected if rejected.
*/ */
static async confirmOpenBrowserIfNeeded(url: string): Promise<void> { static async confirmOpenBrowserIfNeeded(url: string): Promise<void> {
if (!CoreUrlUtils.isHttpURL(url)) {
// Only ask confirm for http(s), other cases usually launch external apps.
return;
}
// Check if the user decided not to see the warning. // Check if the user decided not to see the warning.
const dontShowWarning = await CoreConfig.get(CoreConstants.SETTINGS_DONT_SHOW_EXTERNAL_LINK_WARN, 0); const dontShowWarning = await CoreConfig.get(CoreConstants.SETTINGS_DONT_SHOW_EXTERNAL_LINK_WARN, 0);
if (dontShowWarning) { if (dontShowWarning) {