Open External Link Problem


#1

hello, i need to open some external link from menu of my app. The links works properly, but when i open a link (ex. google.com) in ionic creator app test, i can’t come back to my app (there is not header / menu).

Question:

a) its possible to show header/menu in in app browser?
b) if not possible, can i open the link trought device browser?

thank you a lot!
m


#2

Use the inappbrowser plugin.

For the button set it with no link

Add the angular directive ‘onclick’ / window.open(‘http://www.Example.com’, ‘_blank’, ‘location=yes’)


#3

thank you so much! :slight_smile:


#4

i have set as image, but the link not work now… (not open nothing…)

:expressionless:


#5

Can you post the directive text, so I can check


#6

sure:

Directive: onclick
Value: window.open('https://google.com, ‘_blank’, ‘location=yes’)

thank you for your time
m


#7

[quote=“mgcgroup, post:6, topic:89288”]
Value: window.open('https://google.com, ‘_blank’, ‘location=yes’)

Check your code, there’s an error after the URL

Try

window.open(‘https://google.com’, ‘_blank’, ‘location=yes’)


#8

hello, thank you, the link it work now!
but how can i show app header (and menu icon) in inappbrowser?


#9

That would require iframe in an HTML component rather than using in appbrowser (as far as I know). Not sure how you would achieve that as I asked the same question awhile ago and got shot down saying it creates a bad user experience as it’s basically a web page within a web page.


#10

I find the in app browser isn’t great UI depending on the target page because it lacks navigation and stuff, it’s possible to get stuck on it.
If you want to open it in the device browser you can use

window.open(url, "_system");

#11

thank you to all for your replies