Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70433

Opening href from code embed in an Ionic app

$
0
0

@Dlazzy wrote:

Hello,

I’m facing a little problem, on my app I’m receiving code embed, like :

<p>Hello</p>
<a href="http://google.fr">Link to Google</a>

So this little piece of HTML will be well rendered in app. But if the user want to click on the link, this will open a window that create an overlay over the app with the web site. And it’s impossible to go back, the user need to close the app. This code embed can be very different, so a ‘fixed’ solution cannot be used.

Another solution is to parse the code embed, if <a href> is found, add inside the <a href> a (tap) action.
Like <a href="http://google.fr" (tap)="openExternally('http://google.fr')>Link to Google</a>". And the openExternally() function should be :
(using inAppBrowser plugin)

openExternally(url) {
    this.browser.openExternalPage(url);
  }

But I think this is a big operation, because some code embed can be huge… If there is others solutions, thanks in advance.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70433

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>