admin管理员组

文章数量:1425674

So, WAY back in the day with ionic (and Cordova), if you just put a link on a page and didn't have the "InAppBrowser" plugin installed, the clicked links would take over the whole app screen, this was largely considered a pain in the butt. Fast forward to today when I actually need a link to open in the FULL web view, and it appears that the fix for this has been put back in place, and I can no longer just put a link there without the plugin.

Anyone know how I can make that work?

So here's the deal: I have a client that wants a "mobile app" even though their site is already mobile ready. I wanted to do an experiment that basically just uses Ionic/Cordova to init the app (Android primarily), load the Ionic splash screen, then just redirect the user to the website, but keep it in the App Web View, so it looks like they are in the app, not the web site. I'll later add in some net checks, etc, but not right now.

Any thoughts?

So, WAY back in the day with ionic (and Cordova), if you just put a link on a page and didn't have the "InAppBrowser" plugin installed, the clicked links would take over the whole app screen, this was largely considered a pain in the butt. Fast forward to today when I actually need a link to open in the FULL web view, and it appears that the fix for this has been put back in place, and I can no longer just put a link there without the plugin.

Anyone know how I can make that work?

So here's the deal: I have a client that wants a "mobile app" even though their site is already mobile ready. I wanted to do an experiment that basically just uses Ionic/Cordova to init the app (Android primarily), load the Ionic splash screen, then just redirect the user to the website, but keep it in the App Web View, so it looks like they are in the app, not the web site. I'll later add in some net checks, etc, but not right now.

Any thoughts?

Share Improve this question asked Jan 30, 2016 at 1:09 CMIVXXCMIVXX 8231 gold badge7 silver badges6 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

You indeed need the inappbrowser plugin installed, do this by typing in your CLI:

cordova plugin add cordova-plugin-inappbrowser

then you can use:

window.open(url, target, options);

In your code to open the url, where target can be:

'_self': Opens in the Cordova WebView if the URL is in the white list, otherwise it opens in the InAppBrowser.

'_blank': Opens in the InAppBrowser.

'_system': Opens in the system's web browser.

For the options I remend reading the README of the plugin on github if you haven't read it already.

本文标签: javascriptIonic AppCan39t get links to open in WebViewStack Overflow