@capgo/capacitor-inappbrowser 8.22.5 → 8.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -79
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java +1 -0
- package/dist/docs.json +37 -1
- package/dist/esm/definitions.d.ts +64 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +39 -11
- package/dist/esm/web.js +324 -64
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +407 -152
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +407 -152
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/InAppBrowserPlugin/InAppBrowserPlugin.swift +4 -1
- package/ios/Sources/InAppBrowserPlugin/WKWebViewController.swift +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -739,6 +739,7 @@ open(options: OpenOptions) => Promise<any>
|
|
|
739
739
|
```
|
|
740
740
|
|
|
741
741
|
Open url in a new window fullscreen, on android it use chrome custom tabs, on ios it use SFSafariViewController
|
|
742
|
+
On web, opens the URL in a new tab via `window.open` and rejects with `Popup blocked` when the browser blocks it.
|
|
742
743
|
|
|
743
744
|
| Param | Type |
|
|
744
745
|
| ------------- | --------------------------------------------------- |
|
|
@@ -1685,85 +1686,87 @@ See the README section "openSecureWindow (OAuth)" for full setup examples.
|
|
|
1685
1686
|
|
|
1686
1687
|
#### OpenWebViewOptions
|
|
1687
1688
|
|
|
1688
|
-
| Prop | Type | Description
|
|
1689
|
-
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1690
|
-
| **`fullscreen`** | <code>boolean</code> | Present this webview in immersive fullscreen from its first visible frame. Hides native navigation and system bars and provides a native exit-fullscreen button. The same webview, page state, cookies, and history are retained on entry and exit. Exiting restores the configured toolbar and safe-area settings. Applies before presentation, including when `isPresentAfterPageLoad` is true. With `hidden: true`, waits for the first `show()` without changing the host's system bars. Subsequent hide/show or background/resume cycles do not re-enter fullscreen automatically. Only supported on iOS and Android for full-size, frontmost `openWebView` presentations. Custom dimensions and `toBack: true` are unsupported. The Web implementation rejects `true`. Permission prompts, if needed, are the host application's responsibility.
|
|
1691
|
-
| **`url`** | <code>string</code> | Target URL to load. Remote `http://` and `https://` URLs are loaded as-is. To open bundled web assets from the app bundle without running a local HTTP server, pass a relative path such as `/index.html` or `assets/page.html`. The plugin resolves it to the Capacitor local URL for the current platform (defaults: `capacitor://localhost/...` on iOS, `https://localhost/...` on Android; actual scheme and host follow the app's configured Capacitor local URL) and serves files from the packaged `public/` directory, or `www/` on iOS when `public/` is absent.
|
|
1692
|
-
| **`headers`** | <code><a href="#headers">Headers</a></code> | <a href="#headers">Headers</a> to send with the request.
|
|
1693
|
-
| **`customUserAgent`** | <code>string</code> | Custom User-Agent string for the webview. When set, replaces the system default webview User-Agent on iOS and Android. Takes precedence over a `User-Agent` entry in `headers`.
|
|
1694
|
-
| **`credentials`** | <code><a href="#credentials">Credentials</a></code> | <a href="#credentials">Credentials</a> to send with the request and all subsequent requests for the same host.
|
|
1695
|
-
| **`method`** | <code>string</code> | HTTP method to use for the initial request. **Optional parameter - defaults to GET if not specified.** Existing code that doesn't provide this parameter will continue to work unchanged with standard GET requests. When specified with 'POST', 'PUT', or 'PATCH' methods that support a body, you can also provide a `body` parameter with the request payload. **Platform Notes:** - iOS: Full support for all HTTP methods with headers - Android: Custom headers may not be sent with POST/PUT/PATCH requests due to WebView limitations
|
|
1696
|
-
| **`body`** | <code>string</code> | HTTP body to send with the request when using POST, PUT, or other methods that support a body. Should be a string (use JSON.stringify for JSON data). **Optional parameter - only used when `method` is specified and supports a request body.** Omitting this parameter (or using GET method) results in standard behavior without a request body.
|
|
1697
|
-
| **`materialPicker`** | <code>boolean</code> | materialPicker: if true, uses Material Design theme for date and time pickers on Android. This improves the appearance of HTML date inputs to use modern Material Design UI instead of the old style pickers.
|
|
1698
|
-
| **`jsInterface`** | | JavaScript Interface: The webview automatically injects a JavaScript interface providing: - `window.mobileApp.close()`: Closes the webview from JavaScript - `window.mobileApp.postMessage(obj)`: Sends a message to the app (listen via "messageFromWebview" event) - `window.mobileApp.hide()` / `window.mobileApp.show()` when allowWebViewJsVisibilityControl is true in CapacitorConfig - `window.mobileApp.takeScreenshot()` when `allowScreenshotsFromWebPage` is true
|
|
1699
|
-
| **`allowScreenshotsFromWebPage`** | <code>boolean</code> | Allows page JavaScript to call `window.mobileApp.takeScreenshot()`. Disabled by default so only the host app can trigger native screenshots through the plugin API.
|
|
1700
|
-
| **`captureConsoleLogs`** | <code>boolean</code> | Emits `consoleMessage` events for JavaScript `console.*` output coming from the managed page. Useful when the webview stays hidden and you still need page-level diagnostics.
|
|
1701
|
-
| **`persistWebViewData`** | <code>boolean</code> | Controls whether the webview should persist website data such as cache, cookies, local storage, IndexedDB, and session data. When false, iOS uses a non-persistent `WKWebsiteDataStore`. Android disables per-view cache and database storage where the system WebView supports it while keeping DOM storage available so SPAs can use `localStorage`. Android cookies use the shared WebView cookie store; clearing them also affects the host WebView, so prefer per-URL cookie helpers instead of relying on process-global wipes.
|
|
1702
|
-
| **`clearCookiesOnOpen`** | <code>boolean</code> | Clear all cookies from the InAppBrowser data store before the first navigation of this webview. Cordova `clearcache: 'yes'` parity. On Android, uses process-global `CookieManager.removeAllCookies()` and starts the first navigation after the wipe callback (does not block the UI thread). On iOS, clears cookies from the webview's `WKWebsiteDataStore` (isolated plugin store by default). On Web this is a no-op.
|
|
1703
|
-
| **`clearCacheOnOpen`** | <code>boolean</code> | Clear cached website data before the first navigation of this webview. Cordova `cleardata: 'yes'` parity. On Android, calls `WebView.clearCache(true)` after the webview is created. On iOS, removes disk and memory cache from the webview's `WKWebsiteDataStore`. On Web this is a no-op.
|
|
1704
|
-
| **`useSharedDataStore`** | <code>boolean</code> | Share the host Capacitor WebView's website data store (cookies, local storage, etc.). On iOS 17+, InAppBrowser uses an isolated plugin-owned `WKWebsiteDataStore` by default so host and browser data stay separate. Set this to `true` to use `WKWebsiteDataStore.default()` instead, which shares session cookies with the Capacitor host WebView. Useful for SSO / OIDC silent login when the IdP session was established in the main app WebView. Requires `persistWebViewData: true` (the default). When `persistWebViewData` is false, a non-persistent store is used and this option has no effect. On Android this is a no-op: cookies are already process-global via `CookieManager`. On Web this is a no-op. Warning: clearing cookies/cache for a webview opened with this flag can affect the host WebView on iOS, because both share the same store. `clearAllBrowsingData()` still skips the host store.
|
|
1705
|
-
| **`clientCertificate`** | <code>'none' \| 'prompt'</code> | Controls Android TLS client certificate prompts during HTTPS handshakes. Use `prompt` to show the system certificate picker; omit or use `none` to cancel silently (default).
|
|
1706
|
-
| **`clientCertificatePrompt`** | <code>boolean</code> |
|
|
1707
|
-
| **`handleDownloads`** | <code>boolean</code> | Automatically handles downloads triggered inside the webview without requiring a custom JavaScript bridge. When enabled: - Standard attachment responses are written to a temporary file. - `blob:` downloads are also captured when the platform supports them. - Previewable files reopen inside the in-app browser when possible (see `downloadPreview`). - Other files are handed off to the native preview or viewer flow. - `downloadCompleted` and `downloadFailed` events notify the host app about the saved file.
|
|
1708
|
-
| **`openWalletPasses`** | <code>boolean</code> | Opens managed Apple Wallet pass downloads (`.pkpass`) in the Wallet add-pass sheet instead of the download preview. Falls back to the regular download preview when the device can't add passes. An invalid pass emits `downloadFailed`. A shown sheet emits `downloadCompleted` with `handledBy: 'wallet'`. Requires `handleDownloads: true`. iOS only; ignored on Android.
|
|
1709
|
-
| **`downloadPreview`** | <code><a href="#downloadpreview">DownloadPreview</a></code> | Controls where managed downloads are previewed after saving. - `'inAppBrowser'` (default): Reopens previewable files (PDF, images, text, JSON) inside the same webview. - `'systemPreview'`: Opens the system Quick Look preview with share and Save to Files actions. iOS only; ignored on Android. Requires `handleDownloads: true`.
|
|
1710
|
-
| **`shareDisclaimer`** | <code><a href="#disclaimeroptions">DisclaimerOptions</a></code> | Share options for the webview. When provided, shows a disclaimer dialog before sharing content. This is useful for: - Warning users about sharing sensitive information - Getting user consent before sharing - Explaining what will be shared - Complying with privacy regulations Note: shareSubject is required when using shareDisclaimer
|
|
1711
|
-
| **`toolbarType`** | <code><a href="#toolbartype">ToolBarType</a></code> | Toolbar type determines the appearance and behavior of the browser's toolbar - "activity": Shows a simple toolbar with just a close button and share button - "navigation": Shows a full navigation toolbar with back/forward buttons - "blank": Shows no toolbar - "": Default toolbar with close button
|
|
1712
|
-
| **`shareSubject`** | <code>string</code> | Subject text for sharing. Required when using shareDisclaimer. This text will be used as the subject line when sharing content.
|
|
1713
|
-
| **`title`** | <code>string</code> | Title of the browser
|
|
1714
|
-
| **`titleFontFamily`** | <code>string</code> | Native toolbar title font family. On iOS, use the registered font family name. On Android, the plugin first tries a res/font resource name, then falls back to a system font family name.
|
|
1715
|
-
| **`titleIcon`** | <code><a href="#toolbartitleiconoptions">ToolbarTitleIconOptions</a></code> | Native toolbar title icon displayed before the title text. For Android: - iconType can be "asset" for a bundled SVG asset or "vector" for a drawable resource - icon path should be in the public folder for assets (e.g. "brand.svg") - width and height are optional and default to 24dp For iOS: - iconType can be "sf-symbol" or "asset" - for sf-symbol, icon should be the symbol name - for asset, icon should be the asset name or bundled web asset path
|
|
1716
|
-
| **`backgroundColor`** | <code><a href="#backgroundcolor">BackgroundColor</a></code> | Background color of the browser
|
|
1717
|
-
| **`activeNativeNavigationForWebview`** | <code>boolean</code> | If true, enables native navigation gestures within the webview. - Android: Native back button navigates within webview history - iOS: Enables swipe left/right gestures for back/forward navigation
|
|
1718
|
-
| **`enableReloadGesture`** | <code>boolean</code> | Enable pull-to-refresh (overscroll from top) to reload the current page. - iOS: Uses UIRefreshControl on the WebView scroll view (reload commits on finger release) - Android: Uses SwipeRefreshLayout around the WebView On iOS, this requires overscroll bounce. If `disableOverscroll` is `true`, the reload gesture will not work.
|
|
1719
|
-
| **`allowWebViewFullscreen`** | <code>boolean</code> | Allow pages to enter HTML5 fullscreen (e.g. `requestFullscreen()` or a video player's fullscreen button). When `false`, fullscreen requests are rejected and the toolbar stays visible, so the user can always close the browser. Android only. On iOS, element fullscreen is not enabled by the plugin, so this option has no effect.
|
|
1720
|
-
| **`disableGoBackOnNativeApplication`** | <code>boolean</code> | Disable the possibility to go back on native application, useful to force user to stay on the webview, Android only
|
|
1721
|
-
| **`isPresentAfterPageLoad`** | <code>boolean</code> | Open url in a new window fullscreen isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately. Promise timing: on Android, `openWebView()` resolves with the webview id when the webview is ready to be controlled (immediately for hidden/immediate presentation, after the first page load when `isPresentAfterPageLoad` is `true`). On iOS, the promise resolves with the id as soon as the native webview is created, even if presentation is deferred.
|
|
1722
|
-
| **`preferredContentMode`** | <code><a href="#preferredcontentmode">PreferredContentMode</a></code> | Web content rendering mode for the managed WKWebView. Controls whether pages load with mobile or desktop layout on iPad. Matches Capacitor's `ios.preferredContentMode` behavior. Resolution order when opening a webview: 1. This per-open value 2. Plugin config `plugins.CapgoInAppBrowser.preferredContentMode` 3. Legacy plugin config `plugins.InAppBrowser.preferredContentMode` 4. Capacitor config `ios.preferredContentMode` When unset at all levels, the system default applies (device-recommended). **iOS only** — ignored on Android and Web.
|
|
1723
|
-
| **`
|
|
1724
|
-
| **`
|
|
1725
|
-
| **`
|
|
1726
|
-
| **`
|
|
1727
|
-
| **`
|
|
1728
|
-
| **`
|
|
1729
|
-
| **`
|
|
1730
|
-
| **`
|
|
1731
|
-
| **`
|
|
1732
|
-
| **`
|
|
1733
|
-
| **`
|
|
1734
|
-
| **`
|
|
1735
|
-
| **`
|
|
1736
|
-
| **`
|
|
1737
|
-
| **`
|
|
1738
|
-
| **`
|
|
1739
|
-
| **`
|
|
1740
|
-
| **`
|
|
1741
|
-
| **`
|
|
1742
|
-
| **`
|
|
1743
|
-
| **`
|
|
1744
|
-
| **`
|
|
1745
|
-
| **`
|
|
1746
|
-
| **`
|
|
1747
|
-
| **`
|
|
1748
|
-
| **`
|
|
1749
|
-
| **`
|
|
1750
|
-
| **`
|
|
1751
|
-
| **`
|
|
1752
|
-
| **`
|
|
1753
|
-
| **`
|
|
1754
|
-
| **`
|
|
1755
|
-
| **`
|
|
1756
|
-
| **`
|
|
1757
|
-
| **`
|
|
1758
|
-
| **`
|
|
1759
|
-
| **`
|
|
1760
|
-
| **`
|
|
1761
|
-
| **`
|
|
1762
|
-
| **`
|
|
1763
|
-
| **`
|
|
1764
|
-
| **`
|
|
1765
|
-
| **`
|
|
1766
|
-
| **`
|
|
1689
|
+
| Prop | Type | Description | Default | Since |
|
|
1690
|
+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------ |
|
|
1691
|
+
| **`fullscreen`** | <code>boolean</code> | Present this webview in immersive fullscreen from its first visible frame. Hides native navigation and system bars and provides a native exit-fullscreen button. The same webview, page state, cookies, and history are retained on entry and exit. Exiting restores the configured toolbar and safe-area settings. Applies before presentation, including when `isPresentAfterPageLoad` is true. With `hidden: true`, waits for the first `show()` without changing the host's system bars. Subsequent hide/show or background/resume cycles do not re-enter fullscreen automatically. Only supported on iOS and Android for full-size, frontmost `openWebView` presentations. Custom dimensions and `toBack: true` are unsupported. The Web implementation rejects `true`. Permission prompts, if needed, are the host application's responsibility. | <code>false</code> | |
|
|
1692
|
+
| **`url`** | <code>string</code> | Target URL to load. Remote `http://` and `https://` URLs are loaded as-is. To open bundled web assets from the app bundle without running a local HTTP server, pass a relative path such as `/index.html` or `assets/page.html`. The plugin resolves it to the Capacitor local URL for the current platform (defaults: `capacitor://localhost/...` on iOS, `https://localhost/...` on Android; actual scheme and host follow the app's configured Capacitor local URL) and serves files from the packaged `public/` directory, or `www/` on iOS when `public/` is absent. | | 0.1.0 |
|
|
1693
|
+
| **`headers`** | <code><a href="#headers">Headers</a></code> | <a href="#headers">Headers</a> to send with the request. | | 0.1.0 |
|
|
1694
|
+
| **`customUserAgent`** | <code>string</code> | Custom User-Agent string for the webview. When set, replaces the system default webview User-Agent on iOS and Android. Takes precedence over a `User-Agent` entry in `headers`. | | 8.13.0 |
|
|
1695
|
+
| **`credentials`** | <code><a href="#credentials">Credentials</a></code> | <a href="#credentials">Credentials</a> to send with the request and all subsequent requests for the same host. | | 6.1.0 |
|
|
1696
|
+
| **`method`** | <code>string</code> | HTTP method to use for the initial request. **Optional parameter - defaults to GET if not specified.** Existing code that doesn't provide this parameter will continue to work unchanged with standard GET requests. When specified with 'POST', 'PUT', or 'PATCH' methods that support a body, you can also provide a `body` parameter with the request payload. **Platform Notes:** - iOS: Full support for all HTTP methods with headers - Android: Custom headers may not be sent with POST/PUT/PATCH requests due to WebView limitations | <code>"GET"</code> | 8.2.0 |
|
|
1697
|
+
| **`body`** | <code>string</code> | HTTP body to send with the request when using POST, PUT, or other methods that support a body. Should be a string (use JSON.stringify for JSON data). **Optional parameter - only used when `method` is specified and supports a request body.** Omitting this parameter (or using GET method) results in standard behavior without a request body. | | 8.2.0 |
|
|
1698
|
+
| **`materialPicker`** | <code>boolean</code> | materialPicker: if true, uses Material Design theme for date and time pickers on Android. This improves the appearance of HTML date inputs to use modern Material Design UI instead of the old style pickers. | <code>false</code> | 7.4.1 |
|
|
1699
|
+
| **`jsInterface`** | | JavaScript Interface: The webview automatically injects a JavaScript interface providing: - `window.mobileApp.close()`: Closes the webview from JavaScript - `window.mobileApp.postMessage(obj)`: Sends a message to the app (listen via "messageFromWebview" event) - `window.mobileApp.hide()` / `window.mobileApp.show()` when allowWebViewJsVisibilityControl is true in CapacitorConfig - `window.mobileApp.takeScreenshot()` when `allowScreenshotsFromWebPage` is true | | 6.10.0 |
|
|
1700
|
+
| **`allowScreenshotsFromWebPage`** | <code>boolean</code> | Allows page JavaScript to call `window.mobileApp.takeScreenshot()`. Disabled by default so only the host app can trigger native screenshots through the plugin API. | <code>false</code> | 8.4.0 |
|
|
1701
|
+
| **`captureConsoleLogs`** | <code>boolean</code> | Emits `consoleMessage` events for JavaScript `console.*` output coming from the managed page. Useful when the webview stays hidden and you still need page-level diagnostics. | <code>false</code> | 8.6.0 |
|
|
1702
|
+
| **`persistWebViewData`** | <code>boolean</code> | Controls whether the webview should persist website data such as cache, cookies, local storage, IndexedDB, and session data. When false, iOS uses a non-persistent `WKWebsiteDataStore`. Android disables per-view cache and database storage where the system WebView supports it while keeping DOM storage available so SPAs can use `localStorage`. Android cookies use the shared WebView cookie store; clearing them also affects the host WebView, so prefer per-URL cookie helpers instead of relying on process-global wipes. | <code>true</code> | 8.6.36 |
|
|
1703
|
+
| **`clearCookiesOnOpen`** | <code>boolean</code> | Clear all cookies from the InAppBrowser data store before the first navigation of this webview. Cordova `clearcache: 'yes'` parity. On Android, uses process-global `CookieManager.removeAllCookies()` and starts the first navigation after the wipe callback (does not block the UI thread). On iOS, clears cookies from the webview's `WKWebsiteDataStore` (isolated plugin store by default). On Web this is a no-op. | <code>false</code> | 8.16.0 |
|
|
1704
|
+
| **`clearCacheOnOpen`** | <code>boolean</code> | Clear cached website data before the first navigation of this webview. Cordova `cleardata: 'yes'` parity. On Android, calls `WebView.clearCache(true)` after the webview is created. On iOS, removes disk and memory cache from the webview's `WKWebsiteDataStore`. On Web this is a no-op. | <code>false</code> | 8.16.0 |
|
|
1705
|
+
| **`useSharedDataStore`** | <code>boolean</code> | Share the host Capacitor WebView's website data store (cookies, local storage, etc.). On iOS 17+, InAppBrowser uses an isolated plugin-owned `WKWebsiteDataStore` by default so host and browser data stay separate. Set this to `true` to use `WKWebsiteDataStore.default()` instead, which shares session cookies with the Capacitor host WebView. Useful for SSO / OIDC silent login when the IdP session was established in the main app WebView. Requires `persistWebViewData: true` (the default). When `persistWebViewData` is false, a non-persistent store is used and this option has no effect. On Android this is a no-op: cookies are already process-global via `CookieManager`. On Web this is a no-op. Warning: clearing cookies/cache for a webview opened with this flag can affect the host WebView on iOS, because both share the same store. `clearAllBrowsingData()` still skips the host store. | <code>false</code> | 8.13.6 |
|
|
1706
|
+
| **`clientCertificate`** | <code>'none' \| 'prompt'</code> | Controls Android TLS client certificate prompts during HTTPS handshakes. Use `prompt` to show the system certificate picker; omit or use `none` to cancel silently (default). | <code>"none"</code> | 8.7.5 |
|
|
1707
|
+
| **`clientCertificatePrompt`** | <code>boolean</code> | | | |
|
|
1708
|
+
| **`handleDownloads`** | <code>boolean</code> | Automatically handles downloads triggered inside the webview without requiring a custom JavaScript bridge. When enabled: - Standard attachment responses are written to a temporary file. - `blob:` downloads are also captured when the platform supports them. - Previewable files reopen inside the in-app browser when possible (see `downloadPreview`). - Other files are handed off to the native preview or viewer flow. - `downloadCompleted` and `downloadFailed` events notify the host app about the saved file. | <code>false</code> | 8.6.0 |
|
|
1709
|
+
| **`openWalletPasses`** | <code>boolean</code> | Opens managed Apple Wallet pass downloads (`.pkpass`) in the Wallet add-pass sheet instead of the download preview. Falls back to the regular download preview when the device can't add passes. An invalid pass emits `downloadFailed`. A shown sheet emits `downloadCompleted` with `handledBy: 'wallet'`. Requires `handleDownloads: true`. iOS only; ignored on Android. | <code>false</code> | 8.21.0 |
|
|
1710
|
+
| **`downloadPreview`** | <code><a href="#downloadpreview">DownloadPreview</a></code> | Controls where managed downloads are previewed after saving. - `'inAppBrowser'` (default): Reopens previewable files (PDF, images, text, JSON) inside the same webview. - `'systemPreview'`: Opens the system Quick Look preview with share and Save to Files actions. iOS only; ignored on Android. Requires `handleDownloads: true`. | <code>"inAppBrowser"</code> | 8.19.0 |
|
|
1711
|
+
| **`shareDisclaimer`** | <code><a href="#disclaimeroptions">DisclaimerOptions</a></code> | Share options for the webview. When provided, shows a disclaimer dialog before sharing content. This is useful for: - Warning users about sharing sensitive information - Getting user consent before sharing - Explaining what will be shared - Complying with privacy regulations Note: shareSubject is required when using shareDisclaimer | | 0.1.0 |
|
|
1712
|
+
| **`toolbarType`** | <code><a href="#toolbartype">ToolBarType</a></code> | Toolbar type determines the appearance and behavior of the browser's toolbar - "activity": Shows a simple toolbar with just a close button and share button - "navigation": Shows a full navigation toolbar with back/forward buttons - "blank": Shows no toolbar - "": Default toolbar with close button | <code>ToolBarType.DEFAULT</code> | 0.1.0 |
|
|
1713
|
+
| **`shareSubject`** | <code>string</code> | Subject text for sharing. Required when using shareDisclaimer. This text will be used as the subject line when sharing content. | | 0.1.0 |
|
|
1714
|
+
| **`title`** | <code>string</code> | Title of the browser | <code>"New Window"</code> | 0.1.0 |
|
|
1715
|
+
| **`titleFontFamily`** | <code>string</code> | Native toolbar title font family. On iOS, use the registered font family name. On Android, the plugin first tries a res/font resource name, then falls back to a system font family name. | | 8.7.7 |
|
|
1716
|
+
| **`titleIcon`** | <code><a href="#toolbartitleiconoptions">ToolbarTitleIconOptions</a></code> | Native toolbar title icon displayed before the title text. For Android: - iconType can be "asset" for a bundled SVG asset or "vector" for a drawable resource - icon path should be in the public folder for assets (e.g. "brand.svg") - width and height are optional and default to 24dp For iOS: - iconType can be "sf-symbol" or "asset" - for sf-symbol, icon should be the symbol name - for asset, icon should be the asset name or bundled web asset path | | 8.7.7 |
|
|
1717
|
+
| **`backgroundColor`** | <code><a href="#backgroundcolor">BackgroundColor</a></code> | Background color of the browser | <code>BackgroundColor.BLACK</code> | 0.1.0 |
|
|
1718
|
+
| **`activeNativeNavigationForWebview`** | <code>boolean</code> | If true, enables native navigation gestures within the webview. - Android: Native back button navigates within webview history - iOS: Enables swipe left/right gestures for back/forward navigation | <code>false (Android), true (iOS - enabled by default)</code> | |
|
|
1719
|
+
| **`enableReloadGesture`** | <code>boolean</code> | Enable pull-to-refresh (overscroll from top) to reload the current page. - iOS: Uses UIRefreshControl on the WebView scroll view (reload commits on finger release) - Android: Uses SwipeRefreshLayout around the WebView On iOS, this requires overscroll bounce. If `disableOverscroll` is `true`, the reload gesture will not work. | <code>false</code> | 8.10.8 |
|
|
1720
|
+
| **`allowWebViewFullscreen`** | <code>boolean</code> | Allow pages to enter HTML5 fullscreen (e.g. `requestFullscreen()` or a video player's fullscreen button). When `false`, fullscreen requests are rejected and the toolbar stays visible, so the user can always close the browser. Android only. On iOS, element fullscreen is not enabled by the plugin, so this option has no effect. | <code>true</code> | 8.22.0 |
|
|
1721
|
+
| **`disableGoBackOnNativeApplication`** | <code>boolean</code> | Disable the possibility to go back on native application, useful to force user to stay on the webview, Android only | <code>false</code> | |
|
|
1722
|
+
| **`isPresentAfterPageLoad`** | <code>boolean</code> | Open url in a new window fullscreen isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately. Promise timing: on Android, `openWebView()` resolves with the webview id when the webview is ready to be controlled (immediately for hidden/immediate presentation, after the first page load when `isPresentAfterPageLoad` is `true`). On iOS, the promise resolves with the id as soon as the native webview is created, even if presentation is deferred. | <code>false</code> | 0.1.0 |
|
|
1723
|
+
| **`preferredContentMode`** | <code><a href="#preferredcontentmode">PreferredContentMode</a></code> | Web content rendering mode for the managed WKWebView. Controls whether pages load with mobile or desktop layout on iPad. Matches Capacitor's `ios.preferredContentMode` behavior. Resolution order when opening a webview: 1. This per-open value 2. Plugin config `plugins.CapgoInAppBrowser.preferredContentMode` 3. Legacy plugin config `plugins.InAppBrowser.preferredContentMode` 4. Capacitor config `ios.preferredContentMode` When unset at all levels, the system default applies (device-recommended). **iOS only** — ignored on Android and Web. | | 8.18.0 |
|
|
1724
|
+
| **`disablePrivacyScreen`** | <code>boolean</code> | If true, the app is not covered with a privacy screen when it resigns active. By default the webview is covered with the `LaunchImage` (or `Splash`) asset, so the app switcher shows that image instead of the page. Set this to show the page content, like the main Capacitor WebView. **iOS only** — ignored on Android and Web. | <code>false</code> | 8.23.0 |
|
|
1725
|
+
| **`isInspectable`** | <code>boolean</code> | Whether the website in the webview is inspectable or not, ios only | <code>false</code> | |
|
|
1726
|
+
| **`isAnimated`** | <code>boolean</code> | Whether the webview opening is animated or not, ios only | <code>true</code> | |
|
|
1727
|
+
| **`showReloadButton`** | <code>boolean</code> | Shows a reload button that reloads the web page | <code>false</code> | 1.0.15 |
|
|
1728
|
+
| **`closeAction`** | <code><a href="#closeaction">CloseAction</a></code> | closeAction controls what happens when the native toolbar close button is pressed. This does not change the behavior of close(), JavaScript window.mobileApp.close(), or native back navigation. | <code>CloseAction.CLOSE</code> | 8.7.7 |
|
|
1729
|
+
| **`closeButtonPosition`** | <code><a href="#closebuttonposition">CloseButtonPosition</a></code> | Where the native toolbar close button is placed. When omitted, each platform keeps its convention: Android places the close button at the start, iOS at the end (or at the start when `showArrow` is true). Setting this option overrides that placement on both platforms. | | 8.17.0 |
|
|
1730
|
+
| **`screenshotOnHide`** | <code>boolean</code> | Captures the visible webview and includes it as `screenshot` in `hideEvent` before the toolbar close button hides the webview. Only applies when `closeAction` is <a href="#closeaction">`CloseAction.HIDE`</a>. On iOS, capture uses `WKWebView.takeSnapshot`. When testing through Apple's iPhone Mirroring app with the physical device locked, the snapshot can succeed with the correct dimensions but a fully transparent PNG. Capture works as expected on a normal unlocked device. This appears to be an Apple mirroring limitation rather than a plugin bug. | <code>false</code> | 8.7.10 |
|
|
1731
|
+
| **`closeModal`** | <code>boolean</code> | CloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately. | <code>false</code> | 1.1.0 |
|
|
1732
|
+
| **`closeModalTitle`** | <code>string</code> | CloseModalTitle: title of the confirm when user clicks on close button | <code>"Close"</code> | 1.1.0 |
|
|
1733
|
+
| **`closeModalDescription`** | <code>string</code> | CloseModalDescription: description of the confirm when user clicks on close button | <code>"Are you sure you want to close this window?"</code> | 1.1.0 |
|
|
1734
|
+
| **`closeModalOk`** | <code>string</code> | CloseModalOk: text of the confirm button when user clicks on close button | <code>"Close"</code> | 1.1.0 |
|
|
1735
|
+
| **`closeModalCancel`** | <code>string</code> | CloseModalCancel: text of the cancel button when user clicks on close button | <code>"Cancel"</code> | 1.1.0 |
|
|
1736
|
+
| **`closeModalURLPattern`** | <code>string</code> | closeModalURLPattern: a regex pattern to match against the current URL when the close button is pressed. When provided along with closeModal: true, the close confirmation modal is only shown if the current URL matches this pattern. If the current URL does not match, the browser closes immediately without showing the modal. Requires closeModal to be true. | | 7.2.0 |
|
|
1737
|
+
| **`visibleTitle`** | <code>boolean</code> | visibleTitle: if true the website title would be shown else shown empty | <code>true</code> | 1.2.5 |
|
|
1738
|
+
| **`toolbarColor`** | <code>string</code> | toolbarColor: color of the toolbar in hex format | <code>"#ffffff"</code> | 1.2.5 |
|
|
1739
|
+
| **`toolbarTextColor`** | <code>string</code> | toolbarTextColor: color of the buttons and title in the toolbar in hex format When set, it overrides the automatic light/dark mode detection for text color | <code>calculated based on toolbarColor brightness</code> | 6.10.0 |
|
|
1740
|
+
| **`showArrow`** | <code>boolean</code> | showArrow: if true an arrow would be shown instead of cross for closing the window | <code>false</code> | 1.2.5 |
|
|
1741
|
+
| **`ignoreUntrustedSSLError`** | <code>boolean</code> | ignoreUntrustedSSLError: if true, the webview will ignore untrusted SSL errors allowing the user to view the website. | <code>false</code> | 6.1.0 |
|
|
1742
|
+
| **`preShowScript`** | <code>string</code> | preShowScript: if isPresentAfterPageLoad is true and this variable is set the plugin will inject a script before showing the browser. This script will be run in an async context. The plugin will wait for the script to finish (max 10 seconds) | | 6.6.0 |
|
|
1743
|
+
| **`preShowScriptInjectionTime`** | <code>'documentStart' \| 'pageLoad'</code> | preShowScriptInjectionTime: controls when the preShowScript is injected. - "documentStart": injects before any page JavaScript runs (good for polyfills like Firebase) - "pageLoad": injects after page load (default, original behavior) | <code>"pageLoad"</code> | 7.26.0 |
|
|
1744
|
+
| **`proxyRequests`** | <code>string \| boolean</code> | Proxy interception mode. - `true`: legacy blanket mode, delegates all HTTP/HTTPS requests to JavaScript. - `string`: Android-only regex mode kept for backward compatibility. Prefer `outboundProxyRules` and `inboundProxyRules` for native-first matching. | | 6.9.0 |
|
|
1745
|
+
| **`outboundProxyRules`** | <code>NativeProxyRule[]</code> | Native-first outbound proxy rules. | | 8.6.0 |
|
|
1746
|
+
| **`inboundProxyRules`** | <code>NativeProxyRule[]</code> | Native-first inbound proxy rules. | | 8.6.0 |
|
|
1747
|
+
| **`buttonNearDone`** | <code>{ ios: { iconType: 'sf-symbol' \| 'asset'; icon: string; }; android: { iconType: 'asset' \| 'vector'; icon: string; width?: number; height?: number; }; }</code> | buttonNearDone allows for a creation of a custom button near the done/close button. The button is only shown when toolbarType is not "activity", "navigation", or "blank". For Android: - iconType must be "asset" - icon path should be in the public folder (e.g. "monkey.svg") - width and height are optional, defaults to 48dp - button is positioned at the end of toolbar with 8dp margin For iOS: - iconType can be "sf-symbol" or "asset" - for sf-symbol, icon should be the symbol name - for asset, icon should be the asset name | | 6.7.0 |
|
|
1748
|
+
| **`showScreenshotButton`** | <code>boolean</code> | Shows a native screenshot button near the done/close button. The button is hidden by default and captures the current viewport when tapped. This option uses the same toolbar slot as `buttonNearDone` and is therefore incompatible with it. The button is only shown when toolbarType is not "activity", "navigation", or "blank". | <code>false</code> | 8.4.0 |
|
|
1749
|
+
| **`textZoom`** | <code>number</code> | textZoom: sets the text zoom of the page in percent. Allows users to increase or decrease the text size for better readability. | <code>100</code> | 7.6.0 |
|
|
1750
|
+
| **`enableZoom`** | <code>boolean</code> | enableZoom: enables pinch-to-zoom gestures in the Android WebView. When true, built-in zoom controls are enabled and the zoom buttons are hidden. **Android only** — ignored on iOS where zoom is enabled by default. | <code>false</code> | 8.5.0 |
|
|
1751
|
+
| **`preventDeeplink`** | <code>boolean</code> | If true, deeplinks and external app hand-off are blocked and stay in the webview. If false (default), custom schemes such as `tel:`, `mailto:`, and `sms:` open natively. On iOS, listing a custom scheme under `LSApplicationQueriesSchemes` is only required when you rely on `canOpenURL` for that scheme (for example `instagram://`). It is not required for HTTPS `authorizedAppLinks`, and `mailto`/`tel`/`sms` open without that Info.plist entry. | <code>false</code> | 0.1.0 |
|
|
1752
|
+
| **`openBlankTargetInWebView`** | <code>boolean</code> | When true, HTTP and HTTPS links opened from `target="_blank"` anchors stay in the current webview instead of spawning a popup or opening in the system browser. By default, blank-target HTTP(S) links stay inside the plugin as managed popups that share cookies with the opener; enabling this option keeps everything in the same tab. Custom schemes such as `tel:` and `mailto:` and authorized app links still prefer their native handlers unless `preventDeeplink` is enabled. | <code>false</code> | 8.5.6 |
|
|
1753
|
+
| **`authorizedAppLinks`** | <code>string[]</code> | List of base URLs whose hosts are treated as authorized App Links (Android) and Universal Links (iOS). - On both platforms, only HTTP(S) links whose host matches any entry in this list will attempt to leave the in-app browser for the native / system handler. - iOS tries a Universal Link first (`universalLinksOnly`), then falls back to a normal system open (App Store, Safari, etc.). Only if both fail does the URL stay in-webview. - Android uses an `ACTION_VIEW` intent for matching hosts. - Matching is host-based (case-insensitive), ignoring the "www." prefix. - HTTPS hosts do not need `LSApplicationQueriesSchemes`; that Info.plist key is for custom schemes like `instagram://`, not `https://instagram.com`. - When `preventDeeplink` is enabled, all external handling is blocked regardless of this list. | <code>[]</code> | 7.12.0 |
|
|
1754
|
+
| **`enabledSafeBottomMargin`** | <code>boolean</code> | If true, the webView is inset by the bottom system bar (navigation bar) so bottom-anchored content stays reachable. When false (default), the webView can extend behind the navigation bar and apps can use `env(safe-area-inset-*)` for layout, matching the main Capacitor WebView. On pre-API 30 devices with a transparent navigation bar, bottom padding may still be applied when the window lays out behind the navigation bar regardless of this option. | <code>false</code> | 7.13.0 |
|
|
1755
|
+
| **`enabledSafeTopMargin`** | <code>boolean</code> | If false, the webView will extend behind the status bar for true full-screen immersive content. When true (default), respects the safe area at the top of the screen. Works independently of toolbarType - use for full-screen video players, games, or immersive web apps. On Android, when a toolbar is visible the toolbar itself provides that safe area; with `toolbarType: 'blank'` on Android 15+ the status bar inset is applied to the webView instead. | <code>true</code> | 8.2.0 |
|
|
1756
|
+
| **`useTopInset`** | <code>boolean</code> | When true, applies the system status bar inset to the top of the WebView on Android even when the window is not edge-to-edge (before Android 15). Keeps the legacy 0px inset by default for apps that handle padding themselves. On Android 15+ this is not needed: without a visible toolbar the status bar inset already follows `enabledSafeTopMargin`. | <code>false</code> | |
|
|
1757
|
+
| **`enableGooglePaySupport`** | <code>boolean</code> | enableGooglePaySupport: if true, enables support for Google Pay popups and Payment Request API. This fixes OR_BIBED_15 errors by allowing popup windows and configuring Cross-Origin-Opener-Policy. Only enable this if you need Google Pay functionality as it allows popup windows. When enabled: - Allows popup windows for Google Pay authentication - Sets proper CORS headers for Payment Request API - Enables multiple window support in WebView - Configures secure context for payment processing | <code>false</code> | 7.13.0 |
|
|
1758
|
+
| **`hiddenPopupWindow`** | <code>boolean</code> | Opens popup windows created by the page in hidden mode. Hidden popup windows can still be controlled with `executeScript`, `postMessage`, `show`, and `close`. Listen to `popupWindowOpened` to capture the popup id, then call `show({ id })` only if you want to reveal it. | <code>false</code> | 8.6.0 |
|
|
1759
|
+
| **`blockedHosts`** | <code>string[]</code> | blockedHosts: List of host patterns that should be blocked from loading in the InAppBrowser's internal navigations. Any request inside WebView to a URL with a host matching any of these patterns will be blocked. Supports wildcard patterns like: - "*.example.com" to block all subdomains - "www.example.*" to block wildcard domain extensions | <code>[]</code> | 7.17.0 |
|
|
1760
|
+
| **`width`** | <code>number</code> | Width of the webview in screen/window points. If not set, webview will be fullscreen width. | <code>undefined (fullscreen)</code> | |
|
|
1761
|
+
| **`height`** | <code>number</code> | Height of the webview in screen/window points. Required for custom-sized (non-fullscreen) webviews. | <code>undefined (fullscreen)</code> | |
|
|
1762
|
+
| **`x`** | <code>number</code> | X position of the webview in screen/window points from the left edge. Only effective when custom height is set. | <code>0</code> | |
|
|
1763
|
+
| **`y`** | <code>number</code> | Y position of the webview in screen/window points from the top edge. Only effective when custom height is set. | <code>0</code> | |
|
|
1764
|
+
| **`toBack`** | <code>boolean</code> | Places the native browser behind the Capacitor host WebView. Make the app background transparent to reveal it, or rely on `transparentBackground` to clear the host WebView. | <code>false</code> | |
|
|
1765
|
+
| **`transparentBackground`** | <code>boolean</code> | When `toBack` is true, makes the Capacitor host WebView transparent so the native browser can be seen behind Ionic content. Ignored when the browser is in front. | <code>true</code> | |
|
|
1766
|
+
| **`disableOverscroll`** | <code>boolean</code> | Disables the bounce (overscroll) effect on iOS WebView. When enabled, prevents the rubber band scrolling effect when users scroll beyond content boundaries. This is useful for: - Creating a more native, app-like experience - Preventing accidental overscroll states - Avoiding issues when keyboard opens/closes Note: This option only affects iOS. Android does not have this bounce effect by default. | <code>false</code> | 8.0.2 |
|
|
1767
|
+
| **`hidden`** | <code>boolean</code> | Opens the webview in hidden mode (not visible to user but fully functional). When hidden, the webview loads and executes JavaScript but is not displayed. All control methods (executeScript, postMessage, setUrl, etc.) work while hidden. Use close() to clean up the hidden webview when done. | <code>false</code> | 8.0.7 |
|
|
1768
|
+
| **`invisibilityMode`** | <code><a href="#invisibilitymode">InvisibilityMode</a></code> | Controls how a hidden webview reports its visibility and size. - AWARE: webview is aware it's hidden (dimensions may be zero). - FAKE_VISIBLE: webview is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible). | <code>InvisibilityMode.AWARE</code> | |
|
|
1769
|
+
| **`web`** | <code>{ popup?: boolean; width?: number; height?: number; }</code> | Web-only options, ignored on iOS and Android. On web, `openWebView()` opens the URL with `window.open` in a new tab (default) or a popup window. - Call it from a user gesture (e.g. a click handler), otherwise the browser popup blocker may block it; a blocked popup rejects with `Popup blocked`. - Mobile browsers ignore the window features and always open a tab. - `customUserAgent` and all presentation/styling options are ignored on web. - When `headers` is set, the initial document is loaded with `fetch(url, { headers })` and rendered in the blank window inside a sandboxed iframe with an opaque origin, so the fetched page cannot read the app's storage or DOM. That requires CORS on the target (`Access-Control-Allow-Origin` and allowed request headers), and the app's Content-Security-Policy also applies to that document. A `<base href>` built from the final response URL is injected so relative URLs resolve against the target. It applies to the first document only; later navigations are plain GET requests without those headers. When the host enables Trusted Types (`require-trusted-types-for 'script'`), the host CSP `trusted-types` directive must allow the policy name `capgo-inappbrowser`; otherwise header loads throw a clear error instead of using unsafe HTML strings. - On web, `close()`, `closeEvent`, `postMessage()` and `messageFromWebview` are wired. `executeScript`, `setUrl`, `reload`, `goBack`, cookie and browsing-data methods, and `urlChangeEvent` listeners keep their prior fulfilled web stubs; `hide`, `show`, `updateDimensions` and the safe-margin setters resolve as no-ops. The page sends messages with `window.opener.postMessage(data, appOrigin)` (header loads: `window.top.opener.postMessage`). `postMessage()` reaches direct URL opens as a standard `message` event (`event.data` is the `detail` object). Header-loaded pages inside the sandbox iframe also receive a `messageFromNative` custom event (`event.detail` is the `detail` object). `postMessage()` initially targets the opened URL's origin for direct URL opens, and the app origin for header-loaded views (the blob wrapper relays into the sandbox iframe). For direct opens, the target may switch to a popup message's full origin only when its scheme and port match the opened URL and its hostname is the same as, or a subdomain of, the opened URL hostname (parent hostnames are not accepted). - Pages that send `Cross-Origin-Opener-Policy` (common on login/OAuth pages) are cut off from the app: `closeEvent` fires right after opening and `close()` has no effect. - The opened page keeps a `window.opener` reference to the app (required so `close()` works), so only open URLs you trust. - `closeEvent` reports the originally opened `url`; the current page URL is not readable cross-origin. | | 8.23.0 |
|
|
1767
1770
|
|
|
1768
1771
|
|
|
1769
1772
|
#### Headers
|