Instagram is eating your App Store links

Tap an App Store link inside Instagram and you get a blank screen. Not an error — nothing. Here's the technique that still works, the code, free, and a shortener that does it for you.

App Store links only — that's deliberate. A shortener that accepts any URL is a phishing tool, so this one can physically only send people to Apple.

Why your links break

  1. Link straight to the App Store. Instagram's browser can't hand itms-apps:// to the App Store app, so Apple's redirect dies in the WebView. blank screen
  2. Link to your website, which links to the App Store. Same wall, one click later. blank screen
  3. Tell people to tap ••• → Open in external browser. Works, every time, but you're asking for a favour at the exact moment you want a download. works
  4. Break out of the in-app browser for them. One tap, straight to the App Store. The code is below. works

The part everyone gets wrong

Don't use x-safari-https://. Every guide still recommends it. Instagram blocks it now — and because it only ever fired through window.open(), Instagram answers with a blank tab inside its own browser.

That call returns a real window object, so code that treats it as success hides its own fallback and strands the visitor on a blank screen. That's worse than the bug you started with, and several paid smart-link services still ship it today. Use same-tab navigations only: a refused scheme is silently cancelled and leaves the visitor exactly where they were.

The fix

Two schemes and an honest fallback. Public domain — no credit needed.

// Android: hand the URL to the OS.
location.href = "intent://" + url.replace(/^https?:\/\//, "") +
  "#Intent;scheme=https;action=android.intent.action.VIEW;" +
  "S.browser_fallback_url=" + encodeURIComponent(url) + ";end";

// iOS Instagram + Threads: Instagram's own "open this outside" scheme.
location.href = "instagram://extbrowser/?url=" + encodeURIComponent(url);

// Then check whether you actually left. None of these three fires
// reliably on its own in these WebViews, so listen for all of them —
// and if you're still here after 1.5s, show the manual steps.
addEventListener("pagehide", left);
addEventListener("blur", left);
document.addEventListener("visibilitychange", onVis);

Full drop-in version, ~130 lines with the fallback UI: instagram-escape.js — paste it before </body>, no config.

When Instagram patches this

They will. I'll find the next one and send it to you — plus whatever else I learn shipping apps. No spam, unsubscribe anytime.