Last active
September 17, 2020 17:58
-
-
Save shazron/4694032 to your computer and use it in GitHub Desktop.
Anchor tag link replace for InAppBrowser (Apache Cordova)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// warning, jQuery code below | |
$(document).ready(function() { | |
var $a = $("a"); | |
$a.click(function(x) { | |
x.preventDefault(); | |
var url = $(this).attr('href'); | |
launchUrl(url); // where launchUrl is your function that calls window.open, etc | |
}); | |
}); |
Dumb question, but... how exactly do I call this into my Ionic project? I get that I should create the js file, reference it in index.html, but any other code I need to add to the above to make it update all my links to open in the inAppBrowser?
Thanks!
ditto -> I have the same problem. I want to open dynamically generated links in an iframe (with code I do not control) in the inAppBrowser.
Yep I have this problem too... the little youtube logo in embedded youtube videos open in the current webview in my app. You have to quit the app to get back. Terrible experience.
Hey @benmcmaster, any luck resolving this?
Is it possible to make anchor tags in iframe also opens in inappbrowser
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@geogir I'm experiencing the same issue. were you able to find a work-around?