Can't open a link in the system browser for the life of me

This is… Infuriating to say the least. I have read every blog post, forum comment, and video and still cannot get my links to open in Safari proper. Here’s my current code:

First off, cordova-plugin-inappbrowser is installed

config.xml
<access origin="*"/> (for dev purposes only)

controllers.js
$scope.goToPage = function() { window.open('https://google.com/', "_system", "location=yes"); }

view.html
<div class="item" ng-click="goToPage();">Blah, blah</div>

Any ideas at all? Nothing in the console or Xcode debug log.

Sorry the code is so sloppy. Can’t figure out how to format it here.

What happens if you change "_system" to "_blank" ?

Same outcome: It opens the page in-app with no header or footer. Just a full-screen, undismissable, webview.

have you installed in-app-browser plugin? try to install https://github.com/apache/cordova-plugin-inappbrowser and then see what happens.

I’m having the same issue. Have installed inappbrowser, tried using _system and _blank. Having the same issues @ccpm is having. Full-screen webview with no way to close :frowning: Maybe it’s an ios9 issue?

@ccpm
After 3 days I was able to figure it out!

When you build your ionic app cordova generates a platform-specific cordova.js file in the patforms/PLATFORM/www directory. It also generates a cordova_plugins.js file in that same directory.

In your PROJECT/www/index.html file just include:

`

`

and viola it worked! (ng-cordova include is optional)

This may seem obvious to seasoned cordova / ionic developers, but to a newbie like me it was not.

Good luck!

2 Likes

THANK-YOU, THANK-YOU, THANK-YOU. That worked! Damn that was too easy.

Additionally, I have found that once you include the ionic platform web client the plugins.js file gets included automatically.

Here is the code I have right now:

<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic-platform-web-client/dist/ionic.io.bundle.min.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<!-- Cordova is bootstrapped by ionic-platform-web-client, uncomment this if you remove ionic-platform-web-client... -->
<!-- <script src="cordova.js"></script> -->
<script src="lib/ng-cordova-master/dist/ng-cordova.min.js"></script>

Again, I am relatively new when it comes to ionic, so if somebody more experience could lend a hand, it would be greatly appreciated.

I owe you a beer as well. Thank you so much!

I’m an ionic newbie having same issue. You are saying 'just include : ’
and I can only see two quotes `

Thanks

Hi, I’m a newbie to ionic. You seem to understand the solution, could you elaborate on the solution please. What is exactly what should be included in PROJECT/www/index.html

Thank you