# How to go back to application after pressing on external URL? \[SOLVED\]

**URL:** <https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582>\
**Category:** ionic-v1\
**Created:** [August 1, 2014, 2:49pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582 "2014-08-01T14:49:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoustin](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shoustin](https://forum.ionicframework.com/u/shoustin)\
**Post date:** [August 1, 2014, 2:49pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/1 "2014-08-01T14:49:23Z")

</div>

Hello,

In “About” view I have following function:

```
$scope.exturl = function() {
  
  	var url = "http://www.aaa123.com";
  	
  	var ref = window.open(url, '_blank', 'location=no');
  };

```

In HTML I have:

```
  <p>
      See <a href="" ng-click="exturl()">Privacy Policy</a>      
    </p>

```

However when I press on link and it redirects me to the site, **I try to press on back button - nothing happens**.

So I have no idea how to get back to application.

**[EDIT]**

I run on Android,

I installed `org.apache.cordova.inappbrowser` plugin:

`cordova plugin add org.apache.cordova.inappbrowser`

In `config.xml` I see:

```
 <feature name="InAppBrowser">
      <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
  </feature>

```

I changed my method to:

```
$scope.exturl = function() {  	
  	var url = "http://www.aaa123.com";
          window.open(url, '_system', 'location=yes');        
        return false;
  };

```

Still the same problem.

Thanks,

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [August 1, 2014, 3:05pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/2 "2014-08-01T15:05:52Z")

</div>

If this is ios and you have the inappbrowser installed, it should present you with a done button to close the browser. If this is android, you should have an `X` button in the browser bar.

---

<div class="post-metadata">

**Author:** ![shoustin](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shoustin](https://forum.ionicframework.com/u/shoustin)\
**Post date:** [August 1, 2014, 3:10pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/3 "2014-08-01T15:10:55Z")

</div>

please see my edit. Yes, I installed this plugin but back button doesn’t work. I don’t see “X” button in browser. Sounds like it opens default browser

---

<div class="post-metadata">

**Author:** ![shoustin](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shoustin](https://forum.ionicframework.com/u/shoustin)\
**Post date:** [August 1, 2014, 3:23pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/4 "2014-08-01T15:23:28Z")

</div>

Solution:

I didn’t run:

```
cordova prepare ios
cordova prepare android

```

It should activate plugin.

* * *

The other way that works for me is:

```
navigator.app.loadUrl(url, { openExternal:true });

```

Here you don’t need any plugin

---

<div class="post-metadata">

**Author:** ![ffabreti](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ffabreti/32/98243_2.png) [@ffabreti](https://forum.ionicframework.com/u/ffabreti)\
**Post date:** [June 13, 2015, 7:03pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/5 "2015-06-13T19:03:12Z")

</div>

Could you please elaborate how did you get to go back to the app ?

---

<div class="post-metadata">

**Author:** ![alexfradiani](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/alexfradiani/32/101039_2.png) [@alexfradiani](https://forum.ionicframework.com/u/alexfradiani)\
**Post date:** [August 25, 2016, 8:04pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/6 "2016-08-25T20:04:52Z")

</div>

According to this: [http://stackoverflow.com/questions/27137119/where-is-navigator-app-documentation](http://stackoverflow.com/questions/27137119/where-is-navigator-app-documentation)

The navigator.app object is not documented and is platform-dependant, so if someone is going to use it, should check first the implications of that…

On the other hand, the inappbrowser is working fine, I replaced the window.open calls with:  
`cordova.InAppBrowser.open(url, '_blank', 'location=yes');`

documentation for it: [https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/](https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/)

---

<div class="post-metadata">

**Author:** ![sohanmarketingmindz](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@sohanmarketingmindz](https://forum.ionicframework.com/u/sohanmarketingmindz)\
**Post date:** [September 16, 2016, 12:39pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/7 "2016-09-16T12:39:38Z")

</div>

Perfect, i really need this… thanks

---

<div class="post-metadata">

**Author:** ![mmshivukumar](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@mmshivukumar](https://forum.ionicframework.com/u/mmshivukumar)\
**Post date:** [December 13, 2017, 10:52am UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/8 "2017-12-13T10:52:34Z")

</div>

how to go back from external url to app pages using trigger event ?

please let me know process  
i have struck with redirecting url from web view to app ?

---

<div class="post-metadata">

**Author:** ![setu1421](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/setu1421/32/117123_2.png) [@setu1421](https://forum.ionicframework.com/u/setu1421)\
**Post date:** [March 4, 2018, 5:49am UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/9 "2018-03-04T05:49:27Z")

</div>

I am facing the same issure. But no one is sharing any clue to get back to the app from the inappbrowser. If i press back button from InAppBrowser, it closes my application also. Any hint?

---

<div class="post-metadata">

**Author:** ![GaneshGarad](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ganeshgarad/32/117697_2.png) [@GaneshGarad](https://forum.ionicframework.com/u/GaneshGarad)\
**Post date:** [March 4, 2018, 9:50am UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/10 "2018-03-04T09:50:10Z")

</div>

In Ionic 3, You Can use close() to perform this operation.  
example:

```auto
import {InAppBrowser, InAppBrowserEvent} from '@ionic-native/in-app-browser'; //import 

Private inAppBrowser:InAppBrowser; //in your contructor

let browser = this.inAppBrowser.create('https://www.dreamvisionary.com', '_blank', 'location=yes'); //This will open link in InAppBrowser
browser.on('loadstart').subscribe((event:InAppBrowserEvent)=>
{
     var closeUrl = 'https://www.dreamvisionary.com/thankyou'; 
     if(event.url == closeUrl)
    {
            browser.close(); //This will close InAppBrowser Automatically when closeUrl Started
     }
});

```

Above code working on Native Device…

---

<div class="post-metadata">

**Author:** ![setu1421](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/setu1421/32/117123_2.png) [@setu1421](https://forum.ionicframework.com/u/setu1421)\
**Post date:** [March 4, 2018, 6:01pm UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/11 "2018-03-04T18:01:29Z")

</div>

Sorry i am facing this issue in ionic-v3

---

<div class="post-metadata">

**Author:** ![ipe\_himanshu](https://avatars.discourse-cdn.com/v4/letter/i/f1d935/32.png) [@ipe\_himanshu](https://forum.ionicframework.com/u/ipe_himanshu)\
**Post date:** [August 27, 2021, 7:43am UTC](https://forum.ionicframework.com/t/how-to-go-back-to-application-after-pressing-on-external-url-solved/7582/12 "2021-08-27T07:43:01Z")

</div>

any solution for this type case ?

for example we have stripe checkout page into ionic app then if we open into inappbrowser then how to back to app open page from where checkout started?
