Skip to main content
URLs in your app can be loaded in three ways:
  • Internally within your app, for app-optimized web content.
  • Within an in-app browser window, for sites that are not ideal inside the main WebView (for example external websites). When the user closes the embedded browser, focus returns to your app, which helps session time and reduces bounce.
  • Externally in the device default mobile browser or the default app registered for a deep link (for example, Safari, Chrome, Google Maps, or LinkedIn). Use this for fully external content, especially third-party destinations where you have limited control and want a clear separation between your app and the external experience. Users always leave your app when a link opens externally.

In-app browser (reference)

iOSAndroid
Initial viewiOS in-app browser when it first opensAndroid in-app browser when it first opens
After scroll / menuiOS in-app browser after scrollAndroid in-app browser context menu
On iOS you can set the color of native in-app browser controls from App Studio → Branding.

In-app browser closed callback

You can detect when a user closes the in-app browser by defining median_appbrowser_closed. The app calls this function automatically when the in-app browser closes.
Regular links on a page follow the link handling rules configured for your app. You can also open URLs programmatically with the JavaScript Bridge.

JavaScript Bridge: open modes

When opening a URL through the JavaScript Bridge, use one of the following modes:
  • blank - New WebView window instance (default when mode is omitted).
  • internal - Current WebView window instance.
  • external - Mobile browser or the app registered for the URL’s deep link.
  • appbrowser - In-app browser window (see screenshots above).
Regular web links open according to the rules defined in your app. The default configuration works for many apps; you can adjust the rule set as needed. Default for “All Other Links” is App Browser By default, links to URLs on the same domain as your Website URL open Internal in your app. Links on other domains open in the App Browser. To change that, scroll to the bottom of the Link Behavior rules, edit the All Other Links rule, and set it to Internal (everything stays in the main WebView) or External (open in the system browser or default app). Order matters Rule matching is evaluated top to bottom. Put the most specific rules first and the most general rules last.

Editing a rule

To edit a rule, select the Edit control on the rule. Choose how the rule should match URLs: Toggle Include Subdomains to extend the rule to subdomains of the matched domain. To match arbitrary domains with a query flag, use a URL pattern such as https?:\/\/.*\?external=true and link to URLs like https://anysite.com/page?external=true.

Test regular expressions

URL pattern compatibilityLookahead and lookbehind expressions, including negative variants, are not supported on Android and are only available on iOS 14 and later. Rules using these patterns will silently fail to match on unsupported platforms. Use simple, positive regular expressions to ensure consistent behavior across both platforms.

Use your AI agent

Use the Median MCP with your AI agent to add link handling rules to your app. See Median MCP server to set it up.

Changing rules at runtime

To apply new internal, external, and app browser rules at runtime, run the following JavaScript Bridge command:

Context menu

The context menu is a floating menu shown when the user long-presses a link. You can turn it on or off at runtime and choose which actions appear, using the JavaScript Bridge.

Enable or disable

Set available actions

Supported actions

  • copyLink: Copies the selected link to the clipboard.
  • openExternal: Opens the selected link in the device’s external browser.

UI preview

Last modified on December 3, 2026