๐ŸŒ InAppBrowserEscaper Demo

Current Browser Status

Loading...

๐Ÿ”ง Test Controls

Use these buttons to test different scenarios:

๐Ÿ“ฑ Simulate Different In-App Browsers

Test the library with different simulated in-app browsers:

๐Ÿ“Š Detection Results

๐Ÿ” Real Device Testing

For comprehensive testing:
  1. iOS Testing: Share this page to Instagram and Facebook on iPhone/iPad
  2. Android Testing: Open the shared link within social media apps
  3. Force Escape: Try the "๐Ÿš€ Force Escape" button
  4. Monitor Results: Check console logs for detailed strategy information

๐Ÿ’ป Code Examples

Basic Usage:

import InAppBrowserEscaper, { InAppBrowserDetector } from '@jhrunning/inappbrowserescaper';

// Check if user is in an in-app browser
if (InAppBrowserDetector.isInAppBrowser()) {
  // Escape the in-app browser
  InAppBrowserEscaper.escape();
}

Custom Options:

InAppBrowserEscaper.escape({
  message: 'For the best experience, please open this in your browser',
  buttonText: 'Open in Browser',
  showModal: true
});

Auto-redirect (default behavior):

const browserInfo = InAppBrowserDetector.analyze();
if (browserInfo.appName === 'instagram') {
  // Calling escape() without showModal will auto-redirect
  InAppBrowserEscaper.escape();
}

Using fallbackUrl:

// Redirect to a specific URL instead of current page
InAppBrowserEscaper.escape({
  fallbackUrl: 'https://jhrun.com',
  showModal: true,
  buttonText: 'Continue to Site'
});

// Auto-redirect to app store or landing page
InAppBrowserEscaper.escape({
  fallbackUrl: 'https://apps.apple.com/app/your-app',
  message: 'Get the best experience with our mobile app!'
  // showModal: false is default, so it will auto-redirect
});