Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
External URL's 'replacing' app
-
I have an HTML5 resource I have uploaded which builds successfully apart from one thing, any links to external sites open within the app without any controls to close them and return to the app itself. It’s like the app is being replaced by the external website.
I’ve got the inappbrowser selected in “cordova plugins” in the project section and have added the following to config.xml with no change in the behaviour:
<allow-intent href=“http:///” />
<allow-intent href=“https:///” />
<allow-intent href=“tel:" />
<allow-intent href="sms:” />
<allow-intent href=“mailto:" />
<allow-intent href="geo:” />Does anyone know where I might be going wrong?
-
You could try setting the
target
argument of theopen
method:
https://github.com/apache/cordova-plugin-inappbrowser#cordovainappbrowseropenThis can be used to open in the inapp browser or in the system browser.
-
@emccorson thanks for the reply. Unfortunately _blank and _system both have the same result.
window.open(“http://www.bbc.co.uk”, “_blank”, “location=yes”); simply replaces the app in ios with no options to close. I’ve even tried adding the tooldbar argument like this: window.open(“http://www.bbc.co.uk”, “_blank”, “location=yes " toolbar=yes” toolbarposition=top" ); but again it just opens in the app itself with no way to close.
-
This might be obvious, but are you sure you are using the inappbrowser open method? (you need to replace window.open with cordova.InAppBrowser.open)
https://github.com/apache/cordova-plugin-inappbrowser#windowopen
-
@emccorson said in External URL's 'replacing' app:
cordova.InAppBrowser.open
Yup. The only time the links work is if they’re window.open and have _self instead of _blank.