fix: prevent opening invalid links

Closes #328
This commit is contained in:
Jovan Krunić
2022-11-01 15:40:47 +01:00
committed by Rainer Killinger
parent 82ba5f8121
commit fdee2db8a4
2 changed files with 4 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ export class ExternalLinkComponent {
constructor(private browser: Browser) {}
onLinkClick(url: string) {
this.browser.open(url);
// make sure if the url is valid and then open it in the browser (prevent problem in iOS)
this.browser.open(new URL(url).href);
}
}

View File

@@ -38,6 +38,7 @@ export class MessageDetailContentComponent {
* @param url Web address to open
*/
onLinkClick(url: string) {
this.browser.open(url);
// make sure if the url is valid and then open it in the browser (prevent problem in iOS)
this.browser.open(new URL(url).href);
}
}