0

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

  1. Make sure you have Instagram installed
  2. Goto https://namaggarwal.github.io/open_test_links/intent.html
  3. Click on Instagram
  4. 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>
user311086
  • 920
  • 2
  • 16
  • 29
Ghost
  • 396
  • 1
  • 15

0 Answers0