How to open a link inside the cordova app itself?


#1

I want to open a link from my cordova app inside the app itself, not in the default browser. How would I do this?


Something similar to this.


#2

@gg2001

  1. In your mobile-config file you need to add an access rule to allow the app to navigate to the external domain:
    App.accessRule(‘https://externalsite.com’, { type: ‘navigation’ } );

  2. If I understand what you’re trying to do correctly, you’ll probably need this cordova plugin:
    https://github.com/apache/cordova-plugin-inappbrowser

  3. And if the link is an a tag make sure to pass _blank not _system (_system will use the system’s default browser to open the link)

If you’re still having access issues, I’d recommend reading and understanding these two pieces of documentation:


https://cordova.apache.org/docs/en/latest/guide/appdev/whitelist/