<button>open in another browser</button>
const btn = document.querySelector('button')
btn.addEventListener('click', () => {
window.open('https://example.com', '_blank')
})
Assume the HTML button above will be viewed in an Android WebView.
I need the link to open in an external browser. For this, I know that it is necessary to program both on the front-end and on the back-end.
In Java, for another application to open the link as expected, you need to use Intent
, as shown in this post:
https://stackoverflow.com/a/17994857
What I need to know is how to program JavaScript so that _blank
is understood by Java as a link that must be opened externally.