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 badges1 Answer
Reset to default 4You 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
版权声明:本文标题:javascript - Ionic App - Can't get links to open in WebView - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745457214a2659158.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论