page_that_intents_to_package_on_load.html 562 B

123456789101112131415161718
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta name="viewport"
  5. content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
  6. </head>
  7. <body>
  8. <a id='link'>
  9. Click to intent to the package specified in the URL hash in this tab
  10. </a>
  11. <script>
  12. document.getElementById('link').href = 'intent://example.test#Intent;scheme=https;action=android.intent.action.VIEW;package=' + window.location.href.split('#')[1] + ';end';
  13. window.addEventListener("load", function() {
  14. document.getElementById("link").click();
  15. }, false);
  16. </script>
  17. </body>
  18. </html>