You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The InAppBrowser Plugin provides a web browser view that allows you to load any web page externally. It behaves as a standard web browser and is useful to load untrusted content without risking your application's security. It offers three different ways to open URLs; in a WebView, in an in-app system browser (Custom Tabs for Android and SFSafariViewController for iOS), and in the device's default browser.
Install
npm install @capacitor/inappbrowser
npx cap sync
Supported Platforms
iOS
Android
Android
The InAppBrowser plugin requires a minimum Android SDK target of 26. This is higher than the default that comes with your Capacitor application. You can update this value in your android/variables.gradle file.
import{InAppBrowser}from'@capacitor/inappbrowser';awaitInAppBrowser.addListener('browserClosed',()=>{console.log("browser was closed.");});awaitInAppBrowser.addListener('browserPageLoaded',()=>{console.log("browser was loaded.");});
Uses the hardware back button to navigate backwards through the Web View's history. If there is no previous page, the Web View will close.
pauseMedia
boolean
Makes the Web View pause/resume with the app to stop background audio.
iOSWebViewOptions
Prop
Type
Description
allowOverScroll
boolean
Turns on the Web View bounce property.
enableViewportScale
boolean
Prevents viewport scaling through a meta tag.
allowInLineMediaPlayback
boolean
Allows in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. Note: The HTML's video element must also include the webkit-playsinline attribute.
surpressIncrementalRendering
boolean
Waits until all new view content is received before being rendered.
Sets the exit animation for when the browser disappears.
AndroidBottomSheet
Prop
Type
Description
height
number
Sets the height of the bottom sheet. This will be a minimum of 50% of the screen's height. If no value is passed, we will default to the minimum value.