Home > Net >  Capacitor Android app external links does not open in external browser
Capacitor Android app external links does not open in external browser

Time:06-17

I am a new in capacitor with ionic. In my app lots of external url is there, I am trying to do is once user click on external link it should open in external browser but its try to open in app itself. In iOS its working as expected.

CodePudding user response:

Add target="_blank" to your link. Example:

 <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a> 

CodePudding user response:

I had a similar problem and I ended up using javascript

<a (click)="openLink(userManual)">User manual</a>
openLink(link: string) {
    window.open(link, '_self');
}
  • Related