eiab

Escape In-App Browser — Detect and escape from in-app browsers (Instagram, Facebook, Twitter, KakaoTalk, LINE, etc.)

Zero DependenciesESM Only< 1KB
Try It Yourself
Share this page and open it from Instagram, Facebook, or Twitter to see eiab in action
Your browser:Checking...

Open the shared link from Instagram, Facebook, Twitter, or any other app to test detection

Code
<EiabSuccess>
  <p>You're in a normal browser!</p>
</EiabSuccess>
<EiabFailed>
  <p>Please open in Safari or Chrome.</p>
</EiabFailed>
Live Result

Loading...

Core API Demo
Test in-app browser detection with different user agents
Simulated User Agent
Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1
isInAppBrowser()Normal Browser
getEscapeUrl()
null (no escape needed)
React Components
Conditional rendering with EiabSuccess and EiabFailed
useIsInAppBrowser():null (SSR)
Loading...

Code Example:

<EiabSuccess>
  <p>You're in a normal browser!</p>
</EiabSuccess>
<EiabFailed>
  <p>Please open in Safari or Chrome.</p>
</EiabFailed>
Escape Strategies
Platform-specific methods to escape in-app browsers
iOS (Generic)
x-safari-https://...

Opens directly in Safari

Android (Generic)
intent://...#Intent;package=com.android.chrome;end

Chrome Intent URI for reliable escape

KakaoTalk
kakaotalk://web/openExternal?url=...

Uses KakaoTalk's native external browser scheme

LINE (iOS/Android)
?openExternalBrowser=1

LINE respects this query parameter on both platforms

Quick Start
Add eiab to your app in seconds
Install
bun add eiab
Vanilla JS
import { attemptEscape } from "eiab"

// Auto-escapes if in-app browser detected
attemptEscape()
React / Next.js
import { EscapeInAppBrowser } from "eiab/react"

export default function Layout({ children }) {
  return (
    <>
      <EscapeInAppBrowser />
      {children}
    </>
  )
}