@capgo/capacitor-inappbrowser 8.13.5 → 8.14.1
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 +88 -73
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/CapgoInAppBrowserPlugin.java +64 -5
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/CustomTabsLifecycleSupport.java +84 -0
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/Options.java +11 -0
- package/dist/docs.json +17 -1
- package/dist/esm/definitions.d.ts +25 -3
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/InAppBrowserPlugin/InAppBrowserPlugin.swift +7 -2
- package/ios/Sources/InAppBrowserPlugin/WKWebViewController.swift +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -135,6 +135,19 @@ const { id } = await InAppBrowser.openWebView({
|
|
|
135
135
|
await InAppBrowser.clearAllBrowsingData();
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
+
#### Share host WebView cookies for SSO (iOS 17+)
|
|
139
|
+
|
|
140
|
+
On iOS 17+, InAppBrowser isolates cookies from the Capacitor host WebView by default. If your app completes OIDC/SSO login in the main WebView and partner sites opened in the in-app browser need that IdP session cookie, set `useSharedDataStore: true`:
|
|
141
|
+
|
|
142
|
+
```js
|
|
143
|
+
const { id } = await InAppBrowser.openWebView({
|
|
144
|
+
url: 'https://partner.example/sso',
|
|
145
|
+
useSharedDataStore: true,
|
|
146
|
+
});
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Android already shares cookies process-wide, so this flag is a no-op there. Do not enable it unless you need host session sharing — clearing cookies/cache for that webview can affect the host WebView on iOS.
|
|
150
|
+
|
|
138
151
|
#### Keep multiple browser instances ready
|
|
139
152
|
|
|
140
153
|
Use `hidden`, `hide()`, and `show()` when you need to preload or preserve several WebViews without keeping them on screen. This keeps browser state available while the native modal is dismissed so it does not block touches in the app.
|
|
@@ -743,9 +756,10 @@ This removes cookies, disk cache, memory cache, local storage, session storage,
|
|
|
743
756
|
WebSQL where supported, form data, and HTTP auth data for InAppBrowser only.
|
|
744
757
|
|
|
745
758
|
It does **not** clear the Capacitor/Ionic host WebView stores. On iOS 17+, InAppBrowser uses a
|
|
746
|
-
dedicated persistent `WKWebsiteDataStore` so host and browser data stay isolated
|
|
747
|
-
|
|
748
|
-
|
|
759
|
+
dedicated persistent `WKWebsiteDataStore` so host and browser data stay isolated (unless
|
|
760
|
+
`useSharedDataStore: true` was set on `openWebView`). On Android, process-global `CookieManager`
|
|
761
|
+
/ `WebStorage` are shared with the host WebView and are not wiped by this method; open managed
|
|
762
|
+
WebViews still clear per-view cache/history and page storage.
|
|
749
763
|
|
|
750
764
|
**Returns:** <code>Promise<any></code>
|
|
751
765
|
|
|
@@ -1540,76 +1554,77 @@ See the README section "openSecureWindow (OAuth)" for full setup examples.
|
|
|
1540
1554
|
|
|
1541
1555
|
#### OpenWebViewOptions
|
|
1542
1556
|
|
|
1543
|
-
| Prop | Type | Description
|
|
1544
|
-
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1545
|
-
| **`url`** | <code>string</code> | Target URL to load.
|
|
1546
|
-
| **`headers`** | <code><a href="#headers">Headers</a></code> | <a href="#headers">Headers</a> to send with the request.
|
|
1547
|
-
| **`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`.
|
|
1548
|
-
| **`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.
|
|
1549
|
-
| **`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
|
|
1550
|
-
| **`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.
|
|
1551
|
-
| **`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.
|
|
1552
|
-
| **`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
|
|
1553
|
-
| **`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.
|
|
1554
|
-
| **`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.
|
|
1555
|
-
| **`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 DOM/database storage where the system WebView supports it. 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.
|
|
1556
|
-
| **`
|
|
1557
|
-
| **`
|
|
1558
|
-
| **`
|
|
1559
|
-
| **`
|
|
1560
|
-
| **`
|
|
1561
|
-
| **`
|
|
1562
|
-
| **`
|
|
1563
|
-
| **`
|
|
1564
|
-
| **`
|
|
1565
|
-
| **`
|
|
1566
|
-
| **`
|
|
1567
|
-
| **`
|
|
1568
|
-
| **`
|
|
1569
|
-
| **`
|
|
1570
|
-
| **`
|
|
1571
|
-
| **`
|
|
1572
|
-
| **`
|
|
1573
|
-
| **`
|
|
1574
|
-
| **`
|
|
1575
|
-
| **`
|
|
1576
|
-
| **`
|
|
1577
|
-
| **`
|
|
1578
|
-
| **`
|
|
1579
|
-
| **`
|
|
1580
|
-
| **`
|
|
1581
|
-
| **`
|
|
1582
|
-
| **`
|
|
1583
|
-
| **`
|
|
1584
|
-
| **`
|
|
1585
|
-
| **`
|
|
1586
|
-
| **`
|
|
1587
|
-
| **`
|
|
1588
|
-
| **`
|
|
1589
|
-
| **`
|
|
1590
|
-
| **`
|
|
1591
|
-
| **`
|
|
1592
|
-
| **`
|
|
1593
|
-
| **`
|
|
1594
|
-
| **`
|
|
1595
|
-
| **`
|
|
1596
|
-
| **`
|
|
1597
|
-
| **`
|
|
1598
|
-
| **`
|
|
1599
|
-
| **`
|
|
1600
|
-
| **`
|
|
1601
|
-
| **`
|
|
1602
|
-
| **`
|
|
1603
|
-
| **`
|
|
1604
|
-
| **`
|
|
1605
|
-
| **`
|
|
1606
|
-
| **`
|
|
1607
|
-
| **`
|
|
1608
|
-
| **`
|
|
1609
|
-
| **`
|
|
1610
|
-
| **`
|
|
1611
|
-
| **`
|
|
1612
|
-
| **`
|
|
1557
|
+
| Prop | Type | Description | Default | Since |
|
|
1558
|
+
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ------ |
|
|
1559
|
+
| **`url`** | <code>string</code> | Target URL to load. | | 0.1.0 |
|
|
1560
|
+
| **`headers`** | <code><a href="#headers">Headers</a></code> | <a href="#headers">Headers</a> to send with the request. | | 0.1.0 |
|
|
1561
|
+
| **`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 |
|
|
1562
|
+
| **`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 |
|
|
1563
|
+
| **`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 |
|
|
1564
|
+
| **`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 |
|
|
1565
|
+
| **`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 |
|
|
1566
|
+
| **`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 |
|
|
1567
|
+
| **`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 |
|
|
1568
|
+
| **`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 |
|
|
1569
|
+
| **`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 DOM/database storage where the system WebView supports it. 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 |
|
|
1570
|
+
| **`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 |
|
|
1571
|
+
| **`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 |
|
|
1572
|
+
| **`clientCertificatePrompt`** | <code>boolean</code> | | | |
|
|
1573
|
+
| **`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. - 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 |
|
|
1574
|
+
| **`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 |
|
|
1575
|
+
| **`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 |
|
|
1576
|
+
| **`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 |
|
|
1577
|
+
| **`title`** | <code>string</code> | Title of the browser | <code>"New Window"</code> | 0.1.0 |
|
|
1578
|
+
| **`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 |
|
|
1579
|
+
| **`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 |
|
|
1580
|
+
| **`backgroundColor`** | <code><a href="#backgroundcolor">BackgroundColor</a></code> | Background color of the browser | <code>BackgroundColor.BLACK</code> | 0.1.0 |
|
|
1581
|
+
| **`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> | |
|
|
1582
|
+
| **`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 |
|
|
1583
|
+
| **`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> | |
|
|
1584
|
+
| **`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 |
|
|
1585
|
+
| **`isInspectable`** | <code>boolean</code> | Whether the website in the webview is inspectable or not, ios only | <code>false</code> | |
|
|
1586
|
+
| **`isAnimated`** | <code>boolean</code> | Whether the webview opening is animated or not, ios only | <code>true</code> | |
|
|
1587
|
+
| **`showReloadButton`** | <code>boolean</code> | Shows a reload button that reloads the web page | <code>false</code> | 1.0.15 |
|
|
1588
|
+
| **`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 |
|
|
1589
|
+
| **`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 |
|
|
1590
|
+
| **`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 |
|
|
1591
|
+
| **`closeModalTitle`** | <code>string</code> | CloseModalTitle: title of the confirm when user clicks on close button | <code>"Close"</code> | 1.1.0 |
|
|
1592
|
+
| **`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 |
|
|
1593
|
+
| **`closeModalOk`** | <code>string</code> | CloseModalOk: text of the confirm button when user clicks on close button | <code>"Close"</code> | 1.1.0 |
|
|
1594
|
+
| **`closeModalCancel`** | <code>string</code> | CloseModalCancel: text of the cancel button when user clicks on close button | <code>"Cancel"</code> | 1.1.0 |
|
|
1595
|
+
| **`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 |
|
|
1596
|
+
| **`visibleTitle`** | <code>boolean</code> | visibleTitle: if true the website title would be shown else shown empty | <code>true</code> | 1.2.5 |
|
|
1597
|
+
| **`toolbarColor`** | <code>string</code> | toolbarColor: color of the toolbar in hex format | <code>"#ffffff"</code> | 1.2.5 |
|
|
1598
|
+
| **`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 |
|
|
1599
|
+
| **`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 |
|
|
1600
|
+
| **`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 |
|
|
1601
|
+
| **`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 |
|
|
1602
|
+
| **`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 |
|
|
1603
|
+
| **`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 |
|
|
1604
|
+
| **`outboundProxyRules`** | <code>NativeProxyRule[]</code> | Native-first outbound proxy rules. | | 8.6.0 |
|
|
1605
|
+
| **`inboundProxyRules`** | <code>NativeProxyRule[]</code> | Native-first inbound proxy rules. | | 8.6.0 |
|
|
1606
|
+
| **`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 |
|
|
1607
|
+
| **`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 |
|
|
1608
|
+
| **`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 |
|
|
1609
|
+
| **`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 |
|
|
1610
|
+
| **`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 |
|
|
1611
|
+
| **`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 |
|
|
1612
|
+
| **`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 |
|
|
1613
|
+
| **`enabledSafeBottomMargin`** | <code>boolean</code> | If true, the webView will not take the full height and will have a 20px margin at the bottom. This creates a safe margin area outside the browser view. | <code>false</code> | 7.13.0 |
|
|
1614
|
+
| **`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. | <code>true</code> | 8.2.0 |
|
|
1615
|
+
| **`useTopInset`** | <code>boolean</code> | When true, applies the system status bar inset as the WebView top margin on Android. Keeps the legacy 0px margin by default for apps that handle padding themselves. | <code>false</code> | |
|
|
1616
|
+
| **`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 |
|
|
1617
|
+
| **`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 |
|
|
1618
|
+
| **`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 |
|
|
1619
|
+
| **`width`** | <code>number</code> | Width of the webview in screen/window points. If not set, webview will be fullscreen width. | <code>undefined (fullscreen)</code> | |
|
|
1620
|
+
| **`height`** | <code>number</code> | Height of the webview in screen/window points. Required for custom-sized (non-fullscreen) webviews. | <code>undefined (fullscreen)</code> | |
|
|
1621
|
+
| **`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> | |
|
|
1622
|
+
| **`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> | |
|
|
1623
|
+
| **`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> | |
|
|
1624
|
+
| **`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> | |
|
|
1625
|
+
| **`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 |
|
|
1626
|
+
| **`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 |
|
|
1627
|
+
| **`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> | |
|
|
1613
1628
|
|
|
1614
1629
|
|
|
1615
1630
|
#### Headers
|