How to open link EXTERNALLY

Hey, not OP but this don’t seem to work for me.

Ionic version 2.2.1

I am looking at this documentation here.

Using that I am getting a lot of error using it. I am not sure if I am using the iab correctly in my html.

Can you explain it with a button click example?

My .ts file

import { Component } from ‘@angular/core’;

import { NavController } from ‘ionic-angular’;

import { InAppBrowser } from ‘@ionic-native/in-app-browser’;

constructor(private iab: InAppBrowser) { }

selector: ‘page-home’,
templateUrl: ‘home.html’
export class HomePage {

constructor(public navCtrl: NavController) {


const browser = this.iab.create(‘’);



    <button class="button" ion-button block (click)='OpenUrl();'>

What am I doing wrong. Newbie, so please don’t mind if it’s silly!


Good evening, express yourself well. What do you get as a mistake?


With the same code, I have this error :

Runtime Error
Error in ./MyApp class MyApp - caused by: No provider for InAppBrowser!

The solution :

Add : providers: [InAppBrowser]

I can’t open an url using an external browser like safari, on iOS. Ionic 3

I think the constructor is wrong you should have something like this:

constructor(public navCtrl: NavController, private iab: InAppBrowser) { }

to add module first do:

ionic cordova plugin add cordova-plugin-inappbrowser
npm install --save @ionic-native/in-app-browser

then follow above or see

try this:"",'_system', 'location=yes');

it worked for me. tanx

1 Like

This is the best answer i was looking for


Simple and elegant, thanks!

1 Like

This does not work on iOS.

1 Like

Did you resolve it with iOS?

You will also have to install the InAppBrowser plugin. Only installing this plugin it work :slight_smile:

Is there any way to open a local HTML file (ex: asset>test>test.html) by in ionic?

1 Like

My solution

document.onclick =  (e) => {
          let event = e || window.event;
          let element: any = || event.srcElement;
          if(element.tagName !== 'A')
            element = element.parentNode;
          if(element.tagName == 'A' && element.href !== undefined){
            if (this._isApp){
                this.iab.create(element.href, "_system", "location=yes,enableviewportscale=yes");
      , "_system", "location=yes");
            return false;


just remove the <allow-navigation from the config.xml

1 Like

It’s works!, Thanks! :slight_smile:

Hi, this answer may come bit late but the question is still valid and this may help someone that is looking the answer for this issue. I spent hours to get this done. It seems that the only way is to use Cordova’s Inappbrowser.

First, install Cordova InAppBrowser:

cordova plugin add cordova-plugin-inappbrowser

Then replace the (this step is not necessary, but it makes things simplier) =;

Then you can call:

<a href="" onclick="'', '_system'); return false;">Google</a>

This will open Google in device’s browser. The return false; is important, otherwise the target URL will be opened in webview as well.

I have written more detailed blog article about the issue here

Perfect! Thanks. :smiley:

try this code:

open('YOUR URL');