Suppose that I have 2 pages A and B. On click on a link on A, I redirect my app to page B. This page B just redirects to an App by setting window.location=<web_intent_link>
using intents. The problem is that after doing this chrome automatically redirects back to page A. How can I make chrome remain on page B.
How to replicate
- Make sure you have Instagram installed
- Goto https://namaggarwal.github.io/open_test_links/intent.html
- Click on Instagram
- It redirects to a different page then opens Instagram while redirecting to original page.
Code is available here
intent.html (A)
<a href="/open_test_links/redirect_insta_intent.html">Instagram</a>
redirect_insta_intent.html (B)
<script type="text/javascript">
function redirect() {
window.location = "intent://instagram.com/_u/namaggarwal/#Intent;package=com.instagram.android;scheme=https;end"
}
(function(){
redirect();
})()
</script>