@capgo/capacitor-inappbrowser 8.14.2 → 8.14.3
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 +3 -3
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/SafeAreaInsetsSupport.java +34 -48
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java +176 -115
- package/dist/docs.json +3 -3
- package/dist/esm/definitions.d.ts +9 -4
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Sources/InAppBrowserPlugin/InAppBrowserPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1610,9 +1610,9 @@ See the README section "openSecureWindow (OAuth)" for full setup examples.
|
|
|
1610
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
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
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
|
|
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.
|
|
1615
|
-
| **`useTopInset`** | <code>boolean</code> | When true, applies the system status bar inset
|
|
1613
|
+
| **`enabledSafeBottomMargin`** | <code>boolean</code> | If true, the webView is inset by the bottom system bar (navigation bar) so bottom-anchored content stays reachable. On Android 15+ the browser window is always edge-to-edge, so the bottom inset is applied there regardless of this option. | <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. 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 |
|
|
1615
|
+
| **`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> | |
|
|
1616
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
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
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 |
|
|
@@ -55,77 +55,63 @@ final class SafeAreaInsetsSupport {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Absolute IME insets from the window decor must only be
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* Absolute IME insets from the window decor must only be inset when the dialog is edge-to-edge.
|
|
59
|
+
* Pre-Android 15 windows still fit system windows and are resized for the soft keyboard;
|
|
60
|
+
* applying decor IME height again leaves a black gap above the keyboard.
|
|
61
61
|
*/
|
|
62
|
-
static int resolveImeBottomInset(boolean keyboardVisible, int imeBottom, boolean
|
|
63
|
-
if (!keyboardVisible || !
|
|
62
|
+
static int resolveImeBottomInset(boolean keyboardVisible, int imeBottom, boolean applyImeInset) {
|
|
63
|
+
if (!keyboardVisible || !applyImeInset || imeBottom <= 0) {
|
|
64
64
|
return 0;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return imeBottom;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return
|
|
70
|
+
/**
|
|
71
|
+
* Bottom padding for the WebView container (a SwipeRefreshLayout, which honours its own padding
|
|
72
|
+
* but ignores child margins): the larger of the safe bottom inset and the keyboard (IME) inset.
|
|
73
|
+
*/
|
|
74
|
+
static int resolveContainerBottomPadding(boolean applyBottomInset, int safeBottomInset, int imeBottom) {
|
|
75
|
+
int bottomInset = applyBottomInset ? safeBottomInset : 0;
|
|
76
|
+
return Math.max(0, Math.max(bottomInset, imeBottom));
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
/**
|
|
80
|
+
* The status-bar height resource stands in for the reported top inset only when the whole inset
|
|
81
|
+
* set looks unpopulated, which happens on devices that hand out zeroed insets. A window that
|
|
82
|
+
* reports other insets but no top one has no status bar to avoid — a secondary multi-window
|
|
83
|
+
* window, or one whose status bar is hidden — and padding it would open a phantom gap.
|
|
84
|
+
*/
|
|
85
|
+
static int resolveStatusBarTop(
|
|
82
86
|
int systemBarsTop,
|
|
83
|
-
|
|
84
|
-
int
|
|
85
|
-
|
|
87
|
+
int systemBarsBottom,
|
|
88
|
+
int systemBarsLeft,
|
|
89
|
+
int systemBarsRight,
|
|
90
|
+
int fallbackStatusBarTop
|
|
86
91
|
) {
|
|
87
|
-
if (
|
|
88
|
-
return 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (systemBarsTop > 0 || !applyFallbackWhenZero || fallbackTopInset <= 0) {
|
|
92
|
+
if (systemBarsTop > 0) {
|
|
92
93
|
return systemBarsTop;
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
|
|
96
|
+
boolean insetsPopulated = systemBarsBottom > 0 || systemBarsLeft > 0 || systemBarsRight > 0;
|
|
97
|
+
return insetsPopulated ? 0 : Math.max(0, fallbackStatusBarTop);
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
static int resolveContainerBottomPadding(
|
|
106
|
-
boolean enabledSafeBottomMargin,
|
|
107
|
-
int safeBottomInset,
|
|
108
|
-
int imeBottom,
|
|
109
|
-
boolean appBarHandlesTopInset,
|
|
110
|
-
int statusBarTop
|
|
111
|
-
) {
|
|
112
|
-
int base = resolveBottomMargin(enabledSafeBottomMargin, safeBottomInset, imeBottom);
|
|
113
|
-
int appBarCompensation = appBarHandlesTopInset ? Math.max(0, statusBarTop) : 0;
|
|
114
|
-
return base + appBarCompensation;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Top padding for the WebView container. When the AppBarLayout handles the top inset it already
|
|
119
|
-
* sits below the status bar, so no additional padding is needed; otherwise the status-bar height
|
|
120
|
-
* is applied when the safe-top options request it.
|
|
101
|
+
* Top padding for the WebView container. When a visible AppBarLayout handles the top inset it
|
|
102
|
+
* already sits below the status bar, so no additional padding is needed. Otherwise nothing
|
|
103
|
+
* consumes the status bar on edge-to-edge windows (Android 15+, blank or hidden toolbar), so the
|
|
104
|
+
* status-bar height is applied whenever enabledSafeTopMargin is on (#655). Windows that still fit
|
|
105
|
+
* system windows keep the legacy useTopInset opt-in to avoid padding twice.
|
|
121
106
|
*/
|
|
122
107
|
static int resolveContainerTopPadding(
|
|
123
108
|
boolean enabledSafeTopMargin,
|
|
124
109
|
boolean useTopInset,
|
|
125
110
|
int statusBarTop,
|
|
126
|
-
boolean appBarHandlesTopInset
|
|
111
|
+
boolean appBarHandlesTopInset,
|
|
112
|
+
boolean isEdgeToEdge
|
|
127
113
|
) {
|
|
128
|
-
if (appBarHandlesTopInset || !enabledSafeTopMargin || !useTopInset) {
|
|
114
|
+
if (appBarHandlesTopInset || !enabledSafeTopMargin || (!useTopInset && !isEdgeToEdge)) {
|
|
129
115
|
return 0;
|
|
130
116
|
}
|
|
131
117
|
|
|
@@ -358,6 +358,10 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
358
358
|
private boolean cachedTitleIconResolved;
|
|
359
359
|
private boolean isHiddenModeActive = false;
|
|
360
360
|
private boolean toolbarHideInProgress = false;
|
|
361
|
+
private int injectedSafeAreaTop = Integer.MIN_VALUE;
|
|
362
|
+
private int injectedSafeAreaBottom = Integer.MIN_VALUE;
|
|
363
|
+
private int injectedSafeAreaLeft = Integer.MIN_VALUE;
|
|
364
|
+
private int injectedSafeAreaRight = Integer.MIN_VALUE;
|
|
361
365
|
private boolean configurationCallbacksRegistered = false;
|
|
362
366
|
private Configuration lastConfiguration;
|
|
363
367
|
private final ComponentCallbacks2 configurationCallbacks = new ComponentCallbacks2() {
|
|
@@ -675,6 +679,7 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
675
679
|
if (isShowing()) {
|
|
676
680
|
super.hide();
|
|
677
681
|
}
|
|
682
|
+
refreshInsetsForHostingLayer();
|
|
678
683
|
return true;
|
|
679
684
|
}
|
|
680
685
|
|
|
@@ -688,6 +693,18 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
688
693
|
show();
|
|
689
694
|
}
|
|
690
695
|
applyDimensions();
|
|
696
|
+
refreshInsetsForHostingLayer();
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* The container padding is computed for the window hosting the content, and the two windows inset
|
|
701
|
+
* differently: the dialog is edge-to-edge on Android 15+, while the host activity fits its own
|
|
702
|
+
* system windows. Recompute after a layer change so padding from the previous host is not left
|
|
703
|
+
* behind (which would stack on top of the host offset).
|
|
704
|
+
*/
|
|
705
|
+
private void refreshInsetsForHostingLayer() {
|
|
706
|
+
reapplyInsetsFromWindowRoot();
|
|
707
|
+
mainHandler.post(this::reapplyInsetsFromWindowRoot);
|
|
691
708
|
}
|
|
692
709
|
|
|
693
710
|
private boolean showAccordingToLayerMode() {
|
|
@@ -3087,8 +3104,8 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3087
3104
|
|
|
3088
3105
|
requestSafeAreaInsets();
|
|
3089
3106
|
|
|
3090
|
-
mainHandler.postDelayed(this::
|
|
3091
|
-
mainHandler.postDelayed(this::
|
|
3107
|
+
mainHandler.postDelayed(this::reapplyInsetsFromWindowRoot, 300);
|
|
3108
|
+
mainHandler.postDelayed(this::reapplyInsetsFromWindowRoot, 1200);
|
|
3092
3109
|
}
|
|
3093
3110
|
|
|
3094
3111
|
private void registerConfigurationCallbacks() {
|
|
@@ -3312,15 +3329,49 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3312
3329
|
statusBarColorView.setVisibility(View.VISIBLE);
|
|
3313
3330
|
}
|
|
3314
3331
|
|
|
3315
|
-
|
|
3316
|
-
if (appBarParams instanceof ViewGroup.MarginLayoutParams marginParams) {
|
|
3317
|
-
marginParams.topMargin = statusBarHeight;
|
|
3318
|
-
appBarLayout.setLayoutParams(marginParams);
|
|
3319
|
-
}
|
|
3332
|
+
applyAppBarTopInset(appBarLayout, appBarHandlesTopInset(toolbarView) ? statusBarHeight : 0);
|
|
3320
3333
|
appBarLayout.setBackgroundColor(finalBgColor);
|
|
3321
3334
|
});
|
|
3322
3335
|
}
|
|
3323
3336
|
|
|
3337
|
+
/**
|
|
3338
|
+
* Whether a visible AppBarLayout consumes the top inset itself. It is the only alternative to
|
|
3339
|
+
* padding the WebView container for the status bar, so both mechanisms share this condition and
|
|
3340
|
+
* can never inset the top twice.
|
|
3341
|
+
*/
|
|
3342
|
+
private boolean appBarHandlesTopInset(View toolbarView) {
|
|
3343
|
+
return (
|
|
3344
|
+
Build.VERSION.SDK_INT >= 35 &&
|
|
3345
|
+
_options != null &&
|
|
3346
|
+
!TextUtils.equals(_options.getToolbarType(), "blank") &&
|
|
3347
|
+
toolbarView != null &&
|
|
3348
|
+
toolbarView.getVisibility() == View.VISIBLE &&
|
|
3349
|
+
toolbarView.getParent() instanceof com.google.android.material.appbar.AppBarLayout
|
|
3350
|
+
);
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
/**
|
|
3354
|
+
* The appbar must sit below the status bar on edge-to-edge windows. A top margin does that
|
|
3355
|
+
* visually, but CoordinatorLayout's scrolling-view behavior sizes the content container from the
|
|
3356
|
+
* appbar height only and positions it below the appbar margin, so a margin pushes the container
|
|
3357
|
+
* bottom off-screen by the status-bar height (#641). Padding grows the appbar height instead,
|
|
3358
|
+
* which the behavior does account for, keeping the container inside the window.
|
|
3359
|
+
*/
|
|
3360
|
+
private void applyAppBarTopInset(com.google.android.material.appbar.AppBarLayout appBarLayout, int statusBarTop) {
|
|
3361
|
+
ViewGroup.LayoutParams appBarParams = appBarLayout.getLayoutParams();
|
|
3362
|
+
if (appBarParams instanceof ViewGroup.MarginLayoutParams marginParams && marginParams.topMargin != 0) {
|
|
3363
|
+
marginParams.topMargin = 0;
|
|
3364
|
+
appBarLayout.setLayoutParams(marginParams);
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
appBarLayout.setPadding(
|
|
3368
|
+
appBarLayout.getPaddingLeft(),
|
|
3369
|
+
Math.max(0, statusBarTop),
|
|
3370
|
+
appBarLayout.getPaddingRight(),
|
|
3371
|
+
appBarLayout.getPaddingBottom()
|
|
3372
|
+
);
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3324
3375
|
private void applyWindowInsetsToWebView(WindowInsetsCompat windowInsets, boolean isAndroid15Plus, View toolbarView) {
|
|
3325
3376
|
if (windowInsets == null || _options == null) {
|
|
3326
3377
|
return;
|
|
@@ -3333,53 +3384,73 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3333
3384
|
Insets ime = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
|
|
3334
3385
|
boolean keyboardVisible = windowInsets.isVisible(WindowInsetsCompat.Type.ime());
|
|
3335
3386
|
|
|
3336
|
-
|
|
3337
|
-
isAndroid15Plus &&
|
|
3338
|
-
!TextUtils.equals(_options.getToolbarType(), "blank") &&
|
|
3339
|
-
toolbarView != null &&
|
|
3340
|
-
toolbarView.getVisibility() == View.VISIBLE &&
|
|
3341
|
-
toolbarView.getParent() instanceof com.google.android.material.appbar.AppBarLayout;
|
|
3342
|
-
|
|
3343
|
-
applySafeAreaMargins(
|
|
3387
|
+
applySafeAreaInsets(
|
|
3344
3388
|
bars,
|
|
3345
3389
|
navigationBars,
|
|
3346
3390
|
systemGestures,
|
|
3347
3391
|
mandatoryGestures,
|
|
3348
3392
|
ime,
|
|
3349
3393
|
keyboardVisible,
|
|
3350
|
-
appBarHandlesTopInset,
|
|
3394
|
+
appBarHandlesTopInset(toolbarView),
|
|
3351
3395
|
isAndroid15Plus
|
|
3352
3396
|
);
|
|
3353
3397
|
}
|
|
3354
3398
|
|
|
3355
3399
|
/**
|
|
3356
|
-
* Re-read root window insets and apply
|
|
3400
|
+
* Re-read root window insets and apply the container padding.
|
|
3357
3401
|
* Dialog windows may not re-dispatch inset listeners after rotation, leaving stale
|
|
3358
|
-
* portrait
|
|
3402
|
+
* portrait insets that break vertical scrolling in landscape.
|
|
3359
3403
|
*/
|
|
3360
3404
|
private void reapplyInsetsFromWindowRoot() {
|
|
3361
3405
|
if (_webView == null || _options == null) {
|
|
3362
3406
|
return;
|
|
3363
3407
|
}
|
|
3364
3408
|
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
if (decorView == null) {
|
|
3409
|
+
View insetsSourceView = resolveHostedInsetsSourceView();
|
|
3410
|
+
if (insetsSourceView == null) {
|
|
3368
3411
|
return;
|
|
3369
3412
|
}
|
|
3370
3413
|
|
|
3371
|
-
WindowInsetsCompat windowInsets = ViewCompat.getRootWindowInsets(
|
|
3414
|
+
WindowInsetsCompat windowInsets = ViewCompat.getRootWindowInsets(insetsSourceView);
|
|
3372
3415
|
if (windowInsets == null) {
|
|
3373
|
-
// Root insets not ready yet; do not mutate
|
|
3374
|
-
//
|
|
3416
|
+
// Root insets not ready yet; do not mutate the container padding. Delayed retries and
|
|
3417
|
+
// requestApplyInsets will retry.
|
|
3375
3418
|
return;
|
|
3376
3419
|
}
|
|
3377
3420
|
|
|
3378
3421
|
boolean isAndroid15Plus = Build.VERSION.SDK_INT >= 35;
|
|
3379
|
-
View toolbarView =
|
|
3422
|
+
View toolbarView = findBrowserContentDescendant(R.id.tool_bar);
|
|
3380
3423
|
applyWindowInsetsToWebView(windowInsets, isAndroid15Plus, toolbarView);
|
|
3381
3424
|
}
|
|
3382
3425
|
|
|
3426
|
+
/**
|
|
3427
|
+
* Insets must come from the window that currently hosts the content. In back-layer mode the
|
|
3428
|
+
* content lives in the host activity's window and this dialog's window is hidden, so its decor
|
|
3429
|
+
* would report stale insets.
|
|
3430
|
+
*/
|
|
3431
|
+
private View resolveHostedInsetsSourceView() {
|
|
3432
|
+
if (backLayerActive) {
|
|
3433
|
+
View contentView = getBrowserContentView();
|
|
3434
|
+
if (contentView != null && contentView.isAttachedToWindow()) {
|
|
3435
|
+
return contentView;
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
Window window = getWindow();
|
|
3440
|
+
return window != null ? window.getDecorView() : null;
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* Back-layer mode reparents the browser content out of the dialog window, so {@link
|
|
3445
|
+
* #findViewById(int)} no longer reaches it. Resolve through the content view, which owns these
|
|
3446
|
+
* views in both layers.
|
|
3447
|
+
*/
|
|
3448
|
+
private View findBrowserContentDescendant(int id) {
|
|
3449
|
+
View contentView = getBrowserContentView();
|
|
3450
|
+
View view = contentView != null ? contentView.findViewById(id) : null;
|
|
3451
|
+
return view != null ? view : findViewById(id);
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3383
3454
|
private void requestWebViewContentRelayout() {
|
|
3384
3455
|
View container = findViewById(R.id.content_browser_layout);
|
|
3385
3456
|
if (container != null) {
|
|
@@ -3395,7 +3466,12 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3395
3466
|
_webView.invalidate();
|
|
3396
3467
|
}
|
|
3397
3468
|
|
|
3398
|
-
|
|
3469
|
+
/**
|
|
3470
|
+
* The WebView is the content child of a SwipeRefreshLayout, which lays that child out inside its
|
|
3471
|
+
* own padding and ignores child margins entirely. Safe-area insets are therefore applied as
|
|
3472
|
+
* padding on the container instead of margins on the WebView (#641).
|
|
3473
|
+
*/
|
|
3474
|
+
private void applySafeAreaInsets(
|
|
3399
3475
|
Insets bars,
|
|
3400
3476
|
Insets navigationBars,
|
|
3401
3477
|
Insets systemGestures,
|
|
@@ -3403,88 +3479,25 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3403
3479
|
Insets ime,
|
|
3404
3480
|
boolean keyboardVisible,
|
|
3405
3481
|
boolean appBarHandlesTopInset,
|
|
3406
|
-
boolean
|
|
3482
|
+
boolean isEdgeToEdge
|
|
3407
3483
|
) {
|
|
3408
3484
|
if (_webView == null || _options == null) {
|
|
3409
3485
|
return;
|
|
3410
3486
|
}
|
|
3411
3487
|
|
|
3412
|
-
|
|
3413
|
-
if (
|
|
3488
|
+
View container = findBrowserContentDescendant(R.id.content_browser_layout);
|
|
3489
|
+
if (container == null) {
|
|
3414
3490
|
return;
|
|
3415
3491
|
}
|
|
3416
3492
|
|
|
3417
|
-
|
|
3418
|
-
int
|
|
3493
|
+
boolean applyBottomInset = SafeAreaInsetsSupport.shouldInsetBottomForContainer(_options.getEnabledSafeMargin(), isEdgeToEdge);
|
|
3494
|
+
int statusBarTop = SafeAreaInsetsSupport.resolveStatusBarTop(
|
|
3495
|
+
bars.top,
|
|
3419
3496
|
bars.bottom,
|
|
3420
|
-
navigationBars.bottom,
|
|
3421
|
-
systemGestures.bottom,
|
|
3422
|
-
mandatoryGestures.bottom,
|
|
3423
3497
|
bars.left,
|
|
3424
3498
|
bars.right,
|
|
3425
|
-
|
|
3426
|
-
navigationBars.right,
|
|
3427
|
-
fallbackBottomInset,
|
|
3428
|
-
_options.getEnabledSafeMargin()
|
|
3499
|
+
getSystemStatusBarHeight()
|
|
3429
3500
|
);
|
|
3430
|
-
// Android 15+ uses edge-to-edge (decorFitsSystemWindows=false) and needs IME as margin.
|
|
3431
|
-
// Older dialogs still resize for the keyboard; re-applying decor IME creates a black gap (#622).
|
|
3432
|
-
int imeBottom = SafeAreaInsetsSupport.resolveImeBottomInset(keyboardVisible, ime.bottom, applyImeAsLayoutMargin);
|
|
3433
|
-
boolean applyTopFallback = _options.getEnabledSafeTopMargin() && _options.getUseTopInset();
|
|
3434
|
-
int fallbackTopInset = applyTopFallback ? getSystemStatusBarHeight() : 0;
|
|
3435
|
-
int navTop = SafeAreaInsetsSupport.resolveTopMarginWithFallback(
|
|
3436
|
-
_options.getEnabledSafeTopMargin(),
|
|
3437
|
-
_options.getUseTopInset(),
|
|
3438
|
-
bars.top,
|
|
3439
|
-
appBarHandlesTopInset,
|
|
3440
|
-
fallbackTopInset,
|
|
3441
|
-
applyTopFallback
|
|
3442
|
-
);
|
|
3443
|
-
int bottomMargin = SafeAreaInsetsSupport.resolveBottomMargin(_options.getEnabledSafeMargin(), safeBottomInset, imeBottom);
|
|
3444
|
-
|
|
3445
|
-
mlp.topMargin = navTop;
|
|
3446
|
-
mlp.bottomMargin = bottomMargin;
|
|
3447
|
-
mlp.leftMargin = bars.left;
|
|
3448
|
-
mlp.rightMargin = bars.right;
|
|
3449
|
-
_webView.setLayoutParams(mlp);
|
|
3450
|
-
injectSafeAreaCssVariables(navTop, bottomMargin, bars.left, bars.right);
|
|
3451
|
-
applyContainerInsetsSnapshot();
|
|
3452
|
-
}
|
|
3453
|
-
|
|
3454
|
-
private void applyContainerInsetsSnapshot() {
|
|
3455
|
-
if (_options == null || _webView == null) {
|
|
3456
|
-
return;
|
|
3457
|
-
}
|
|
3458
|
-
|
|
3459
|
-
View container = findViewById(R.id.content_browser_layout);
|
|
3460
|
-
if (container == null) {
|
|
3461
|
-
return;
|
|
3462
|
-
}
|
|
3463
|
-
|
|
3464
|
-
Window window = getWindow();
|
|
3465
|
-
View decorView = window != null ? window.getDecorView() : null;
|
|
3466
|
-
WindowInsetsCompat windowInsets = decorView != null ? ViewCompat.getRootWindowInsets(decorView) : null;
|
|
3467
|
-
|
|
3468
|
-
Insets bars = windowInsets != null ? windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) : Insets.NONE;
|
|
3469
|
-
Insets navigationBars = windowInsets != null ? windowInsets.getInsets(WindowInsetsCompat.Type.navigationBars()) : Insets.NONE;
|
|
3470
|
-
Insets systemGestures = windowInsets != null ? windowInsets.getInsets(WindowInsetsCompat.Type.systemGestures()) : Insets.NONE;
|
|
3471
|
-
Insets mandatoryGestures =
|
|
3472
|
-
windowInsets != null ? windowInsets.getInsets(WindowInsetsCompat.Type.mandatorySystemGestures()) : Insets.NONE;
|
|
3473
|
-
Insets ime = windowInsets != null ? windowInsets.getInsets(WindowInsetsCompat.Type.ime()) : Insets.NONE;
|
|
3474
|
-
boolean keyboardVisible = windowInsets != null && windowInsets.isVisible(WindowInsetsCompat.Type.ime());
|
|
3475
|
-
|
|
3476
|
-
boolean isAndroid15Plus = Build.VERSION.SDK_INT >= 35;
|
|
3477
|
-
View toolbarView = findViewById(R.id.tool_bar);
|
|
3478
|
-
boolean appBarHandlesTopInset =
|
|
3479
|
-
isAndroid15Plus &&
|
|
3480
|
-
!TextUtils.equals(_options.getToolbarType(), "blank") &&
|
|
3481
|
-
toolbarView != null &&
|
|
3482
|
-
toolbarView.getVisibility() == View.VISIBLE &&
|
|
3483
|
-
toolbarView.getParent() instanceof com.google.android.material.appbar.AppBarLayout;
|
|
3484
|
-
|
|
3485
|
-
boolean applyBottomInset = SafeAreaInsetsSupport.shouldInsetBottomForContainer(_options.getEnabledSafeMargin(), isAndroid15Plus);
|
|
3486
|
-
|
|
3487
|
-
int statusBarTop = bars.top > 0 ? bars.top : getSystemStatusBarHeight();
|
|
3488
3501
|
int fallbackBottomInset = applyBottomInset ? getSystemNavigationBarHeight() : 0;
|
|
3489
3502
|
int safeBottomInset = SafeAreaInsetsSupport.resolveSafeBottomInsetWithFallback(
|
|
3490
3503
|
bars.bottom,
|
|
@@ -3498,32 +3511,41 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3498
3511
|
fallbackBottomInset,
|
|
3499
3512
|
applyBottomInset
|
|
3500
3513
|
);
|
|
3514
|
+
// Android 15+ uses edge-to-edge (decorFitsSystemWindows=false) and needs the IME inset applied.
|
|
3515
|
+
// Older dialogs still resize for the keyboard; re-applying decor IME creates a black gap (#622).
|
|
3516
|
+
int imeBottom = SafeAreaInsetsSupport.resolveImeBottomInset(keyboardVisible, ime.bottom, isEdgeToEdge);
|
|
3501
3517
|
|
|
3518
|
+
// In back-layer mode the content is reparented into the host activity's window, which this
|
|
3519
|
+
// plugin never puts in edge-to-edge, so the host owns the top inset and the useTopInset opt-in
|
|
3520
|
+
// still decides there.
|
|
3502
3521
|
int padTop = SafeAreaInsetsSupport.resolveContainerTopPadding(
|
|
3503
3522
|
_options.getEnabledSafeTopMargin(),
|
|
3504
3523
|
_options.getUseTopInset(),
|
|
3505
3524
|
statusBarTop,
|
|
3506
|
-
appBarHandlesTopInset
|
|
3507
|
-
);
|
|
3508
|
-
int imeBottom = SafeAreaInsetsSupport.resolveImeBottomInset(keyboardVisible, ime.bottom, isAndroid15Plus);
|
|
3509
|
-
int padBottom = SafeAreaInsetsSupport.resolveContainerBottomPadding(
|
|
3510
|
-
applyBottomInset,
|
|
3511
|
-
safeBottomInset,
|
|
3512
|
-
imeBottom,
|
|
3513
3525
|
appBarHandlesTopInset,
|
|
3514
|
-
|
|
3526
|
+
isEdgeToEdge && !backLayerActive
|
|
3515
3527
|
);
|
|
3528
|
+
int padBottom = SafeAreaInsetsSupport.resolveContainerBottomPadding(applyBottomInset, safeBottomInset, imeBottom);
|
|
3516
3529
|
|
|
3517
|
-
if (
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3530
|
+
if (appBarHandlesTopInset) {
|
|
3531
|
+
// Keep the appbar inset in sync with the reported inset (cutouts, rotation, multi-window)
|
|
3532
|
+
// instead of the status_bar_height resource used for the initial layout.
|
|
3533
|
+
View toolbarView = findBrowserContentDescendant(R.id.tool_bar);
|
|
3534
|
+
if (toolbarView != null && toolbarView.getParent() instanceof com.google.android.material.appbar.AppBarLayout appBarLayout) {
|
|
3535
|
+
applyAppBarTopInset(appBarLayout, statusBarTop);
|
|
3536
|
+
}
|
|
3524
3537
|
}
|
|
3525
3538
|
|
|
3526
|
-
|
|
3539
|
+
boolean paddingChanged =
|
|
3540
|
+
container.getPaddingLeft() != bars.left ||
|
|
3541
|
+
container.getPaddingTop() != padTop ||
|
|
3542
|
+
container.getPaddingRight() != bars.right ||
|
|
3543
|
+
container.getPaddingBottom() != padBottom;
|
|
3544
|
+
if (paddingChanged) {
|
|
3545
|
+
container.setPadding(bars.left, padTop, bars.right, padBottom);
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3548
|
+
injectSafeAreaCssVariables(padTop, padBottom, bars.left, bars.right);
|
|
3527
3549
|
}
|
|
3528
3550
|
|
|
3529
3551
|
private void configureBlankToolbarLayout() {
|
|
@@ -3554,27 +3576,62 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
3554
3576
|
return getContext().getResources().getDimensionPixelSize(resourceId);
|
|
3555
3577
|
}
|
|
3556
3578
|
|
|
3579
|
+
private void resetInjectedSafeAreaCssVariables() {
|
|
3580
|
+
injectedSafeAreaTop = Integer.MIN_VALUE;
|
|
3581
|
+
injectedSafeAreaBottom = Integer.MIN_VALUE;
|
|
3582
|
+
injectedSafeAreaLeft = Integer.MIN_VALUE;
|
|
3583
|
+
injectedSafeAreaRight = Integer.MIN_VALUE;
|
|
3584
|
+
}
|
|
3585
|
+
|
|
3557
3586
|
private void injectSafeAreaCssVariables(int top, int bottom, int left, int right) {
|
|
3558
3587
|
if (_webView == null) {
|
|
3559
3588
|
return;
|
|
3560
3589
|
}
|
|
3561
3590
|
|
|
3591
|
+
// Insets are dispatched on every layout pass; only touch the document when they differ from
|
|
3592
|
+
// what it already holds. Cleared on page load so a new document is served again.
|
|
3593
|
+
if (
|
|
3594
|
+
injectedSafeAreaTop == top && injectedSafeAreaBottom == bottom && injectedSafeAreaLeft == left && injectedSafeAreaRight == right
|
|
3595
|
+
) {
|
|
3596
|
+
return;
|
|
3597
|
+
}
|
|
3598
|
+
|
|
3599
|
+
// Recorded before posting so passes that repeat within the same frame are suppressed too.
|
|
3600
|
+
injectedSafeAreaTop = top;
|
|
3601
|
+
injectedSafeAreaBottom = bottom;
|
|
3602
|
+
injectedSafeAreaLeft = left;
|
|
3603
|
+
injectedSafeAreaRight = right;
|
|
3604
|
+
|
|
3562
3605
|
String script = String.format(
|
|
3563
3606
|
Locale.US,
|
|
3564
3607
|
"(function(){var root=document.documentElement;" +
|
|
3565
3608
|
"root.style.setProperty('--safe-area-inset-top','%dpx');" +
|
|
3566
3609
|
"root.style.setProperty('--safe-area-inset-bottom','%dpx');" +
|
|
3567
3610
|
"root.style.setProperty('--safe-area-inset-left','%dpx');" +
|
|
3568
|
-
"root.style.setProperty('--safe-area-inset-right','%dpx');
|
|
3611
|
+
"root.style.setProperty('--safe-area-inset-right','%dpx');" +
|
|
3612
|
+
"return root.style.getPropertyValue('--safe-area-inset-top')?1:0;})();",
|
|
3569
3613
|
top,
|
|
3570
3614
|
bottom,
|
|
3571
3615
|
left,
|
|
3572
3616
|
right
|
|
3573
3617
|
);
|
|
3574
3618
|
_webView.post(() -> {
|
|
3575
|
-
if (_webView
|
|
3576
|
-
|
|
3619
|
+
if (_webView == null) {
|
|
3620
|
+
resetInjectedSafeAreaCssVariables();
|
|
3621
|
+
return;
|
|
3577
3622
|
}
|
|
3623
|
+
_webView.evaluateJavascript(script, (value) -> {
|
|
3624
|
+
boolean cacheStillHoldsTheseValues =
|
|
3625
|
+
injectedSafeAreaTop == top &&
|
|
3626
|
+
injectedSafeAreaBottom == bottom &&
|
|
3627
|
+
injectedSafeAreaLeft == left &&
|
|
3628
|
+
injectedSafeAreaRight == right;
|
|
3629
|
+
// The document did not take the variables, so let a later pass inject them again.
|
|
3630
|
+
// A newer injection may already have replaced them, in which case it owns the cache.
|
|
3631
|
+
if (!"1".equals(value) && cacheStillHoldsTheseValues) {
|
|
3632
|
+
resetInjectedSafeAreaCssVariables();
|
|
3633
|
+
}
|
|
3634
|
+
});
|
|
3578
3635
|
});
|
|
3579
3636
|
}
|
|
3580
3637
|
|
|
@@ -5953,6 +6010,10 @@ public class WebViewDialog extends Dialog implements ProxyResponseRouting.ProxyR
|
|
|
5953
6010
|
_options.getCallbacks().pageLoaded();
|
|
5954
6011
|
stopReloadGesture();
|
|
5955
6012
|
injectJavaScriptInterface();
|
|
6013
|
+
// The freshly parsed document carries no safe-area variables, whatever was
|
|
6014
|
+
// injected into the previous one, so drop the cache and serve them again.
|
|
6015
|
+
resetInjectedSafeAreaCssVariables();
|
|
6016
|
+
reapplyInsetsFromWindowRoot();
|
|
5956
6017
|
|
|
5957
6018
|
// Inject Google Pay polyfills if enabled
|
|
5958
6019
|
if (_options.getEnableGooglePaySupport()) {
|
package/dist/docs.json
CHANGED
|
@@ -2342,7 +2342,7 @@
|
|
|
2342
2342
|
"name": "example"
|
|
2343
2343
|
}
|
|
2344
2344
|
],
|
|
2345
|
-
"docs": "If true, the webView
|
|
2345
|
+
"docs": "If true, the webView is inset by the bottom system bar (navigation bar) so bottom-anchored\ncontent stays reachable. On Android 15+ the browser window is always edge-to-edge, so the\nbottom inset is applied there regardless of this option.",
|
|
2346
2346
|
"complexTypes": [],
|
|
2347
2347
|
"type": "boolean | undefined"
|
|
2348
2348
|
},
|
|
@@ -2362,7 +2362,7 @@
|
|
|
2362
2362
|
"name": "example"
|
|
2363
2363
|
}
|
|
2364
2364
|
],
|
|
2365
|
-
"docs": "If false, the webView will extend behind the status bar for true full-screen immersive content.\nWhen true (default), respects the safe area at the top of the screen.\nWorks independently of toolbarType - use for full-screen video players, games, or immersive web apps.",
|
|
2365
|
+
"docs": "If false, the webView will extend behind the status bar for true full-screen immersive content.\nWhen true (default), respects the safe area at the top of the screen.\nWorks independently of toolbarType - use for full-screen video players, games, or immersive web apps.\nOn Android, when a toolbar is visible the toolbar itself provides that safe area; with\n`toolbarType: 'blank'` on Android 15+ the status bar inset is applied to the webView instead.",
|
|
2366
2366
|
"complexTypes": [],
|
|
2367
2367
|
"type": "boolean | undefined"
|
|
2368
2368
|
},
|
|
@@ -2378,7 +2378,7 @@
|
|
|
2378
2378
|
"name": "example"
|
|
2379
2379
|
}
|
|
2380
2380
|
],
|
|
2381
|
-
"docs": "When true, applies the system status bar inset
|
|
2381
|
+
"docs": "When true, applies the system status bar inset to the top of the WebView on Android even when\nthe window is not edge-to-edge (before Android 15). Keeps the legacy 0px inset by default for\napps that handle padding themselves. On Android 15+ this is not needed: without a visible\ntoolbar the status bar inset already follows `enabledSafeTopMargin`.",
|
|
2382
2382
|
"complexTypes": [],
|
|
2383
2383
|
"type": "boolean | undefined"
|
|
2384
2384
|
},
|
|
@@ -1200,8 +1200,9 @@ export interface OpenWebViewOptions {
|
|
|
1200
1200
|
*/
|
|
1201
1201
|
authorizedAppLinks?: string[];
|
|
1202
1202
|
/**
|
|
1203
|
-
* If true, the webView
|
|
1204
|
-
*
|
|
1203
|
+
* If true, the webView is inset by the bottom system bar (navigation bar) so bottom-anchored
|
|
1204
|
+
* content stays reachable. On Android 15+ the browser window is always edge-to-edge, so the
|
|
1205
|
+
* bottom inset is applied there regardless of this option.
|
|
1205
1206
|
* @since 7.13.0
|
|
1206
1207
|
* @default false
|
|
1207
1208
|
* @example
|
|
@@ -1212,6 +1213,8 @@ export interface OpenWebViewOptions {
|
|
|
1212
1213
|
* If false, the webView will extend behind the status bar for true full-screen immersive content.
|
|
1213
1214
|
* When true (default), respects the safe area at the top of the screen.
|
|
1214
1215
|
* Works independently of toolbarType - use for full-screen video players, games, or immersive web apps.
|
|
1216
|
+
* On Android, when a toolbar is visible the toolbar itself provides that safe area; with
|
|
1217
|
+
* `toolbarType: 'blank'` on Android 15+ the status bar inset is applied to the webView instead.
|
|
1215
1218
|
* @since 8.2.0
|
|
1216
1219
|
* @default true
|
|
1217
1220
|
* @example
|
|
@@ -1219,8 +1222,10 @@ export interface OpenWebViewOptions {
|
|
|
1219
1222
|
*/
|
|
1220
1223
|
enabledSafeTopMargin?: boolean;
|
|
1221
1224
|
/**
|
|
1222
|
-
* When true, applies the system status bar inset
|
|
1223
|
-
* Keeps the legacy 0px
|
|
1225
|
+
* When true, applies the system status bar inset to the top of the WebView on Android even when
|
|
1226
|
+
* the window is not edge-to-edge (before Android 15). Keeps the legacy 0px inset by default for
|
|
1227
|
+
* apps that handle padding themselves. On Android 15+ this is not needed: without a visible
|
|
1228
|
+
* toolbar the status bar inset already follows `enabledSafeTopMargin`.
|
|
1224
1229
|
* @default false
|
|
1225
1230
|
* @example
|
|
1226
1231
|
* useTopInset: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAmEA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AACD,MAAM,CAAN,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB;;;OAGG;IACH,oCAAqB,CAAA;IACrB;;;OAGG;IACH,kCAAmB,CAAA;IACnB;;;OAGG;IACH,wCAAyB,CAAA;IACzB;;;OAGG;IACH,8BAAe,CAAA;AACjB,CAAC,EArBW,WAAW,KAAX,WAAW,QAqBtB;AAED,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,mCAAe,CAAA;IACf;;OAEG;IACH,iDAA6B,CAAA;AAC/B,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB;;OAEG;IACH,8BAAe,CAAA;IACf;;OAEG;IACH,4BAAa,CAAA;AACf,CAAC,EATW,WAAW,KAAX,WAAW,QAStB","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface UrlEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * Emit when the url changes\n *\n * @since 0.0.1\n */\n url: string;\n}\n\n/**\n * Event emitted when the managed webview intercepts a non-standard custom scheme\n * and hands it to the operating system.\n *\n * Standard OS-handled schemes such as `tel:`, `mailto:`, and `sms:` are excluded.\n *\n * @since 8.6.7\n */\nexport interface CustomSchemeInterceptedEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * Intercepted URL.\n */\n url: string;\n /**\n * Whether the operating system accepted the URL handoff.\n */\n opened: boolean;\n}\nexport interface BtnEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * Emit when a button is clicked.\n *\n * @since 0.0.1\n */\n url: string;\n}\n\nexport interface ButtonNearDoneEvent {\n /**\n * Webview instance id.\n *\n * @since 8.6.36\n */\n id: string;\n}\n\nexport type UrlChangeListener = (state: UrlEvent) => void;\nexport type ConfirmBtnListener = (state: BtnEvent) => void;\nexport type ButtonNearListener = (state: ButtonNearDoneEvent) => void;\nexport type CustomSchemeInterceptedListener = (state: CustomSchemeInterceptedEvent) => void;\n\nexport type WebViewPointerInputEventType = 'click' | 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';\nexport type WebViewInputEventType = WebViewPointerInputEventType | 'scroll';\n\nexport enum BackgroundColor {\n WHITE = 'white',\n BLACK = 'black',\n}\nexport enum ToolBarType {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ACTIVITY = 'activity',\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n COMPACT = 'compact',\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n NAVIGATION = 'navigation',\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n BLANK = 'blank',\n}\n\nexport enum InvisibilityMode {\n /**\n * WebView is aware it is hidden (dimensions may be zero).\n */\n AWARE = 'AWARE',\n /**\n * WebView is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n */\n FAKE_VISIBLE = 'FAKE_VISIBLE',\n}\n\nexport enum CloseAction {\n /**\n * The toolbar close button closes and destroys the webview.\n */\n CLOSE = 'close',\n /**\n * The toolbar close button hides the webview so it can be shown again.\n */\n HIDE = 'hide',\n}\n\nexport interface ToolbarTitleIconOptions {\n ios?: {\n iconType: 'sf-symbol' | 'asset';\n icon: string;\n };\n android?: {\n iconType: 'asset' | 'vector';\n icon: string;\n width?: number;\n height?: number;\n };\n}\n\nexport interface Headers {\n [key: string]: string;\n}\n\nexport interface GetCookieOptions {\n url: string;\n includeHttpOnly?: boolean;\n}\n\nexport interface ClearCookieOptions {\n /**\n * Target webview id.\n * When omitted, applies to all open webviews.\n */\n id?: string;\n url: string;\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\n\nexport interface LayerOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Makes the Capacitor host WebView transparent while this native webview is behind it.\n *\n * @default true\n */\n transparentBackground?: boolean;\n}\n\nexport interface BringToFrontOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Whether bringing the webview to the front is animated on iOS.\n *\n * @default true\n */\n isAnimated?: boolean;\n}\n\nexport interface DispatchPointerInputEventOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Input event to dispatch to the webview.\n */\n type: WebViewPointerInputEventType;\n /**\n * X coordinate in CSS pixels from the webview's left edge.\n */\n x: number;\n /**\n * Y coordinate in CSS pixels from the webview's top edge.\n */\n y: number;\n}\n\nexport interface DispatchScrollInputEventOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Input event to dispatch to the webview.\n */\n type: 'scroll';\n /**\n * X coordinate in CSS pixels from the webview's left edge.\n */\n x: number;\n /**\n * Y coordinate in CSS pixels from the webview's top edge.\n */\n y: number;\n /**\n * Horizontal scroll delta in CSS pixels. Used when `type` is `scroll`.\n */\n deltaX: number;\n /**\n * Vertical scroll delta in CSS pixels. Used when `type` is `scroll`.\n */\n deltaY: number;\n}\n\nexport type DispatchInputEventOptions = DispatchPointerInputEventOptions | DispatchScrollInputEventOptions;\n\n/**\n * Represents an intercepted HTTP request from the in-app browser webview.\n *\n * Request and response bodies are base64-encoded when present.\n *\n * @since 8.6.0\n */\nexport interface ProxyRequest {\n requestId: string;\n phase: 'outbound' | 'inbound';\n url: string;\n method: string;\n headers: Record<string, string>;\n body: string | null;\n status?: number;\n responseHeaders?: Record<string, string>;\n responseBody?: string | null;\n webviewId: string;\n}\n\n/**\n * Response payload returned to native for a proxied request.\n *\n * The body must be base64-encoded.\n *\n * @since 8.6.0\n */\nexport interface ProxyResponse {\n body: string;\n status: number;\n headers: Record<string, string>;\n}\n\n/**\n * Request override returned to native for an outbound proxied request.\n *\n * The body must be base64-encoded when present.\n *\n * @since 8.6.0\n */\nexport interface ProxyRequestOverride {\n url: string;\n method?: string;\n headers?: Record<string, string>;\n body?: string | null;\n}\n\n/**\n * Event emitted when a web page opens a popup/new window.\n *\n * @since 8.6.0\n */\nexport interface PopupWindowEvent {\n /**\n * Popup webview instance id.\n */\n id: string;\n /**\n * Parent webview instance id.\n */\n parentId?: string;\n /**\n * Requested popup URL when available.\n */\n url?: string;\n /**\n * Whether the popup was presented immediately.\n */\n visible: boolean;\n}\n\n/**\n * Event emitted when JavaScript running inside the managed webview writes to the console.\n *\n * Enable this with `captureConsoleLogs: true` when opening the webview.\n *\n * @since 8.6.0\n */\nexport interface ConsoleMessageEvent {\n /**\n * Source webview instance id.\n */\n id?: string;\n /**\n * Console method or normalized severity.\n */\n level: 'log' | 'info' | 'warn' | 'error' | 'debug' | 'assert' | string;\n /**\n * Joined string representation of the console arguments.\n */\n message: string;\n /**\n * Script URL or page URL when available.\n */\n source?: string;\n /**\n * 1-based line number when available.\n */\n line?: number;\n /**\n * 1-based column number when available.\n */\n column?: number;\n /**\n * Optional subtype for runtime-originated errors on supported platforms.\n */\n kind?: string;\n}\n\n/**\n * Native handling mode used after a managed download finishes.\n *\n * @since 8.6.0\n */\nexport type DownloadHandledBy = 'inAppBrowser' | 'systemPreview' | 'external';\n\n/**\n * Event emitted after a managed download is saved locally.\n *\n * @since 8.6.0\n */\nexport interface DownloadCompletedEvent {\n /**\n * Source webview instance id.\n */\n id?: string;\n /**\n * Original URL that triggered the download when available.\n */\n sourceUrl?: string;\n /**\n * Saved filename.\n */\n fileName: string;\n /**\n * Resolved MIME type when available.\n */\n mimeType?: string;\n /**\n * Absolute native filesystem path to the saved file.\n */\n path: string;\n /**\n * `file://` URL pointing at the saved file.\n */\n localUrl: string;\n /**\n * How native handled the downloaded file after saving it.\n */\n handledBy: DownloadHandledBy;\n}\n\n/**\n * Event emitted when managed download handling fails.\n *\n * @since 8.6.0\n */\nexport interface DownloadFailedEvent {\n /**\n * Source webview instance id.\n */\n id?: string;\n /**\n * Original URL that triggered the download when available.\n */\n sourceUrl?: string;\n /**\n * Intended filename when known.\n */\n fileName?: string;\n /**\n * Resolved MIME type when available.\n */\n mimeType?: string;\n /**\n * Native error message.\n */\n error: string;\n}\n\n/**\n * Decision returned to native when handling a proxied request.\n *\n * @since 8.6.0\n */\nexport interface ProxyDecision {\n request?: ProxyRequestOverride | null;\n response?: ProxyResponse | null;\n cancel?: boolean;\n}\n\n/**\n * Native-first proxy rule used on Android and iOS.\n *\n * Any regex property that is omitted is treated as a wildcard.\n *\n * @since 8.6.0\n */\nexport interface NativeProxyRule {\n id?: string;\n urlRegex?: string;\n methodRegex?: string;\n headerRegex?: string;\n bodyRegex?: string;\n statusRegex?: string;\n responseHeaderRegex?: string;\n responseBodyRegex?: string;\n mainFrameOnly?: boolean;\n action: 'continue' | 'cancel' | 'delegateToJs';\n}\n\nexport type ProxyHandlerResult = Response | ProxyResponse | ProxyRequestOverride | ProxyDecision | null;\n\n/**\n * JavaScript callback used to handle proxied requests.\n *\n * Return a `Response`, `ProxyResponse`, `ProxyRequestOverride`, `ProxyDecision`,\n * or `null` to let native continue unchanged.\n *\n * @since 8.6.0\n */\nexport type ProxyHandler = (request: ProxyRequest) => ProxyHandlerResult | Promise<ProxyHandlerResult>;\n\nexport interface OpenOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n */\n url: string;\n /**\n * if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * @since 0.1.0\n */\n isPresentAfterPageLoad?: boolean;\n /**\n * if true the deeplink will not be opened, if false the deeplink will be opened when clicked on the link\n * @since 0.1.0\n */\n preventDeeplink?: boolean;\n\n // --- Chrome Custom Tab customization (Android only, ignored on iOS) ---\n\n /**\n * Toolbar background color in hex format (e.g., \"#1A1A2E\").\n * Applied to both light and dark color schemes.\n * Also sets the navigation bar color to match.\n * **Android only** — ignored on iOS.\n * @since 8.2.0\n */\n toolbarColor?: string;\n\n /**\n * Whether the URL bar should auto-hide when the user scrolls down.\n * The bar reappears on any upward scroll.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n urlBarHidingEnabled?: boolean;\n\n /**\n * Show the page's HTML <title> in the toolbar instead of the raw URL.\n * The true URL is still visible when the user taps the title area.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n showTitle?: boolean;\n\n /**\n * Replace the default \"X\" close icon with a back arrow.\n * Makes the Custom Tab feel like a native navigation push rather than a modal overlay.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n showArrow?: boolean;\n\n /**\n * Remove the share action from the overflow menu.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n disableShare?: boolean;\n\n /**\n * Hide the bookmark star icon in the overflow menu.\n * Uses an undocumented Chromium intent extra — may stop working on future Chrome updates.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n disableBookmark?: boolean;\n\n /**\n * Hide the download icon in the overflow menu.\n * Uses an undocumented Chromium intent extra — may stop working on future Chrome updates.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n disableDownload?: boolean;\n}\n\nexport interface OpenSecureWindowOptions {\n /**\n * The endpoint to open\n */\n authEndpoint: string;\n /**\n * The redirect URI to use for the openSecureWindow call.\n * This will be checked to make sure it matches the redirect URI after the window finishes the redirection.\n */\n redirectUri: string;\n /**\n * The name of the broadcast channel to listen to, relevant only for web\n */\n broadcastChannelName?: string;\n /**\n * If true, the browser session will be ephemeral (no cookies or browsing data are shared with the system browser).\n * On iOS, this sets `prefersEphemeralWebBrowserSession = true` on `ASWebAuthenticationSession`.\n * On Android, this enables Custom Tabs ephemeral browsing via `setEphemeralBrowsingEnabled(true)`.\n * @default false\n * @since 6.6.0\n */\n prefersEphemeralWebBrowserSession?: boolean;\n}\n\nexport interface OpenSecureWindowResponse {\n /**\n * The result of the openSecureWindow call\n */\n redirectedUri: string;\n}\n\nexport interface DisclaimerOptions {\n /**\n * Title of the disclaimer dialog\n * @default \"Title\"\n */\n title: string;\n /**\n * Message shown in the disclaimer dialog\n * @default \"Message\"\n */\n message: string;\n /**\n * Text for the confirm button\n * @default \"Confirm\"\n */\n confirmBtn: string;\n /**\n * Text for the cancel button\n * @default \"Cancel\"\n */\n cancelBtn: string;\n}\n\nexport interface ScreenshotResult {\n /**\n * Image format used for the screenshot.\n */\n format: 'png';\n /**\n * MIME type of the generated screenshot.\n */\n mimeType: 'image/png';\n /**\n * Base64-encoded screenshot payload without the data URL prefix.\n */\n base64: string;\n /**\n * Data URL for direct use in HTML img tags or uploads.\n */\n dataUrl: string;\n /**\n * Screenshot width in pixels.\n */\n width: number;\n /**\n * Screenshot height in pixels.\n */\n height: number;\n}\n\nexport interface HideEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * URL active when the webview was hidden.\n */\n url: string;\n /**\n * Screenshot captured immediately before the toolbar close button hides the webview.\n * Present only when `screenshotOnHide` is enabled and capture succeeds.\n */\n screenshot?: ScreenshotResult;\n}\n\nexport type HideListener = (state: HideEvent) => void;\n\nexport interface CloseWebviewOptions {\n /**\n * Target webview id to close. If omitted, closes the active webview.\n */\n id?: string;\n /**\n * Whether the webview closing is animated or not, ios only\n * @default true\n */\n isAnimated?: boolean;\n}\n\nexport interface OpenWebViewOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n * @example \"https://capgo.app\"\n */\n url: string;\n /**\n * Headers to send with the request.\n * @since 0.1.0\n * @example\n * headers: {\n * \"Custom-Header\": \"test-value\",\n * \"Authorization\": \"Bearer test-token\"\n * }\n * Test URL: https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending/\n */\n headers?: Headers;\n /**\n * Custom User-Agent string for the webview.\n *\n * When set, replaces the system default webview User-Agent on iOS and Android.\n * Takes precedence over a `User-Agent` entry in `headers`.\n *\n * @since 8.13.0\n * @example\n * customUserAgent: \"MyApp/1.0 (Capacitor)\"\n * Test URL: https://www.whatismybrowser.com/detect/what-is-my-user-agent/\n */\n customUserAgent?: string;\n /**\n * Credentials to send with the request and all subsequent requests for the same host.\n * @since 6.1.0\n * @example\n * credentials: {\n * username: \"test-user\",\n * password: \"test-pass\"\n * }\n * Test URL: https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending/\n */\n credentials?: Credentials;\n /**\n * HTTP method to use for the initial request.\n *\n * **Optional parameter - defaults to GET if not specified.**\n * Existing code that doesn't provide this parameter will continue to work unchanged with standard GET requests.\n *\n * When specified with 'POST', 'PUT', or 'PATCH' methods that support a body,\n * you can also provide a `body` parameter with the request payload.\n *\n * **Platform Notes:**\n * - iOS: Full support for all HTTP methods with headers\n * - Android: Custom headers may not be sent with POST/PUT/PATCH requests due to WebView limitations\n *\n * @since 8.2.0\n * @default \"GET\"\n * @example\n * method: \"POST\",\n * body: JSON.stringify({ token: \"auth-token\", data: \"value\" }),\n * headers: { \"Content-Type\": \"application/json\" }\n */\n method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | string;\n /**\n * HTTP body to send with the request when using POST, PUT, or other methods that support a body.\n * Should be a string (use JSON.stringify for JSON data).\n *\n * **Optional parameter - only used when `method` is specified and supports a request body.**\n * Omitting this parameter (or using GET method) results in standard behavior without a request body.\n *\n * @since 8.2.0\n * @example\n * method: \"POST\",\n * body: JSON.stringify({ username: \"user\", password: \"pass\" }),\n * headers: { \"Content-Type\": \"application/json\" }\n */\n body?: string;\n /**\n * materialPicker: if true, uses Material Design theme for date and time pickers on Android.\n * This improves the appearance of HTML date inputs to use modern Material Design UI instead of the old style pickers.\n * @since 7.4.1\n * @default false\n * @example\n * materialPicker: true\n * Test URL: https://show-picker.glitch.me/demo.html\n */\n materialPicker?: boolean;\n /**\n * JavaScript Interface:\n * The webview automatically injects a JavaScript interface providing:\n * - `window.mobileApp.close()`: Closes the webview from JavaScript\n * - `window.mobileApp.postMessage(obj)`: Sends a message to the app (listen via \"messageFromWebview\" event)\n * - `window.mobileApp.hide()` / `window.mobileApp.show()` when allowWebViewJsVisibilityControl is true in CapacitorConfig\n * - `window.mobileApp.takeScreenshot()` when `allowScreenshotsFromWebPage` is true\n *\n * @example\n * // In your webpage loaded in the webview:\n * document.getElementById(\"closeBtn\").addEventListener(\"click\", () => {\n * window.mobileApp.close();\n * });\n *\n * // Send data to the app\n * window.mobileApp.postMessage({ action: \"login\", data: { user: \"test\" }});\n *\n * @since 6.10.0\n */\n jsInterface?: never; // This property doesn't exist, it's just for documentation\n /**\n * Allows page JavaScript to call `window.mobileApp.takeScreenshot()`.\n * Disabled by default so only the host app can trigger native screenshots through the plugin API.\n *\n * @default false\n * @since 8.4.0\n */\n allowScreenshotsFromWebPage?: boolean;\n /**\n * Emits `consoleMessage` events for JavaScript `console.*` output coming from the managed page.\n * Useful when the webview stays hidden and you still need page-level diagnostics.\n *\n * @default false\n * @since 8.6.0\n */\n captureConsoleLogs?: boolean;\n /**\n * Controls whether the webview should persist website data such as cache, cookies, local storage,\n * IndexedDB, and session data.\n *\n * When false, iOS uses a non-persistent `WKWebsiteDataStore`. Android disables per-view cache and\n * DOM/database storage where the system WebView supports it. Android cookies use the shared\n * WebView cookie store; clearing them also affects the host WebView, so prefer per-URL cookie\n * helpers instead of relying on process-global wipes.\n *\n * @default true\n * @since 8.6.36\n */\n persistWebViewData?: boolean;\n /**\n * Share the host Capacitor WebView's website data store (cookies, local storage, etc.).\n *\n * On iOS 17+, InAppBrowser uses an isolated plugin-owned `WKWebsiteDataStore` by default so host\n * and browser data stay separate. Set this to `true` to use `WKWebsiteDataStore.default()` instead,\n * which shares session cookies with the Capacitor host WebView. Useful for SSO / OIDC silent login\n * when the IdP session was established in the main app WebView.\n *\n * Requires `persistWebViewData: true` (the default). When `persistWebViewData` is false, a\n * non-persistent store is used and this option has no effect.\n *\n * On Android this is a no-op: cookies are already process-global via `CookieManager`.\n * On Web this is a no-op.\n *\n * Warning: clearing cookies/cache for a webview opened with this flag can affect the host WebView\n * on iOS, because both share the same store. `clearAllBrowsingData()` still skips the host store.\n *\n * @default false\n * @since 8.13.6\n */\n useSharedDataStore?: boolean;\n /**\n * Controls Android TLS client certificate prompts during HTTPS handshakes.\n * Use `prompt` to show the system certificate picker; omit or use `none` to cancel silently (default).\n *\n * @default \"none\"\n * @since 8.7.5\n */\n clientCertificate?: 'none' | 'prompt';\n /**\n * @deprecated Use `clientCertificate: \"prompt\"` instead.\n */\n clientCertificatePrompt?: boolean;\n /**\n * Automatically handles downloads triggered inside the webview without requiring a custom JavaScript bridge.\n *\n * When enabled:\n * - Standard attachment responses are written to a temporary file.\n * - `blob:` downloads are also captured when the platform supports them.\n * - Previewable files reopen inside the in-app browser when possible.\n * - Other files are handed off to the native preview or viewer flow.\n * - `downloadCompleted` and `downloadFailed` events notify the host app about the saved file.\n *\n * @default false\n * @since 8.6.0\n */\n handleDownloads?: boolean;\n /**\n * Share options for the webview. When provided, shows a disclaimer dialog before sharing content.\n * This is useful for:\n * - Warning users about sharing sensitive information\n * - Getting user consent before sharing\n * - Explaining what will be shared\n * - Complying with privacy regulations\n *\n * Note: shareSubject is required when using shareDisclaimer\n * @since 0.1.0\n * @example\n * shareDisclaimer: {\n * title: \"Disclaimer\",\n * message: \"This is a test disclaimer\",\n * confirmBtn: \"Accept\",\n * cancelBtn: \"Decline\"\n * }\n * Test URL: https://capgo.app\n */\n shareDisclaimer?: DisclaimerOptions;\n /**\n * Toolbar type determines the appearance and behavior of the browser's toolbar\n * - \"activity\": Shows a simple toolbar with just a close button and share button\n * - \"navigation\": Shows a full navigation toolbar with back/forward buttons\n * - \"blank\": Shows no toolbar\n * - \"\": Default toolbar with close button\n * @since 0.1.0\n * @default ToolBarType.DEFAULT\n * @example\n * toolbarType: ToolBarType.ACTIVITY,\n * title: \"Activity Toolbar Test\"\n * Test URL: https://capgo.app\n */\n toolbarType?: ToolBarType;\n /**\n * Subject text for sharing. Required when using shareDisclaimer.\n * This text will be used as the subject line when sharing content.\n * @since 0.1.0\n * @example \"Share this page\"\n */\n shareSubject?: string;\n /**\n * Title of the browser\n * @since 0.1.0\n * @default \"New Window\"\n * @example \"Camera Test\"\n */\n title?: string;\n /**\n * Native toolbar title font family.\n * On iOS, use the registered font family name. On Android, the plugin first tries a res/font resource name,\n * then falls back to a system font family name.\n *\n * @since 8.7.7\n * @example \"Inter\"\n */\n titleFontFamily?: string;\n /**\n * Native toolbar title icon displayed before the title text.\n *\n * For Android:\n * - iconType can be \"asset\" for a bundled SVG asset or \"vector\" for a drawable resource\n * - icon path should be in the public folder for assets (e.g. \"brand.svg\")\n * - width and height are optional and default to 24dp\n *\n * For iOS:\n * - iconType can be \"sf-symbol\" or \"asset\"\n * - for sf-symbol, icon should be the symbol name\n * - for asset, icon should be the asset name or bundled web asset path\n *\n * @since 8.7.7\n * @example\n * titleIcon: {\n * ios: { iconType: \"sf-symbol\", icon: \"lock.fill\" },\n * android: { iconType: \"vector\", icon: \"ic_lock\", width: 20, height: 20 }\n * }\n */\n titleIcon?: ToolbarTitleIconOptions;\n /**\n * Background color of the browser\n * @since 0.1.0\n * @default BackgroundColor.BLACK\n */\n backgroundColor?: BackgroundColor;\n /**\n * If true, enables native navigation gestures within the webview.\n * - Android: Native back button navigates within webview history\n * - iOS: Enables swipe left/right gestures for back/forward navigation\n * @default false (Android), true (iOS - enabled by default)\n * @example\n * activeNativeNavigationForWebview: true,\n * disableGoBackOnNativeApplication: true\n * Test URL: https://capgo.app\n */\n activeNativeNavigationForWebview?: boolean;\n\n /**\n * Enable pull-to-refresh (overscroll from top) to reload the current page.\n * - iOS: Uses UIRefreshControl on the WebView scroll view (reload commits on finger release)\n * - Android: Uses SwipeRefreshLayout around the WebView\n *\n * On iOS, this requires overscroll bounce. If `disableOverscroll` is `true`,\n * the reload gesture will not work.\n *\n * @since 8.10.8\n * @default false\n * @example\n * enableReloadGesture: true\n */\n enableReloadGesture?: boolean;\n /**\n * Disable the possibility to go back on native application,\n * useful to force user to stay on the webview, Android only\n * @default false\n * @example\n * disableGoBackOnNativeApplication: true\n * Test URL: https://capgo.app\n */\n disableGoBackOnNativeApplication?: boolean;\n /**\n * Open url in a new window fullscreen\n * isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * Promise timing: on Android, `openWebView()` resolves with the webview id when the webview is ready to be controlled\n * (immediately for hidden/immediate presentation, after the first page load when `isPresentAfterPageLoad` is `true`).\n * On iOS, the promise resolves with the id as soon as the native webview is created, even if presentation is deferred.\n * @since 0.1.0\n * @default false\n * @example\n * isPresentAfterPageLoad: true,\n * preShowScript: \"await import('https://unpkg.com/darkreader@4.9.89/darkreader.js');\\nDarkReader.enable({ brightness: 100, contrast: 90, sepia: 10 });\"\n * Test URL: https://capgo.app\n */\n isPresentAfterPageLoad?: boolean;\n /**\n * Whether the website in the webview is inspectable or not, ios only\n * @default false\n */\n isInspectable?: boolean;\n /**\n * Whether the webview opening is animated or not, ios only\n * @default true\n */\n isAnimated?: boolean;\n /**\n * Shows a reload button that reloads the web page\n * @since 1.0.15\n * @default false\n * @example\n * showReloadButton: true\n * Test URL: https://capgo.app\n */\n showReloadButton?: boolean;\n /**\n * closeAction controls what happens when the native toolbar close button is pressed.\n * This does not change the behavior of close(), JavaScript window.mobileApp.close(), or native back navigation.\n *\n * @default CloseAction.CLOSE\n * @since 8.7.7\n * @example\n * closeAction: CloseAction.HIDE\n */\n closeAction?: CloseAction;\n /**\n * Captures the visible webview and includes it as `screenshot` in `hideEvent`\n * before the toolbar close button hides the webview.\n *\n * Only applies when `closeAction` is `CloseAction.HIDE`.\n *\n * On iOS, capture uses `WKWebView.takeSnapshot`. When testing through Apple's\n * iPhone Mirroring app with the physical device locked, the snapshot can succeed\n * with the correct dimensions but a fully transparent PNG. Capture works as\n * expected on a normal unlocked device. This appears to be an Apple mirroring\n * limitation rather than a plugin bug.\n *\n * @default false\n * @since 8.7.10\n */\n screenshotOnHide?: boolean;\n /**\n * CloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately.\n * @since 1.1.0\n * @default false\n * @example\n * closeModal: true,\n * closeModalTitle: \"Close Window\",\n * closeModalDescription: \"Are you sure you want to close?\",\n * closeModalOk: \"Yes, close\",\n * closeModalCancel: \"No, stay\"\n * Test URL: https://capgo.app\n */\n closeModal?: boolean;\n /**\n * CloseModalTitle: title of the confirm when user clicks on close button\n * @since 1.1.0\n * @default \"Close\"\n */\n closeModalTitle?: string;\n /**\n * CloseModalDescription: description of the confirm when user clicks on close button\n * @since 1.1.0\n * @default \"Are you sure you want to close this window?\"\n */\n closeModalDescription?: string;\n /**\n * CloseModalOk: text of the confirm button when user clicks on close button\n * @since 1.1.0\n * @default \"Close\"\n */\n closeModalOk?: string;\n /**\n * CloseModalCancel: text of the cancel button when user clicks on close button\n * @since 1.1.0\n * @default \"Cancel\"\n */\n closeModalCancel?: string;\n /**\n * closeModalURLPattern: a regex pattern to match against the current URL when the close button is pressed.\n * When provided along with closeModal: true, the close confirmation modal is only shown if the current URL matches this pattern.\n * If the current URL does not match, the browser closes immediately without showing the modal.\n * Requires closeModal to be true.\n * @since 7.2.0\n * @example\n * closeModal: true,\n * closeModalURLPattern: \".*checkout.*\"\n */\n closeModalURLPattern?: string;\n /**\n * visibleTitle: if true the website title would be shown else shown empty\n * @since 1.2.5\n * @default true\n */\n visibleTitle?: boolean;\n /**\n * toolbarColor: color of the toolbar in hex format\n * @since 1.2.5\n * @default \"#ffffff\"\n * @example\n * toolbarColor: \"#FF5733\"\n * Test URL: https://capgo.app\n */\n toolbarColor?: string;\n /**\n * toolbarTextColor: color of the buttons and title in the toolbar in hex format\n * When set, it overrides the automatic light/dark mode detection for text color\n * @since 6.10.0\n * @default calculated based on toolbarColor brightness\n * @example\n * toolbarTextColor: \"#FFFFFF\"\n * Test URL: https://capgo.app\n */\n toolbarTextColor?: string;\n /**\n * showArrow: if true an arrow would be shown instead of cross for closing the window\n * @since 1.2.5\n * @default false\n * @example\n * showArrow: true\n * Test URL: https://capgo.app\n */\n showArrow?: boolean;\n /**\n * ignoreUntrustedSSLError: if true, the webview will ignore untrusted SSL errors allowing the user to view the website.\n * @since 6.1.0\n * @default false\n */\n ignoreUntrustedSSLError?: boolean;\n /**\n * preShowScript: if isPresentAfterPageLoad is true and this variable is set the plugin will inject a script before showing the browser.\n * This script will be run in an async context. The plugin will wait for the script to finish (max 10 seconds)\n * @since 6.6.0\n * @example\n * preShowScript: \"await import('https://unpkg.com/darkreader@4.9.89/darkreader.js');\\nDarkReader.enable({ brightness: 100, contrast: 90, sepia: 10 });\"\n * Test URL: https://capgo.app\n */\n preShowScript?: string;\n /**\n * preShowScriptInjectionTime: controls when the preShowScript is injected.\n * - \"documentStart\": injects before any page JavaScript runs (good for polyfills like Firebase)\n * - \"pageLoad\": injects after page load (default, original behavior)\n * @since 7.26.0\n * @default \"pageLoad\"\n * @example\n * preShowScriptInjectionTime: \"documentStart\"\n */\n preShowScriptInjectionTime?: 'documentStart' | 'pageLoad';\n /**\n * Proxy interception mode.\n *\n * - `true`: legacy blanket mode, delegates all HTTP/HTTPS requests to JavaScript.\n * - `string`: Android-only regex mode kept for backward compatibility.\n *\n * Prefer `outboundProxyRules` and `inboundProxyRules` for native-first matching.\n *\n * @since 6.9.0\n */\n proxyRequests?: boolean | string;\n /**\n * Native-first outbound proxy rules.\n *\n * @since 8.6.0\n */\n outboundProxyRules?: NativeProxyRule[];\n /**\n * Native-first inbound proxy rules.\n *\n * @since 8.6.0\n */\n inboundProxyRules?: NativeProxyRule[];\n /**\n * buttonNearDone allows for a creation of a custom button near the done/close button.\n * The button is only shown when toolbarType is not \"activity\", \"navigation\", or \"blank\".\n *\n * For Android:\n * - iconType must be \"asset\"\n * - icon path should be in the public folder (e.g. \"monkey.svg\")\n * - width and height are optional, defaults to 48dp\n * - button is positioned at the end of toolbar with 8dp margin\n *\n * For iOS:\n * - iconType can be \"sf-symbol\" or \"asset\"\n * - for sf-symbol, icon should be the symbol name\n * - for asset, icon should be the asset name\n * @since 6.7.0\n * @example\n * buttonNearDone: {\n * ios: {\n * iconType: \"sf-symbol\",\n * icon: \"star.fill\"\n * },\n * android: {\n * iconType: \"asset\",\n * icon: \"public/monkey.svg\",\n * width: 24,\n * height: 24\n * }\n * }\n * Test URL: https://capgo.app\n */\n buttonNearDone?: {\n ios: {\n iconType: 'sf-symbol' | 'asset';\n icon: string;\n };\n android: {\n iconType: 'asset' | 'vector';\n icon: string;\n width?: number;\n height?: number;\n };\n };\n /**\n * Shows a native screenshot button near the done/close button.\n * The button is hidden by default and captures the current viewport when tapped.\n * This option uses the same toolbar slot as `buttonNearDone` and is therefore incompatible with it.\n * The button is only shown when toolbarType is not \"activity\", \"navigation\", or \"blank\".\n *\n * @default false\n * @since 8.4.0\n */\n showScreenshotButton?: boolean;\n /**\n * textZoom: sets the text zoom of the page in percent.\n * Allows users to increase or decrease the text size for better readability.\n * @since 7.6.0\n * @default 100\n * @example\n * textZoom: 120\n * Test URL: https://capgo.app\n */\n textZoom?: number;\n /**\n * enableZoom: enables pinch-to-zoom gestures in the Android WebView.\n * When true, built-in zoom controls are enabled and the zoom buttons are hidden.\n * **Android only** — ignored on iOS where zoom is enabled by default.\n * @since 8.5.0\n * @default false\n * @example\n * enableZoom: true\n */\n enableZoom?: boolean;\n /**\n * If true, deeplinks and external app hand-off are blocked and stay in the webview.\n * If false (default), custom schemes such as `tel:`, `mailto:`, and `sms:` open natively.\n * On iOS, listing a custom scheme under `LSApplicationQueriesSchemes` is only required when\n * you rely on `canOpenURL` for that scheme (for example `instagram://`). It is not required\n * for HTTPS `authorizedAppLinks`, and `mailto`/`tel`/`sms` open without that Info.plist entry.\n * @since 0.1.0\n * @default false\n * @example\n * preventDeeplink: true\n * Test URL: https://aasa-tester.capgo.app/\n */\n preventDeeplink?: boolean;\n\n /**\n * 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.\n * 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.\n * Custom schemes such as `tel:` and `mailto:` and authorized app links still prefer their native handlers unless `preventDeeplink` is enabled.\n *\n * @since 8.5.6\n * @default false\n * @example\n * openBlankTargetInWebView: true\n */\n openBlankTargetInWebView?: boolean;\n\n /**\n * List of base URLs whose hosts are treated as authorized App Links (Android) and Universal Links (iOS).\n *\n * - On both platforms, only HTTP(S) links whose host matches any entry in this list\n * will attempt to leave the in-app browser for the native / system handler.\n * - iOS tries a Universal Link first (`universalLinksOnly`), then falls back to a normal\n * system open (App Store, Safari, etc.). Only if both fail does the URL stay in-webview.\n * - Android uses an `ACTION_VIEW` intent for matching hosts.\n * - Matching is host-based (case-insensitive), ignoring the \"www.\" prefix.\n * - HTTPS hosts do not need `LSApplicationQueriesSchemes`; that Info.plist key is for\n * custom schemes like `instagram://`, not `https://instagram.com`.\n * - When `preventDeeplink` is enabled, all external handling is blocked regardless of this list.\n *\n * @example\n * ```ts\n * [\"https://example.com\", \"https://instagram.com\", \"https://apps.apple.com\"]\n * ```\n *\n * @since 7.12.0\n * @default []\n */\n authorizedAppLinks?: string[];\n\n /**\n * If true, the webView will not take the full height and will have a 20px margin at the bottom.\n * This creates a safe margin area outside the browser view.\n * @since 7.13.0\n * @default false\n * @example\n * enabledSafeBottomMargin: true\n */\n enabledSafeBottomMargin?: boolean;\n\n /**\n * If false, the webView will extend behind the status bar for true full-screen immersive content.\n * When true (default), respects the safe area at the top of the screen.\n * Works independently of toolbarType - use for full-screen video players, games, or immersive web apps.\n * @since 8.2.0\n * @default true\n * @example\n * enabledSafeTopMargin: false // Full screen, extends behind status bar\n */\n enabledSafeTopMargin?: boolean;\n\n /**\n * When true, applies the system status bar inset as the WebView top margin on Android.\n * Keeps the legacy 0px margin by default for apps that handle padding themselves.\n * @default false\n * @example\n * useTopInset: true\n */\n useTopInset?: boolean;\n\n /**\n * enableGooglePaySupport: if true, enables support for Google Pay popups and Payment Request API.\n * This fixes OR_BIBED_15 errors by allowing popup windows and configuring Cross-Origin-Opener-Policy.\n * Only enable this if you need Google Pay functionality as it allows popup windows.\n *\n * When enabled:\n * - Allows popup windows for Google Pay authentication\n * - Sets proper CORS headers for Payment Request API\n * - Enables multiple window support in WebView\n * - Configures secure context for payment processing\n *\n * @since 7.13.0\n * @default false\n * @example\n * enableGooglePaySupport: true\n * Test URL: https://developers.google.com/pay/api/web/guides/tutorial\n */\n enableGooglePaySupport?: boolean;\n\n /**\n * Opens popup windows created by the page in hidden mode.\n * Hidden popup windows can still be controlled with `executeScript`, `postMessage`, `show`, and `close`.\n * Listen to `popupWindowOpened` to capture the popup id, then call `show({ id })` only if you want to reveal it.\n *\n * @default false\n * @since 8.6.0\n * @example\n * hiddenPopupWindow: true\n */\n hiddenPopupWindow?: boolean;\n\n /**\n * blockedHosts: List of host patterns that should be blocked from loading in the InAppBrowser's internal navigations.\n * Any request inside WebView to a URL with a host matching any of these patterns will be blocked.\n * Supports wildcard patterns like:\n * - \"*.example.com\" to block all subdomains\n * - \"www.example.*\" to block wildcard domain extensions\n *\n * @since 7.17.0\n * @default []\n * @example\n * blockedHosts: [\"*.tracking.com\", \"ads.example.com\"]\n */\n blockedHosts?: string[];\n\n /**\n * Width of the webview in screen/window points.\n * If not set, webview will be fullscreen width.\n * @default undefined (fullscreen)\n * @example\n * width: 400\n */\n width?: number;\n\n /**\n * Height of the webview in screen/window points.\n * Required for custom-sized (non-fullscreen) webviews.\n * @default undefined (fullscreen)\n * @example\n * height: 600\n */\n height?: number;\n\n /**\n * X position of the webview in screen/window points from the left edge.\n * Only effective when custom height is set.\n * @default 0\n * @example\n * x: 50\n */\n x?: number;\n\n /**\n * Y position of the webview in screen/window points from the top edge.\n * Only effective when custom height is set.\n * @default 0\n * @example\n * y: 100\n */\n y?: number;\n\n /**\n * Places the native browser behind the Capacitor host WebView.\n * Make the app background transparent to reveal it, or rely on `transparentBackground` to clear the host WebView.\n *\n * @default false\n */\n toBack?: boolean;\n\n /**\n * When `toBack` is true, makes the Capacitor host WebView transparent so the native browser can be seen behind Ionic content.\n * Ignored when the browser is in front.\n *\n * @default true\n */\n transparentBackground?: boolean;\n\n /**\n * Disables the bounce (overscroll) effect on iOS WebView.\n * When enabled, prevents the rubber band scrolling effect when users scroll beyond content boundaries.\n * This is useful for:\n * - Creating a more native, app-like experience\n * - Preventing accidental overscroll states\n * - Avoiding issues when keyboard opens/closes\n *\n * Note: This option only affects iOS. Android does not have this bounce effect by default.\n *\n * @since 8.0.2\n * @default false\n * @example\n * disableOverscroll: true\n */\n disableOverscroll?: boolean;\n\n /**\n * Opens the webview in hidden mode (not visible to user but fully functional).\n * When hidden, the webview loads and executes JavaScript but is not displayed.\n * All control methods (executeScript, postMessage, setUrl, etc.) work while hidden.\n * Use close() to clean up the hidden webview when done.\n *\n * @since 8.0.7\n * @default false\n * @example\n * hidden: true\n */\n hidden?: boolean;\n\n /**\n * Controls how a hidden webview reports its visibility and size.\n * - AWARE: webview is aware it's hidden (dimensions may be zero).\n * - FAKE_VISIBLE: webview is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n *\n * @default InvisibilityMode.AWARE\n * @example\n * invisibilityMode: InvisibilityMode.FAKE_VISIBLE\n */\n invisibilityMode?: InvisibilityMode;\n}\n\nexport interface DimensionOptions {\n /**\n * Width of the webview in pixels\n */\n width?: number;\n /**\n * Height of the webview in pixels\n */\n height?: number;\n /**\n * X position from the left edge in pixels\n */\n x?: number;\n /**\n * Y position from the top edge in pixels\n */\n y?: number;\n}\n\nexport interface InAppBrowserPlugin {\n /**\n * Navigates back in the WebView's history if possible\n *\n * @since 7.21.0\n * @returns Promise that resolves with true if navigation was possible, false otherwise\n */\n goBack(options?: { id?: string }): Promise<{ canGoBack: boolean }>;\n\n /**\n * Open url in a new window fullscreen, on android it use chrome custom tabs, on ios it use SFSafariViewController\n *\n * @since 0.1.0\n */\n open(options: OpenOptions): Promise<any>;\n\n /**\n * Clear cookies of url\n * When `id` is omitted, applies to all open webviews.\n *\n * @since 0.5.0\n */\n clearCookies(options: ClearCookieOptions): Promise<any>;\n /**\n * Clear all cookies\n * When `id` is omitted, applies to all open webviews.\n *\n * @since 6.5.0\n */\n clearAllCookies(options?: { id?: string }): Promise<any>;\n\n /**\n * Clear cache\n * When `id` is omitted, applies to all open webviews.\n *\n * @since 6.5.0\n */\n clearCache(options?: { id?: string }): Promise<any>;\n\n /**\n * Clear all browsing data from InAppBrowser-managed webviews and the plugin-owned data store.\n *\n * This removes cookies, disk cache, memory cache, local storage, session storage, IndexedDB,\n * WebSQL where supported, form data, and HTTP auth data for InAppBrowser only.\n *\n * It does **not** clear the Capacitor/Ionic host WebView stores. On iOS 17+, InAppBrowser uses a\n * dedicated persistent `WKWebsiteDataStore` so host and browser data stay isolated (unless\n * `useSharedDataStore: true` was set on `openWebView`). On Android, process-global `CookieManager`\n * / `WebStorage` are shared with the host WebView and are not wiped by this method; open managed\n * WebViews still clear per-view cache/history and page storage.\n *\n * @since 8.6.36\n */\n clearAllBrowsingData(): Promise<any>;\n\n /**\n * Get cookies for a specific URL.\n * @param options The options, including the URL to get cookies for.\n * @returns A promise that resolves with the cookies.\n */\n getCookies(options: GetCookieOptions): Promise<Record<string, string>>;\n /**\n * Close the webview.\n * When `id` is omitted, closes the active webview.\n */\n close(options?: CloseWebviewOptions): Promise<any>;\n /**\n * Hide the webview without closing it.\n * Use show() to bring it back.\n * When `id` is omitted, targets the active webview.\n *\n * @since 8.0.8\n */\n hide(options?: { id?: string }): Promise<void>;\n /**\n * Show a previously hidden webview.\n * When `id` is omitted, targets the active webview.\n *\n * @since 8.0.8\n */\n show(options?: { id?: string }): Promise<void>;\n /**\n * Moves the native browser behind the Capacitor host WebView.\n * Use `dispatchInputEvent()` to forward overlay gestures to the browser while it is behind the app UI.\n */\n sendToBack(options?: LayerOptions): Promise<void>;\n /**\n * Moves a browser that was behind the host WebView back to the front.\n * On iOS, set `isAnimated` to `false` to skip the presentation animation.\n * When `id` is omitted, targets the active webview.\n */\n bringToFront(options?: BringToFrontOptions): Promise<void>;\n /**\n * Dispatches a click, touch, or scroll event to a managed browser.\n * Coordinates are relative to the browser viewport in CSS pixels.\n */\n dispatchInputEvent(options: DispatchInputEventOptions): Promise<void>;\n /**\n * Open url in a new webview with toolbars, and enhanced capabilities, like camera access, file access, listen events, inject javascript, bi directional communication, etc.\n *\n * JavaScript Interface:\n * When you open a webview with this method, a JavaScript interface is automatically injected that provides:\n * - `window.mobileApp.close()`: Closes the webview from JavaScript\n * - `window.mobileApp.postMessage({detail: {message: \"myMessage\"}})`: Sends a message from the webview to the app, detail object is the data you want to send to the webview\n * - `window.mobileApp.takeScreenshot()` when `allowScreenshotsFromWebPage` is true\n *\n * Promise timing differs by platform when `isPresentAfterPageLoad` is used.\n * Android resolves with `{ id }` after the dialog is ready to control, while iOS resolves with `{ id }` immediately after creating the native webview.\n *\n * @returns Promise that resolves with the created webview id.\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<{ id: string }>;\n /**\n * Injects JavaScript code into the InAppBrowser window.\n * When `id` is omitted, executes in all open webviews.\n */\n executeScript(options: { code: string; id?: string }): Promise<void>;\n /**\n * Sends an event to the webview(inappbrowser). you can listen to this event in the inappbrowser JS with window.addEventListener(\"messageFromNative\", listenerFunc: (event: Record<string, any>) => void)\n * detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects\n * Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.\n * When `id` is omitted, broadcasts to all open webviews.\n */\n postMessage(options: { detail: Record<string, any>; id?: string }): Promise<void>;\n /**\n * Captures the current webview viewport as a PNG screenshot.\n * When `id` is omitted, targets the active webview.\n *\n * On iOS, when testing through Apple's iPhone Mirroring app with the physical\n * device locked, the snapshot can succeed with the correct dimensions but a\n * fully transparent PNG. Capture works as expected on a normal unlocked device.\n */\n takeScreenshot(options?: { id?: string }): Promise<ScreenshotResult>;\n /**\n * Sets the URL of the webview.\n * When `id` is omitted, targets the active webview.\n */\n setUrl(options: { url: string; id?: string }): Promise<any>;\n /**\n * Listen for url change, only for openWebView\n *\n * @since 0.0.1\n */\n addListener(eventName: 'urlChangeEvent', listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;\n\n /**\n * Listen for buttonNearDone clicks.\n *\n * The event payload contains the webview `id`.\n *\n * @since 0.0.1\n */\n addListener(eventName: 'buttonNearDoneClick', listenerFunc: ButtonNearListener): Promise<PluginListenerHandle>;\n\n /**\n * Listen for close click only for openWebView\n *\n * @since 0.4.0\n */\n addListener(eventName: 'closeEvent', listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;\n /**\n * Listen for webviews hidden by the toolbar close button when closeAction is CloseAction.HIDE.\n *\n * @since 8.7.7\n */\n addListener(eventName: 'hideEvent', listenerFunc: HideListener): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when user clicks on confirm button when disclaimer is required,\n * works with openWebView shareDisclaimer and closeModal\n *\n * @since 0.0.1\n */\n addListener(eventName: 'confirmBtnClicked', listenerFunc: ConfirmBtnListener): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when event is sent from webview(inappbrowser), to send an event to the main app use window.mobileApp.postMessage({ \"detail\": { \"message\": \"myMessage\" } })\n * detail is the data you want to send to the main app, it's a requirement of Capacitor we cannot send direct objects\n * Your object has to be serializable to JSON, no functions or other non-JSON-serializable types are allowed.\n *\n * This method is inject at runtime in the webview\n */\n addListener(\n eventName: 'messageFromWebview',\n listenerFunc: (event: { id?: string; detail?: Record<string, any>; rawMessage?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered whenever a screenshot is captured from the plugin API,\n * the native screenshot button, or the injected JavaScript bridge.\n */\n addListener(\n eventName: 'screenshotTaken',\n listenerFunc: (event: ScreenshotResult & { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page is loaded\n */\n addListener(\n eventName: 'browserPageLoaded',\n listenerFunc: (event: { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when a main-frame page load starts (link navigation, reload, etc.).\n *\n * @since 8.11.0\n */\n addListener(\n eventName: 'browserPageLoadStart',\n listenerFunc: (event: { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered as a main-frame page load progresses.\n * `progress` is a value from `0` to `1`.\n *\n * @since 8.11.0\n */\n addListener(\n eventName: 'browserPageLoadProgress',\n listenerFunc: (event: { id?: string; progress: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page load error\n */\n addListener(\n eventName: 'pageLoadError',\n listenerFunc: (event: { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when the webview intercepts a non-standard custom scheme\n * and hands it to the operating system.\n *\n * Standard OS-handled schemes such as `tel:`, `mailto:`, and `sms:` are excluded.\n *\n * @since 8.6.7\n */\n addListener(\n eventName: 'customSchemeIntercepted',\n listenerFunc: CustomSchemeInterceptedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered after native download handling saves a file locally.\n * Enable this with `handleDownloads: true` when opening the webview.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'downloadCompleted',\n listenerFunc: (event: DownloadCompletedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when native download handling fails.\n * Enable this with `handleDownloads: true` when opening the webview.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'downloadFailed',\n listenerFunc: (event: DownloadFailedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered whenever a page opens a popup/new window.\n * Use the returned popup id with `executeScript`, `postMessage`, `show`, `hide`, and `close`.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'popupWindowOpened',\n listenerFunc: (event: PopupWindowEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for proxied requests delegated by the native runtime.\n * Prefer `addProxyHandler()` instead of calling this directly.\n *\n * @since 8.6.0\n */\n addListener(eventName: 'proxyRequest', listenerFunc: (event: ProxyRequest) => void): Promise<PluginListenerHandle>;\n /**\n * Listen for JavaScript console output emitted by the managed page.\n * Enable this with `captureConsoleLogs: true` when opening the webview.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'consoleMessage',\n listenerFunc: (event: ConsoleMessageEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Internal method used by `addProxyHandler()` to send a proxy decision back to native.\n * Forward the original `phase` when replying to a manual `proxyRequest` listener.\n *\n * @since 8.6.0\n */\n handleProxyRequest(options: {\n requestId: string;\n decision?: ProxyDecision | null;\n response?: ProxyResponse | null;\n webviewId?: string;\n phase?: 'outbound' | 'inbound';\n }): Promise<void>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Reload the current web page.\n *\n * @since 1.0.0\n */\n reload(options?: { id?: string }): Promise<any>;\n\n /**\n * Update the dimensions of the webview.\n * Allows changing the size and position of the webview at runtime.\n * When `id` is omitted, targets the active webview.\n *\n * @param options Dimension options (width, height, x, y)\n * @returns Promise that resolves when dimensions are updated\n */\n updateDimensions(options: DimensionOptions & { id?: string }): Promise<void>;\n\n /**\n * Sets the enabled safe top margin of the webview at runtime.\n * When `id` is omitted, targets the active webview.\n * On Web, this method is a no-op and resolves without changing layout.\n */\n setEnabledSafeTopMargin(options: { enabled: boolean; id?: string }): Promise<void>;\n\n /**\n * Sets the enabled safe bottom margin of the webview at runtime.\n * When `id` is omitted, targets the active webview.\n * On Web, this method is a no-op and resolves without changing layout.\n */\n setEnabledSafeBottomMargin(options: { enabled: boolean; id?: string }): Promise<void>;\n\n /**\n * Opens a secured window for OAuth2 authentication.\n *\n * On web, the redirect page should post the final URL to a `BroadcastChannel` and close itself.\n * On mobile, register a custom redirect URI scheme (for example `myapp://oauth_callback/`) in Info.plist and AndroidManifest.xml.\n * See the README section \"openSecureWindow (OAuth)\" for full setup examples.\n *\n * @param options - the options for the openSecureWindow call\n */\n openSecureWindow(options: OpenSecureWindowOptions): Promise<OpenSecureWindowResponse>;\n}\n\n/**\n * JavaScript APIs available in the InAppBrowser WebView.\n *\n * These APIs are automatically injected into all webpages loaded in the InAppBrowser WebView.\n *\n * @example\n * // Closing the webview from JavaScript\n * window.mobileApp.close();\n *\n * // Sending a message from webview to the native app\n * window.mobileApp.postMessage({ key: \"value\" });\n *\n * @since 6.10.0\n */\nexport interface InAppBrowserWebViewAPIs {\n /**\n * mobileApp - Global object injected into the WebView providing communication with the native app\n */\n mobileApp: {\n /**\n * Close the WebView from JavaScript\n *\n * @example\n * // Add a button to close the webview\n * const closeButton = document.createElement(\"button\");\n * closeButton.textContent = \"Close WebView\";\n * closeButton.addEventListener(\"click\", () => {\n * window.mobileApp.close();\n * });\n * document.body.appendChild(closeButton);\n *\n * @since 6.10.0\n */\n close(): void;\n\n /**\n * Send a message from the WebView to the native app\n * The native app can listen for these messages with the \"messageFromWebview\" event\n *\n * @param message Object to send to the native app\n * @example\n * // Send data to native app\n * window.mobileApp.postMessage({\n * action: \"dataSubmitted\",\n * data: { username: \"test\", email: \"test@example.com\" }\n * });\n *\n * @since 6.10.0\n */\n postMessage(message: Record<string, any>): void;\n\n /**\n * Hide the WebView from JavaScript (requires allowWebViewJsVisibilityControl: true in CapacitorConfig)\n *\n * @since 8.0.8\n */\n hide(): void;\n\n /**\n * Show the WebView from JavaScript (requires allowWebViewJsVisibilityControl: true in CapacitorConfig)\n *\n * @since 8.0.8\n */\n show(): void;\n\n /**\n * Capture the current WebView viewport as a PNG screenshot.\n * Requires `allowScreenshotsFromWebPage` to be enabled when opening the webview.\n *\n * @since 8.4.0\n */\n takeScreenshot(): Promise<ScreenshotResult>;\n };\n\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAmEA,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B;AACD,MAAM,CAAN,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB;;;OAGG;IACH,oCAAqB,CAAA;IACrB;;;OAGG;IACH,kCAAmB,CAAA;IACnB;;;OAGG;IACH,wCAAyB,CAAA;IACzB;;;OAGG;IACH,8BAAe,CAAA;AACjB,CAAC,EArBW,WAAW,KAAX,WAAW,QAqBtB;AAED,MAAM,CAAN,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,mCAAe,CAAA;IACf;;OAEG;IACH,iDAA6B,CAAA;AAC/B,CAAC,EATW,gBAAgB,KAAhB,gBAAgB,QAS3B;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB;;OAEG;IACH,8BAAe,CAAA;IACf;;OAEG;IACH,4BAAa,CAAA;AACf,CAAC,EATW,WAAW,KAAX,WAAW,QAStB","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface UrlEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * Emit when the url changes\n *\n * @since 0.0.1\n */\n url: string;\n}\n\n/**\n * Event emitted when the managed webview intercepts a non-standard custom scheme\n * and hands it to the operating system.\n *\n * Standard OS-handled schemes such as `tel:`, `mailto:`, and `sms:` are excluded.\n *\n * @since 8.6.7\n */\nexport interface CustomSchemeInterceptedEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * Intercepted URL.\n */\n url: string;\n /**\n * Whether the operating system accepted the URL handoff.\n */\n opened: boolean;\n}\nexport interface BtnEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * Emit when a button is clicked.\n *\n * @since 0.0.1\n */\n url: string;\n}\n\nexport interface ButtonNearDoneEvent {\n /**\n * Webview instance id.\n *\n * @since 8.6.36\n */\n id: string;\n}\n\nexport type UrlChangeListener = (state: UrlEvent) => void;\nexport type ConfirmBtnListener = (state: BtnEvent) => void;\nexport type ButtonNearListener = (state: ButtonNearDoneEvent) => void;\nexport type CustomSchemeInterceptedListener = (state: CustomSchemeInterceptedEvent) => void;\n\nexport type WebViewPointerInputEventType = 'click' | 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';\nexport type WebViewInputEventType = WebViewPointerInputEventType | 'scroll';\n\nexport enum BackgroundColor {\n WHITE = 'white',\n BLACK = 'black',\n}\nexport enum ToolBarType {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ACTIVITY = 'activity',\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n COMPACT = 'compact',\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n NAVIGATION = 'navigation',\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n BLANK = 'blank',\n}\n\nexport enum InvisibilityMode {\n /**\n * WebView is aware it is hidden (dimensions may be zero).\n */\n AWARE = 'AWARE',\n /**\n * WebView is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n */\n FAKE_VISIBLE = 'FAKE_VISIBLE',\n}\n\nexport enum CloseAction {\n /**\n * The toolbar close button closes and destroys the webview.\n */\n CLOSE = 'close',\n /**\n * The toolbar close button hides the webview so it can be shown again.\n */\n HIDE = 'hide',\n}\n\nexport interface ToolbarTitleIconOptions {\n ios?: {\n iconType: 'sf-symbol' | 'asset';\n icon: string;\n };\n android?: {\n iconType: 'asset' | 'vector';\n icon: string;\n width?: number;\n height?: number;\n };\n}\n\nexport interface Headers {\n [key: string]: string;\n}\n\nexport interface GetCookieOptions {\n url: string;\n includeHttpOnly?: boolean;\n}\n\nexport interface ClearCookieOptions {\n /**\n * Target webview id.\n * When omitted, applies to all open webviews.\n */\n id?: string;\n url: string;\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\n\nexport interface LayerOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Makes the Capacitor host WebView transparent while this native webview is behind it.\n *\n * @default true\n */\n transparentBackground?: boolean;\n}\n\nexport interface BringToFrontOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Whether bringing the webview to the front is animated on iOS.\n *\n * @default true\n */\n isAnimated?: boolean;\n}\n\nexport interface DispatchPointerInputEventOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Input event to dispatch to the webview.\n */\n type: WebViewPointerInputEventType;\n /**\n * X coordinate in CSS pixels from the webview's left edge.\n */\n x: number;\n /**\n * Y coordinate in CSS pixels from the webview's top edge.\n */\n y: number;\n}\n\nexport interface DispatchScrollInputEventOptions {\n /**\n * Target webview id. If omitted, targets the active webview.\n */\n id?: string;\n /**\n * Input event to dispatch to the webview.\n */\n type: 'scroll';\n /**\n * X coordinate in CSS pixels from the webview's left edge.\n */\n x: number;\n /**\n * Y coordinate in CSS pixels from the webview's top edge.\n */\n y: number;\n /**\n * Horizontal scroll delta in CSS pixels. Used when `type` is `scroll`.\n */\n deltaX: number;\n /**\n * Vertical scroll delta in CSS pixels. Used when `type` is `scroll`.\n */\n deltaY: number;\n}\n\nexport type DispatchInputEventOptions = DispatchPointerInputEventOptions | DispatchScrollInputEventOptions;\n\n/**\n * Represents an intercepted HTTP request from the in-app browser webview.\n *\n * Request and response bodies are base64-encoded when present.\n *\n * @since 8.6.0\n */\nexport interface ProxyRequest {\n requestId: string;\n phase: 'outbound' | 'inbound';\n url: string;\n method: string;\n headers: Record<string, string>;\n body: string | null;\n status?: number;\n responseHeaders?: Record<string, string>;\n responseBody?: string | null;\n webviewId: string;\n}\n\n/**\n * Response payload returned to native for a proxied request.\n *\n * The body must be base64-encoded.\n *\n * @since 8.6.0\n */\nexport interface ProxyResponse {\n body: string;\n status: number;\n headers: Record<string, string>;\n}\n\n/**\n * Request override returned to native for an outbound proxied request.\n *\n * The body must be base64-encoded when present.\n *\n * @since 8.6.0\n */\nexport interface ProxyRequestOverride {\n url: string;\n method?: string;\n headers?: Record<string, string>;\n body?: string | null;\n}\n\n/**\n * Event emitted when a web page opens a popup/new window.\n *\n * @since 8.6.0\n */\nexport interface PopupWindowEvent {\n /**\n * Popup webview instance id.\n */\n id: string;\n /**\n * Parent webview instance id.\n */\n parentId?: string;\n /**\n * Requested popup URL when available.\n */\n url?: string;\n /**\n * Whether the popup was presented immediately.\n */\n visible: boolean;\n}\n\n/**\n * Event emitted when JavaScript running inside the managed webview writes to the console.\n *\n * Enable this with `captureConsoleLogs: true` when opening the webview.\n *\n * @since 8.6.0\n */\nexport interface ConsoleMessageEvent {\n /**\n * Source webview instance id.\n */\n id?: string;\n /**\n * Console method or normalized severity.\n */\n level: 'log' | 'info' | 'warn' | 'error' | 'debug' | 'assert' | string;\n /**\n * Joined string representation of the console arguments.\n */\n message: string;\n /**\n * Script URL or page URL when available.\n */\n source?: string;\n /**\n * 1-based line number when available.\n */\n line?: number;\n /**\n * 1-based column number when available.\n */\n column?: number;\n /**\n * Optional subtype for runtime-originated errors on supported platforms.\n */\n kind?: string;\n}\n\n/**\n * Native handling mode used after a managed download finishes.\n *\n * @since 8.6.0\n */\nexport type DownloadHandledBy = 'inAppBrowser' | 'systemPreview' | 'external';\n\n/**\n * Event emitted after a managed download is saved locally.\n *\n * @since 8.6.0\n */\nexport interface DownloadCompletedEvent {\n /**\n * Source webview instance id.\n */\n id?: string;\n /**\n * Original URL that triggered the download when available.\n */\n sourceUrl?: string;\n /**\n * Saved filename.\n */\n fileName: string;\n /**\n * Resolved MIME type when available.\n */\n mimeType?: string;\n /**\n * Absolute native filesystem path to the saved file.\n */\n path: string;\n /**\n * `file://` URL pointing at the saved file.\n */\n localUrl: string;\n /**\n * How native handled the downloaded file after saving it.\n */\n handledBy: DownloadHandledBy;\n}\n\n/**\n * Event emitted when managed download handling fails.\n *\n * @since 8.6.0\n */\nexport interface DownloadFailedEvent {\n /**\n * Source webview instance id.\n */\n id?: string;\n /**\n * Original URL that triggered the download when available.\n */\n sourceUrl?: string;\n /**\n * Intended filename when known.\n */\n fileName?: string;\n /**\n * Resolved MIME type when available.\n */\n mimeType?: string;\n /**\n * Native error message.\n */\n error: string;\n}\n\n/**\n * Decision returned to native when handling a proxied request.\n *\n * @since 8.6.0\n */\nexport interface ProxyDecision {\n request?: ProxyRequestOverride | null;\n response?: ProxyResponse | null;\n cancel?: boolean;\n}\n\n/**\n * Native-first proxy rule used on Android and iOS.\n *\n * Any regex property that is omitted is treated as a wildcard.\n *\n * @since 8.6.0\n */\nexport interface NativeProxyRule {\n id?: string;\n urlRegex?: string;\n methodRegex?: string;\n headerRegex?: string;\n bodyRegex?: string;\n statusRegex?: string;\n responseHeaderRegex?: string;\n responseBodyRegex?: string;\n mainFrameOnly?: boolean;\n action: 'continue' | 'cancel' | 'delegateToJs';\n}\n\nexport type ProxyHandlerResult = Response | ProxyResponse | ProxyRequestOverride | ProxyDecision | null;\n\n/**\n * JavaScript callback used to handle proxied requests.\n *\n * Return a `Response`, `ProxyResponse`, `ProxyRequestOverride`, `ProxyDecision`,\n * or `null` to let native continue unchanged.\n *\n * @since 8.6.0\n */\nexport type ProxyHandler = (request: ProxyRequest) => ProxyHandlerResult | Promise<ProxyHandlerResult>;\n\nexport interface OpenOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n */\n url: string;\n /**\n * if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * @since 0.1.0\n */\n isPresentAfterPageLoad?: boolean;\n /**\n * if true the deeplink will not be opened, if false the deeplink will be opened when clicked on the link\n * @since 0.1.0\n */\n preventDeeplink?: boolean;\n\n // --- Chrome Custom Tab customization (Android only, ignored on iOS) ---\n\n /**\n * Toolbar background color in hex format (e.g., \"#1A1A2E\").\n * Applied to both light and dark color schemes.\n * Also sets the navigation bar color to match.\n * **Android only** — ignored on iOS.\n * @since 8.2.0\n */\n toolbarColor?: string;\n\n /**\n * Whether the URL bar should auto-hide when the user scrolls down.\n * The bar reappears on any upward scroll.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n urlBarHidingEnabled?: boolean;\n\n /**\n * Show the page's HTML <title> in the toolbar instead of the raw URL.\n * The true URL is still visible when the user taps the title area.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n showTitle?: boolean;\n\n /**\n * Replace the default \"X\" close icon with a back arrow.\n * Makes the Custom Tab feel like a native navigation push rather than a modal overlay.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n showArrow?: boolean;\n\n /**\n * Remove the share action from the overflow menu.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n disableShare?: boolean;\n\n /**\n * Hide the bookmark star icon in the overflow menu.\n * Uses an undocumented Chromium intent extra — may stop working on future Chrome updates.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n disableBookmark?: boolean;\n\n /**\n * Hide the download icon in the overflow menu.\n * Uses an undocumented Chromium intent extra — may stop working on future Chrome updates.\n * **Android only** — ignored on iOS.\n * @default false\n * @since 8.2.0\n */\n disableDownload?: boolean;\n}\n\nexport interface OpenSecureWindowOptions {\n /**\n * The endpoint to open\n */\n authEndpoint: string;\n /**\n * The redirect URI to use for the openSecureWindow call.\n * This will be checked to make sure it matches the redirect URI after the window finishes the redirection.\n */\n redirectUri: string;\n /**\n * The name of the broadcast channel to listen to, relevant only for web\n */\n broadcastChannelName?: string;\n /**\n * If true, the browser session will be ephemeral (no cookies or browsing data are shared with the system browser).\n * On iOS, this sets `prefersEphemeralWebBrowserSession = true` on `ASWebAuthenticationSession`.\n * On Android, this enables Custom Tabs ephemeral browsing via `setEphemeralBrowsingEnabled(true)`.\n * @default false\n * @since 6.6.0\n */\n prefersEphemeralWebBrowserSession?: boolean;\n}\n\nexport interface OpenSecureWindowResponse {\n /**\n * The result of the openSecureWindow call\n */\n redirectedUri: string;\n}\n\nexport interface DisclaimerOptions {\n /**\n * Title of the disclaimer dialog\n * @default \"Title\"\n */\n title: string;\n /**\n * Message shown in the disclaimer dialog\n * @default \"Message\"\n */\n message: string;\n /**\n * Text for the confirm button\n * @default \"Confirm\"\n */\n confirmBtn: string;\n /**\n * Text for the cancel button\n * @default \"Cancel\"\n */\n cancelBtn: string;\n}\n\nexport interface ScreenshotResult {\n /**\n * Image format used for the screenshot.\n */\n format: 'png';\n /**\n * MIME type of the generated screenshot.\n */\n mimeType: 'image/png';\n /**\n * Base64-encoded screenshot payload without the data URL prefix.\n */\n base64: string;\n /**\n * Data URL for direct use in HTML img tags or uploads.\n */\n dataUrl: string;\n /**\n * Screenshot width in pixels.\n */\n width: number;\n /**\n * Screenshot height in pixels.\n */\n height: number;\n}\n\nexport interface HideEvent {\n /**\n * Webview instance id.\n */\n id?: string;\n /**\n * URL active when the webview was hidden.\n */\n url: string;\n /**\n * Screenshot captured immediately before the toolbar close button hides the webview.\n * Present only when `screenshotOnHide` is enabled and capture succeeds.\n */\n screenshot?: ScreenshotResult;\n}\n\nexport type HideListener = (state: HideEvent) => void;\n\nexport interface CloseWebviewOptions {\n /**\n * Target webview id to close. If omitted, closes the active webview.\n */\n id?: string;\n /**\n * Whether the webview closing is animated or not, ios only\n * @default true\n */\n isAnimated?: boolean;\n}\n\nexport interface OpenWebViewOptions {\n /**\n * Target URL to load.\n * @since 0.1.0\n * @example \"https://capgo.app\"\n */\n url: string;\n /**\n * Headers to send with the request.\n * @since 0.1.0\n * @example\n * headers: {\n * \"Custom-Header\": \"test-value\",\n * \"Authorization\": \"Bearer test-token\"\n * }\n * Test URL: https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending/\n */\n headers?: Headers;\n /**\n * Custom User-Agent string for the webview.\n *\n * When set, replaces the system default webview User-Agent on iOS and Android.\n * Takes precedence over a `User-Agent` entry in `headers`.\n *\n * @since 8.13.0\n * @example\n * customUserAgent: \"MyApp/1.0 (Capacitor)\"\n * Test URL: https://www.whatismybrowser.com/detect/what-is-my-user-agent/\n */\n customUserAgent?: string;\n /**\n * Credentials to send with the request and all subsequent requests for the same host.\n * @since 6.1.0\n * @example\n * credentials: {\n * username: \"test-user\",\n * password: \"test-pass\"\n * }\n * Test URL: https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending/\n */\n credentials?: Credentials;\n /**\n * HTTP method to use for the initial request.\n *\n * **Optional parameter - defaults to GET if not specified.**\n * Existing code that doesn't provide this parameter will continue to work unchanged with standard GET requests.\n *\n * When specified with 'POST', 'PUT', or 'PATCH' methods that support a body,\n * you can also provide a `body` parameter with the request payload.\n *\n * **Platform Notes:**\n * - iOS: Full support for all HTTP methods with headers\n * - Android: Custom headers may not be sent with POST/PUT/PATCH requests due to WebView limitations\n *\n * @since 8.2.0\n * @default \"GET\"\n * @example\n * method: \"POST\",\n * body: JSON.stringify({ token: \"auth-token\", data: \"value\" }),\n * headers: { \"Content-Type\": \"application/json\" }\n */\n method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' | string;\n /**\n * HTTP body to send with the request when using POST, PUT, or other methods that support a body.\n * Should be a string (use JSON.stringify for JSON data).\n *\n * **Optional parameter - only used when `method` is specified and supports a request body.**\n * Omitting this parameter (or using GET method) results in standard behavior without a request body.\n *\n * @since 8.2.0\n * @example\n * method: \"POST\",\n * body: JSON.stringify({ username: \"user\", password: \"pass\" }),\n * headers: { \"Content-Type\": \"application/json\" }\n */\n body?: string;\n /**\n * materialPicker: if true, uses Material Design theme for date and time pickers on Android.\n * This improves the appearance of HTML date inputs to use modern Material Design UI instead of the old style pickers.\n * @since 7.4.1\n * @default false\n * @example\n * materialPicker: true\n * Test URL: https://show-picker.glitch.me/demo.html\n */\n materialPicker?: boolean;\n /**\n * JavaScript Interface:\n * The webview automatically injects a JavaScript interface providing:\n * - `window.mobileApp.close()`: Closes the webview from JavaScript\n * - `window.mobileApp.postMessage(obj)`: Sends a message to the app (listen via \"messageFromWebview\" event)\n * - `window.mobileApp.hide()` / `window.mobileApp.show()` when allowWebViewJsVisibilityControl is true in CapacitorConfig\n * - `window.mobileApp.takeScreenshot()` when `allowScreenshotsFromWebPage` is true\n *\n * @example\n * // In your webpage loaded in the webview:\n * document.getElementById(\"closeBtn\").addEventListener(\"click\", () => {\n * window.mobileApp.close();\n * });\n *\n * // Send data to the app\n * window.mobileApp.postMessage({ action: \"login\", data: { user: \"test\" }});\n *\n * @since 6.10.0\n */\n jsInterface?: never; // This property doesn't exist, it's just for documentation\n /**\n * Allows page JavaScript to call `window.mobileApp.takeScreenshot()`.\n * Disabled by default so only the host app can trigger native screenshots through the plugin API.\n *\n * @default false\n * @since 8.4.0\n */\n allowScreenshotsFromWebPage?: boolean;\n /**\n * Emits `consoleMessage` events for JavaScript `console.*` output coming from the managed page.\n * Useful when the webview stays hidden and you still need page-level diagnostics.\n *\n * @default false\n * @since 8.6.0\n */\n captureConsoleLogs?: boolean;\n /**\n * Controls whether the webview should persist website data such as cache, cookies, local storage,\n * IndexedDB, and session data.\n *\n * When false, iOS uses a non-persistent `WKWebsiteDataStore`. Android disables per-view cache and\n * DOM/database storage where the system WebView supports it. Android cookies use the shared\n * WebView cookie store; clearing them also affects the host WebView, so prefer per-URL cookie\n * helpers instead of relying on process-global wipes.\n *\n * @default true\n * @since 8.6.36\n */\n persistWebViewData?: boolean;\n /**\n * Share the host Capacitor WebView's website data store (cookies, local storage, etc.).\n *\n * On iOS 17+, InAppBrowser uses an isolated plugin-owned `WKWebsiteDataStore` by default so host\n * and browser data stay separate. Set this to `true` to use `WKWebsiteDataStore.default()` instead,\n * which shares session cookies with the Capacitor host WebView. Useful for SSO / OIDC silent login\n * when the IdP session was established in the main app WebView.\n *\n * Requires `persistWebViewData: true` (the default). When `persistWebViewData` is false, a\n * non-persistent store is used and this option has no effect.\n *\n * On Android this is a no-op: cookies are already process-global via `CookieManager`.\n * On Web this is a no-op.\n *\n * Warning: clearing cookies/cache for a webview opened with this flag can affect the host WebView\n * on iOS, because both share the same store. `clearAllBrowsingData()` still skips the host store.\n *\n * @default false\n * @since 8.13.6\n */\n useSharedDataStore?: boolean;\n /**\n * Controls Android TLS client certificate prompts during HTTPS handshakes.\n * Use `prompt` to show the system certificate picker; omit or use `none` to cancel silently (default).\n *\n * @default \"none\"\n * @since 8.7.5\n */\n clientCertificate?: 'none' | 'prompt';\n /**\n * @deprecated Use `clientCertificate: \"prompt\"` instead.\n */\n clientCertificatePrompt?: boolean;\n /**\n * Automatically handles downloads triggered inside the webview without requiring a custom JavaScript bridge.\n *\n * When enabled:\n * - Standard attachment responses are written to a temporary file.\n * - `blob:` downloads are also captured when the platform supports them.\n * - Previewable files reopen inside the in-app browser when possible.\n * - Other files are handed off to the native preview or viewer flow.\n * - `downloadCompleted` and `downloadFailed` events notify the host app about the saved file.\n *\n * @default false\n * @since 8.6.0\n */\n handleDownloads?: boolean;\n /**\n * Share options for the webview. When provided, shows a disclaimer dialog before sharing content.\n * This is useful for:\n * - Warning users about sharing sensitive information\n * - Getting user consent before sharing\n * - Explaining what will be shared\n * - Complying with privacy regulations\n *\n * Note: shareSubject is required when using shareDisclaimer\n * @since 0.1.0\n * @example\n * shareDisclaimer: {\n * title: \"Disclaimer\",\n * message: \"This is a test disclaimer\",\n * confirmBtn: \"Accept\",\n * cancelBtn: \"Decline\"\n * }\n * Test URL: https://capgo.app\n */\n shareDisclaimer?: DisclaimerOptions;\n /**\n * Toolbar type determines the appearance and behavior of the browser's toolbar\n * - \"activity\": Shows a simple toolbar with just a close button and share button\n * - \"navigation\": Shows a full navigation toolbar with back/forward buttons\n * - \"blank\": Shows no toolbar\n * - \"\": Default toolbar with close button\n * @since 0.1.0\n * @default ToolBarType.DEFAULT\n * @example\n * toolbarType: ToolBarType.ACTIVITY,\n * title: \"Activity Toolbar Test\"\n * Test URL: https://capgo.app\n */\n toolbarType?: ToolBarType;\n /**\n * Subject text for sharing. Required when using shareDisclaimer.\n * This text will be used as the subject line when sharing content.\n * @since 0.1.0\n * @example \"Share this page\"\n */\n shareSubject?: string;\n /**\n * Title of the browser\n * @since 0.1.0\n * @default \"New Window\"\n * @example \"Camera Test\"\n */\n title?: string;\n /**\n * Native toolbar title font family.\n * On iOS, use the registered font family name. On Android, the plugin first tries a res/font resource name,\n * then falls back to a system font family name.\n *\n * @since 8.7.7\n * @example \"Inter\"\n */\n titleFontFamily?: string;\n /**\n * Native toolbar title icon displayed before the title text.\n *\n * For Android:\n * - iconType can be \"asset\" for a bundled SVG asset or \"vector\" for a drawable resource\n * - icon path should be in the public folder for assets (e.g. \"brand.svg\")\n * - width and height are optional and default to 24dp\n *\n * For iOS:\n * - iconType can be \"sf-symbol\" or \"asset\"\n * - for sf-symbol, icon should be the symbol name\n * - for asset, icon should be the asset name or bundled web asset path\n *\n * @since 8.7.7\n * @example\n * titleIcon: {\n * ios: { iconType: \"sf-symbol\", icon: \"lock.fill\" },\n * android: { iconType: \"vector\", icon: \"ic_lock\", width: 20, height: 20 }\n * }\n */\n titleIcon?: ToolbarTitleIconOptions;\n /**\n * Background color of the browser\n * @since 0.1.0\n * @default BackgroundColor.BLACK\n */\n backgroundColor?: BackgroundColor;\n /**\n * If true, enables native navigation gestures within the webview.\n * - Android: Native back button navigates within webview history\n * - iOS: Enables swipe left/right gestures for back/forward navigation\n * @default false (Android), true (iOS - enabled by default)\n * @example\n * activeNativeNavigationForWebview: true,\n * disableGoBackOnNativeApplication: true\n * Test URL: https://capgo.app\n */\n activeNativeNavigationForWebview?: boolean;\n\n /**\n * Enable pull-to-refresh (overscroll from top) to reload the current page.\n * - iOS: Uses UIRefreshControl on the WebView scroll view (reload commits on finger release)\n * - Android: Uses SwipeRefreshLayout around the WebView\n *\n * On iOS, this requires overscroll bounce. If `disableOverscroll` is `true`,\n * the reload gesture will not work.\n *\n * @since 8.10.8\n * @default false\n * @example\n * enableReloadGesture: true\n */\n enableReloadGesture?: boolean;\n /**\n * Disable the possibility to go back on native application,\n * useful to force user to stay on the webview, Android only\n * @default false\n * @example\n * disableGoBackOnNativeApplication: true\n * Test URL: https://capgo.app\n */\n disableGoBackOnNativeApplication?: boolean;\n /**\n * Open url in a new window fullscreen\n * isPresentAfterPageLoad: if true, the browser will be presented after the page is loaded, if false, the browser will be presented immediately.\n * Promise timing: on Android, `openWebView()` resolves with the webview id when the webview is ready to be controlled\n * (immediately for hidden/immediate presentation, after the first page load when `isPresentAfterPageLoad` is `true`).\n * On iOS, the promise resolves with the id as soon as the native webview is created, even if presentation is deferred.\n * @since 0.1.0\n * @default false\n * @example\n * isPresentAfterPageLoad: true,\n * preShowScript: \"await import('https://unpkg.com/darkreader@4.9.89/darkreader.js');\\nDarkReader.enable({ brightness: 100, contrast: 90, sepia: 10 });\"\n * Test URL: https://capgo.app\n */\n isPresentAfterPageLoad?: boolean;\n /**\n * Whether the website in the webview is inspectable or not, ios only\n * @default false\n */\n isInspectable?: boolean;\n /**\n * Whether the webview opening is animated or not, ios only\n * @default true\n */\n isAnimated?: boolean;\n /**\n * Shows a reload button that reloads the web page\n * @since 1.0.15\n * @default false\n * @example\n * showReloadButton: true\n * Test URL: https://capgo.app\n */\n showReloadButton?: boolean;\n /**\n * closeAction controls what happens when the native toolbar close button is pressed.\n * This does not change the behavior of close(), JavaScript window.mobileApp.close(), or native back navigation.\n *\n * @default CloseAction.CLOSE\n * @since 8.7.7\n * @example\n * closeAction: CloseAction.HIDE\n */\n closeAction?: CloseAction;\n /**\n * Captures the visible webview and includes it as `screenshot` in `hideEvent`\n * before the toolbar close button hides the webview.\n *\n * Only applies when `closeAction` is `CloseAction.HIDE`.\n *\n * On iOS, capture uses `WKWebView.takeSnapshot`. When testing through Apple's\n * iPhone Mirroring app with the physical device locked, the snapshot can succeed\n * with the correct dimensions but a fully transparent PNG. Capture works as\n * expected on a normal unlocked device. This appears to be an Apple mirroring\n * limitation rather than a plugin bug.\n *\n * @default false\n * @since 8.7.10\n */\n screenshotOnHide?: boolean;\n /**\n * CloseModal: if true a confirm will be displayed when user clicks on close button, if false the browser will be closed immediately.\n * @since 1.1.0\n * @default false\n * @example\n * closeModal: true,\n * closeModalTitle: \"Close Window\",\n * closeModalDescription: \"Are you sure you want to close?\",\n * closeModalOk: \"Yes, close\",\n * closeModalCancel: \"No, stay\"\n * Test URL: https://capgo.app\n */\n closeModal?: boolean;\n /**\n * CloseModalTitle: title of the confirm when user clicks on close button\n * @since 1.1.0\n * @default \"Close\"\n */\n closeModalTitle?: string;\n /**\n * CloseModalDescription: description of the confirm when user clicks on close button\n * @since 1.1.0\n * @default \"Are you sure you want to close this window?\"\n */\n closeModalDescription?: string;\n /**\n * CloseModalOk: text of the confirm button when user clicks on close button\n * @since 1.1.0\n * @default \"Close\"\n */\n closeModalOk?: string;\n /**\n * CloseModalCancel: text of the cancel button when user clicks on close button\n * @since 1.1.0\n * @default \"Cancel\"\n */\n closeModalCancel?: string;\n /**\n * closeModalURLPattern: a regex pattern to match against the current URL when the close button is pressed.\n * When provided along with closeModal: true, the close confirmation modal is only shown if the current URL matches this pattern.\n * If the current URL does not match, the browser closes immediately without showing the modal.\n * Requires closeModal to be true.\n * @since 7.2.0\n * @example\n * closeModal: true,\n * closeModalURLPattern: \".*checkout.*\"\n */\n closeModalURLPattern?: string;\n /**\n * visibleTitle: if true the website title would be shown else shown empty\n * @since 1.2.5\n * @default true\n */\n visibleTitle?: boolean;\n /**\n * toolbarColor: color of the toolbar in hex format\n * @since 1.2.5\n * @default \"#ffffff\"\n * @example\n * toolbarColor: \"#FF5733\"\n * Test URL: https://capgo.app\n */\n toolbarColor?: string;\n /**\n * toolbarTextColor: color of the buttons and title in the toolbar in hex format\n * When set, it overrides the automatic light/dark mode detection for text color\n * @since 6.10.0\n * @default calculated based on toolbarColor brightness\n * @example\n * toolbarTextColor: \"#FFFFFF\"\n * Test URL: https://capgo.app\n */\n toolbarTextColor?: string;\n /**\n * showArrow: if true an arrow would be shown instead of cross for closing the window\n * @since 1.2.5\n * @default false\n * @example\n * showArrow: true\n * Test URL: https://capgo.app\n */\n showArrow?: boolean;\n /**\n * ignoreUntrustedSSLError: if true, the webview will ignore untrusted SSL errors allowing the user to view the website.\n * @since 6.1.0\n * @default false\n */\n ignoreUntrustedSSLError?: boolean;\n /**\n * preShowScript: if isPresentAfterPageLoad is true and this variable is set the plugin will inject a script before showing the browser.\n * This script will be run in an async context. The plugin will wait for the script to finish (max 10 seconds)\n * @since 6.6.0\n * @example\n * preShowScript: \"await import('https://unpkg.com/darkreader@4.9.89/darkreader.js');\\nDarkReader.enable({ brightness: 100, contrast: 90, sepia: 10 });\"\n * Test URL: https://capgo.app\n */\n preShowScript?: string;\n /**\n * preShowScriptInjectionTime: controls when the preShowScript is injected.\n * - \"documentStart\": injects before any page JavaScript runs (good for polyfills like Firebase)\n * - \"pageLoad\": injects after page load (default, original behavior)\n * @since 7.26.0\n * @default \"pageLoad\"\n * @example\n * preShowScriptInjectionTime: \"documentStart\"\n */\n preShowScriptInjectionTime?: 'documentStart' | 'pageLoad';\n /**\n * Proxy interception mode.\n *\n * - `true`: legacy blanket mode, delegates all HTTP/HTTPS requests to JavaScript.\n * - `string`: Android-only regex mode kept for backward compatibility.\n *\n * Prefer `outboundProxyRules` and `inboundProxyRules` for native-first matching.\n *\n * @since 6.9.0\n */\n proxyRequests?: boolean | string;\n /**\n * Native-first outbound proxy rules.\n *\n * @since 8.6.0\n */\n outboundProxyRules?: NativeProxyRule[];\n /**\n * Native-first inbound proxy rules.\n *\n * @since 8.6.0\n */\n inboundProxyRules?: NativeProxyRule[];\n /**\n * buttonNearDone allows for a creation of a custom button near the done/close button.\n * The button is only shown when toolbarType is not \"activity\", \"navigation\", or \"blank\".\n *\n * For Android:\n * - iconType must be \"asset\"\n * - icon path should be in the public folder (e.g. \"monkey.svg\")\n * - width and height are optional, defaults to 48dp\n * - button is positioned at the end of toolbar with 8dp margin\n *\n * For iOS:\n * - iconType can be \"sf-symbol\" or \"asset\"\n * - for sf-symbol, icon should be the symbol name\n * - for asset, icon should be the asset name\n * @since 6.7.0\n * @example\n * buttonNearDone: {\n * ios: {\n * iconType: \"sf-symbol\",\n * icon: \"star.fill\"\n * },\n * android: {\n * iconType: \"asset\",\n * icon: \"public/monkey.svg\",\n * width: 24,\n * height: 24\n * }\n * }\n * Test URL: https://capgo.app\n */\n buttonNearDone?: {\n ios: {\n iconType: 'sf-symbol' | 'asset';\n icon: string;\n };\n android: {\n iconType: 'asset' | 'vector';\n icon: string;\n width?: number;\n height?: number;\n };\n };\n /**\n * Shows a native screenshot button near the done/close button.\n * The button is hidden by default and captures the current viewport when tapped.\n * This option uses the same toolbar slot as `buttonNearDone` and is therefore incompatible with it.\n * The button is only shown when toolbarType is not \"activity\", \"navigation\", or \"blank\".\n *\n * @default false\n * @since 8.4.0\n */\n showScreenshotButton?: boolean;\n /**\n * textZoom: sets the text zoom of the page in percent.\n * Allows users to increase or decrease the text size for better readability.\n * @since 7.6.0\n * @default 100\n * @example\n * textZoom: 120\n * Test URL: https://capgo.app\n */\n textZoom?: number;\n /**\n * enableZoom: enables pinch-to-zoom gestures in the Android WebView.\n * When true, built-in zoom controls are enabled and the zoom buttons are hidden.\n * **Android only** — ignored on iOS where zoom is enabled by default.\n * @since 8.5.0\n * @default false\n * @example\n * enableZoom: true\n */\n enableZoom?: boolean;\n /**\n * If true, deeplinks and external app hand-off are blocked and stay in the webview.\n * If false (default), custom schemes such as `tel:`, `mailto:`, and `sms:` open natively.\n * On iOS, listing a custom scheme under `LSApplicationQueriesSchemes` is only required when\n * you rely on `canOpenURL` for that scheme (for example `instagram://`). It is not required\n * for HTTPS `authorizedAppLinks`, and `mailto`/`tel`/`sms` open without that Info.plist entry.\n * @since 0.1.0\n * @default false\n * @example\n * preventDeeplink: true\n * Test URL: https://aasa-tester.capgo.app/\n */\n preventDeeplink?: boolean;\n\n /**\n * 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.\n * 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.\n * Custom schemes such as `tel:` and `mailto:` and authorized app links still prefer their native handlers unless `preventDeeplink` is enabled.\n *\n * @since 8.5.6\n * @default false\n * @example\n * openBlankTargetInWebView: true\n */\n openBlankTargetInWebView?: boolean;\n\n /**\n * List of base URLs whose hosts are treated as authorized App Links (Android) and Universal Links (iOS).\n *\n * - On both platforms, only HTTP(S) links whose host matches any entry in this list\n * will attempt to leave the in-app browser for the native / system handler.\n * - iOS tries a Universal Link first (`universalLinksOnly`), then falls back to a normal\n * system open (App Store, Safari, etc.). Only if both fail does the URL stay in-webview.\n * - Android uses an `ACTION_VIEW` intent for matching hosts.\n * - Matching is host-based (case-insensitive), ignoring the \"www.\" prefix.\n * - HTTPS hosts do not need `LSApplicationQueriesSchemes`; that Info.plist key is for\n * custom schemes like `instagram://`, not `https://instagram.com`.\n * - When `preventDeeplink` is enabled, all external handling is blocked regardless of this list.\n *\n * @example\n * ```ts\n * [\"https://example.com\", \"https://instagram.com\", \"https://apps.apple.com\"]\n * ```\n *\n * @since 7.12.0\n * @default []\n */\n authorizedAppLinks?: string[];\n\n /**\n * If true, the webView is inset by the bottom system bar (navigation bar) so bottom-anchored\n * content stays reachable. On Android 15+ the browser window is always edge-to-edge, so the\n * bottom inset is applied there regardless of this option.\n * @since 7.13.0\n * @default false\n * @example\n * enabledSafeBottomMargin: true\n */\n enabledSafeBottomMargin?: boolean;\n\n /**\n * If false, the webView will extend behind the status bar for true full-screen immersive content.\n * When true (default), respects the safe area at the top of the screen.\n * Works independently of toolbarType - use for full-screen video players, games, or immersive web apps.\n * On Android, when a toolbar is visible the toolbar itself provides that safe area; with\n * `toolbarType: 'blank'` on Android 15+ the status bar inset is applied to the webView instead.\n * @since 8.2.0\n * @default true\n * @example\n * enabledSafeTopMargin: false // Full screen, extends behind status bar\n */\n enabledSafeTopMargin?: boolean;\n\n /**\n * When true, applies the system status bar inset to the top of the WebView on Android even when\n * the window is not edge-to-edge (before Android 15). Keeps the legacy 0px inset by default for\n * apps that handle padding themselves. On Android 15+ this is not needed: without a visible\n * toolbar the status bar inset already follows `enabledSafeTopMargin`.\n * @default false\n * @example\n * useTopInset: true\n */\n useTopInset?: boolean;\n\n /**\n * enableGooglePaySupport: if true, enables support for Google Pay popups and Payment Request API.\n * This fixes OR_BIBED_15 errors by allowing popup windows and configuring Cross-Origin-Opener-Policy.\n * Only enable this if you need Google Pay functionality as it allows popup windows.\n *\n * When enabled:\n * - Allows popup windows for Google Pay authentication\n * - Sets proper CORS headers for Payment Request API\n * - Enables multiple window support in WebView\n * - Configures secure context for payment processing\n *\n * @since 7.13.0\n * @default false\n * @example\n * enableGooglePaySupport: true\n * Test URL: https://developers.google.com/pay/api/web/guides/tutorial\n */\n enableGooglePaySupport?: boolean;\n\n /**\n * Opens popup windows created by the page in hidden mode.\n * Hidden popup windows can still be controlled with `executeScript`, `postMessage`, `show`, and `close`.\n * Listen to `popupWindowOpened` to capture the popup id, then call `show({ id })` only if you want to reveal it.\n *\n * @default false\n * @since 8.6.0\n * @example\n * hiddenPopupWindow: true\n */\n hiddenPopupWindow?: boolean;\n\n /**\n * blockedHosts: List of host patterns that should be blocked from loading in the InAppBrowser's internal navigations.\n * Any request inside WebView to a URL with a host matching any of these patterns will be blocked.\n * Supports wildcard patterns like:\n * - \"*.example.com\" to block all subdomains\n * - \"www.example.*\" to block wildcard domain extensions\n *\n * @since 7.17.0\n * @default []\n * @example\n * blockedHosts: [\"*.tracking.com\", \"ads.example.com\"]\n */\n blockedHosts?: string[];\n\n /**\n * Width of the webview in screen/window points.\n * If not set, webview will be fullscreen width.\n * @default undefined (fullscreen)\n * @example\n * width: 400\n */\n width?: number;\n\n /**\n * Height of the webview in screen/window points.\n * Required for custom-sized (non-fullscreen) webviews.\n * @default undefined (fullscreen)\n * @example\n * height: 600\n */\n height?: number;\n\n /**\n * X position of the webview in screen/window points from the left edge.\n * Only effective when custom height is set.\n * @default 0\n * @example\n * x: 50\n */\n x?: number;\n\n /**\n * Y position of the webview in screen/window points from the top edge.\n * Only effective when custom height is set.\n * @default 0\n * @example\n * y: 100\n */\n y?: number;\n\n /**\n * Places the native browser behind the Capacitor host WebView.\n * Make the app background transparent to reveal it, or rely on `transparentBackground` to clear the host WebView.\n *\n * @default false\n */\n toBack?: boolean;\n\n /**\n * When `toBack` is true, makes the Capacitor host WebView transparent so the native browser can be seen behind Ionic content.\n * Ignored when the browser is in front.\n *\n * @default true\n */\n transparentBackground?: boolean;\n\n /**\n * Disables the bounce (overscroll) effect on iOS WebView.\n * When enabled, prevents the rubber band scrolling effect when users scroll beyond content boundaries.\n * This is useful for:\n * - Creating a more native, app-like experience\n * - Preventing accidental overscroll states\n * - Avoiding issues when keyboard opens/closes\n *\n * Note: This option only affects iOS. Android does not have this bounce effect by default.\n *\n * @since 8.0.2\n * @default false\n * @example\n * disableOverscroll: true\n */\n disableOverscroll?: boolean;\n\n /**\n * Opens the webview in hidden mode (not visible to user but fully functional).\n * When hidden, the webview loads and executes JavaScript but is not displayed.\n * All control methods (executeScript, postMessage, setUrl, etc.) work while hidden.\n * Use close() to clean up the hidden webview when done.\n *\n * @since 8.0.7\n * @default false\n * @example\n * hidden: true\n */\n hidden?: boolean;\n\n /**\n * Controls how a hidden webview reports its visibility and size.\n * - AWARE: webview is aware it's hidden (dimensions may be zero).\n * - FAKE_VISIBLE: webview is hidden but reports fullscreen dimensions (uses alpha=0 to remain invisible).\n *\n * @default InvisibilityMode.AWARE\n * @example\n * invisibilityMode: InvisibilityMode.FAKE_VISIBLE\n */\n invisibilityMode?: InvisibilityMode;\n}\n\nexport interface DimensionOptions {\n /**\n * Width of the webview in pixels\n */\n width?: number;\n /**\n * Height of the webview in pixels\n */\n height?: number;\n /**\n * X position from the left edge in pixels\n */\n x?: number;\n /**\n * Y position from the top edge in pixels\n */\n y?: number;\n}\n\nexport interface InAppBrowserPlugin {\n /**\n * Navigates back in the WebView's history if possible\n *\n * @since 7.21.0\n * @returns Promise that resolves with true if navigation was possible, false otherwise\n */\n goBack(options?: { id?: string }): Promise<{ canGoBack: boolean }>;\n\n /**\n * Open url in a new window fullscreen, on android it use chrome custom tabs, on ios it use SFSafariViewController\n *\n * @since 0.1.0\n */\n open(options: OpenOptions): Promise<any>;\n\n /**\n * Clear cookies of url\n * When `id` is omitted, applies to all open webviews.\n *\n * @since 0.5.0\n */\n clearCookies(options: ClearCookieOptions): Promise<any>;\n /**\n * Clear all cookies\n * When `id` is omitted, applies to all open webviews.\n *\n * @since 6.5.0\n */\n clearAllCookies(options?: { id?: string }): Promise<any>;\n\n /**\n * Clear cache\n * When `id` is omitted, applies to all open webviews.\n *\n * @since 6.5.0\n */\n clearCache(options?: { id?: string }): Promise<any>;\n\n /**\n * Clear all browsing data from InAppBrowser-managed webviews and the plugin-owned data store.\n *\n * This removes cookies, disk cache, memory cache, local storage, session storage, IndexedDB,\n * WebSQL where supported, form data, and HTTP auth data for InAppBrowser only.\n *\n * It does **not** clear the Capacitor/Ionic host WebView stores. On iOS 17+, InAppBrowser uses a\n * dedicated persistent `WKWebsiteDataStore` so host and browser data stay isolated (unless\n * `useSharedDataStore: true` was set on `openWebView`). On Android, process-global `CookieManager`\n * / `WebStorage` are shared with the host WebView and are not wiped by this method; open managed\n * WebViews still clear per-view cache/history and page storage.\n *\n * @since 8.6.36\n */\n clearAllBrowsingData(): Promise<any>;\n\n /**\n * Get cookies for a specific URL.\n * @param options The options, including the URL to get cookies for.\n * @returns A promise that resolves with the cookies.\n */\n getCookies(options: GetCookieOptions): Promise<Record<string, string>>;\n /**\n * Close the webview.\n * When `id` is omitted, closes the active webview.\n */\n close(options?: CloseWebviewOptions): Promise<any>;\n /**\n * Hide the webview without closing it.\n * Use show() to bring it back.\n * When `id` is omitted, targets the active webview.\n *\n * @since 8.0.8\n */\n hide(options?: { id?: string }): Promise<void>;\n /**\n * Show a previously hidden webview.\n * When `id` is omitted, targets the active webview.\n *\n * @since 8.0.8\n */\n show(options?: { id?: string }): Promise<void>;\n /**\n * Moves the native browser behind the Capacitor host WebView.\n * Use `dispatchInputEvent()` to forward overlay gestures to the browser while it is behind the app UI.\n */\n sendToBack(options?: LayerOptions): Promise<void>;\n /**\n * Moves a browser that was behind the host WebView back to the front.\n * On iOS, set `isAnimated` to `false` to skip the presentation animation.\n * When `id` is omitted, targets the active webview.\n */\n bringToFront(options?: BringToFrontOptions): Promise<void>;\n /**\n * Dispatches a click, touch, or scroll event to a managed browser.\n * Coordinates are relative to the browser viewport in CSS pixels.\n */\n dispatchInputEvent(options: DispatchInputEventOptions): Promise<void>;\n /**\n * Open url in a new webview with toolbars, and enhanced capabilities, like camera access, file access, listen events, inject javascript, bi directional communication, etc.\n *\n * JavaScript Interface:\n * When you open a webview with this method, a JavaScript interface is automatically injected that provides:\n * - `window.mobileApp.close()`: Closes the webview from JavaScript\n * - `window.mobileApp.postMessage({detail: {message: \"myMessage\"}})`: Sends a message from the webview to the app, detail object is the data you want to send to the webview\n * - `window.mobileApp.takeScreenshot()` when `allowScreenshotsFromWebPage` is true\n *\n * Promise timing differs by platform when `isPresentAfterPageLoad` is used.\n * Android resolves with `{ id }` after the dialog is ready to control, while iOS resolves with `{ id }` immediately after creating the native webview.\n *\n * @returns Promise that resolves with the created webview id.\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<{ id: string }>;\n /**\n * Injects JavaScript code into the InAppBrowser window.\n * When `id` is omitted, executes in all open webviews.\n */\n executeScript(options: { code: string; id?: string }): Promise<void>;\n /**\n * Sends an event to the webview(inappbrowser). you can listen to this event in the inappbrowser JS with window.addEventListener(\"messageFromNative\", listenerFunc: (event: Record<string, any>) => void)\n * detail is the data you want to send to the webview, it's a requirement of Capacitor we cannot send direct objects\n * Your object has to be serializable to JSON, so no functions or other non-JSON-serializable types are allowed.\n * When `id` is omitted, broadcasts to all open webviews.\n */\n postMessage(options: { detail: Record<string, any>; id?: string }): Promise<void>;\n /**\n * Captures the current webview viewport as a PNG screenshot.\n * When `id` is omitted, targets the active webview.\n *\n * On iOS, when testing through Apple's iPhone Mirroring app with the physical\n * device locked, the snapshot can succeed with the correct dimensions but a\n * fully transparent PNG. Capture works as expected on a normal unlocked device.\n */\n takeScreenshot(options?: { id?: string }): Promise<ScreenshotResult>;\n /**\n * Sets the URL of the webview.\n * When `id` is omitted, targets the active webview.\n */\n setUrl(options: { url: string; id?: string }): Promise<any>;\n /**\n * Listen for url change, only for openWebView\n *\n * @since 0.0.1\n */\n addListener(eventName: 'urlChangeEvent', listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;\n\n /**\n * Listen for buttonNearDone clicks.\n *\n * The event payload contains the webview `id`.\n *\n * @since 0.0.1\n */\n addListener(eventName: 'buttonNearDoneClick', listenerFunc: ButtonNearListener): Promise<PluginListenerHandle>;\n\n /**\n * Listen for close click only for openWebView\n *\n * @since 0.4.0\n */\n addListener(eventName: 'closeEvent', listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;\n /**\n * Listen for webviews hidden by the toolbar close button when closeAction is CloseAction.HIDE.\n *\n * @since 8.7.7\n */\n addListener(eventName: 'hideEvent', listenerFunc: HideListener): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when user clicks on confirm button when disclaimer is required,\n * works with openWebView shareDisclaimer and closeModal\n *\n * @since 0.0.1\n */\n addListener(eventName: 'confirmBtnClicked', listenerFunc: ConfirmBtnListener): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when event is sent from webview(inappbrowser), to send an event to the main app use window.mobileApp.postMessage({ \"detail\": { \"message\": \"myMessage\" } })\n * detail is the data you want to send to the main app, it's a requirement of Capacitor we cannot send direct objects\n * Your object has to be serializable to JSON, no functions or other non-JSON-serializable types are allowed.\n *\n * This method is inject at runtime in the webview\n */\n addListener(\n eventName: 'messageFromWebview',\n listenerFunc: (event: { id?: string; detail?: Record<string, any>; rawMessage?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered whenever a screenshot is captured from the plugin API,\n * the native screenshot button, or the injected JavaScript bridge.\n */\n addListener(\n eventName: 'screenshotTaken',\n listenerFunc: (event: ScreenshotResult & { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page is loaded\n */\n addListener(\n eventName: 'browserPageLoaded',\n listenerFunc: (event: { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when a main-frame page load starts (link navigation, reload, etc.).\n *\n * @since 8.11.0\n */\n addListener(\n eventName: 'browserPageLoadStart',\n listenerFunc: (event: { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered as a main-frame page load progresses.\n * `progress` is a value from `0` to `1`.\n *\n * @since 8.11.0\n */\n addListener(\n eventName: 'browserPageLoadProgress',\n listenerFunc: (event: { id?: string; progress: number }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page load error\n */\n addListener(\n eventName: 'pageLoadError',\n listenerFunc: (event: { id?: string }) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when the webview intercepts a non-standard custom scheme\n * and hands it to the operating system.\n *\n * Standard OS-handled schemes such as `tel:`, `mailto:`, and `sms:` are excluded.\n *\n * @since 8.6.7\n */\n addListener(\n eventName: 'customSchemeIntercepted',\n listenerFunc: CustomSchemeInterceptedListener,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered after native download handling saves a file locally.\n * Enable this with `handleDownloads: true` when opening the webview.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'downloadCompleted',\n listenerFunc: (event: DownloadCompletedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered when native download handling fails.\n * Enable this with `handleDownloads: true` when opening the webview.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'downloadFailed',\n listenerFunc: (event: DownloadFailedEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Will be triggered whenever a page opens a popup/new window.\n * Use the returned popup id with `executeScript`, `postMessage`, `show`, `hide`, and `close`.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'popupWindowOpened',\n listenerFunc: (event: PopupWindowEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Listen for proxied requests delegated by the native runtime.\n * Prefer `addProxyHandler()` instead of calling this directly.\n *\n * @since 8.6.0\n */\n addListener(eventName: 'proxyRequest', listenerFunc: (event: ProxyRequest) => void): Promise<PluginListenerHandle>;\n /**\n * Listen for JavaScript console output emitted by the managed page.\n * Enable this with `captureConsoleLogs: true` when opening the webview.\n *\n * @since 8.6.0\n */\n addListener(\n eventName: 'consoleMessage',\n listenerFunc: (event: ConsoleMessageEvent) => void,\n ): Promise<PluginListenerHandle>;\n /**\n * Internal method used by `addProxyHandler()` to send a proxy decision back to native.\n * Forward the original `phase` when replying to a manual `proxyRequest` listener.\n *\n * @since 8.6.0\n */\n handleProxyRequest(options: {\n requestId: string;\n decision?: ProxyDecision | null;\n response?: ProxyResponse | null;\n webviewId?: string;\n phase?: 'outbound' | 'inbound';\n }): Promise<void>;\n /**\n * Remove all listeners for this plugin.\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise<void>;\n\n /**\n * Reload the current web page.\n *\n * @since 1.0.0\n */\n reload(options?: { id?: string }): Promise<any>;\n\n /**\n * Update the dimensions of the webview.\n * Allows changing the size and position of the webview at runtime.\n * When `id` is omitted, targets the active webview.\n *\n * @param options Dimension options (width, height, x, y)\n * @returns Promise that resolves when dimensions are updated\n */\n updateDimensions(options: DimensionOptions & { id?: string }): Promise<void>;\n\n /**\n * Sets the enabled safe top margin of the webview at runtime.\n * When `id` is omitted, targets the active webview.\n * On Web, this method is a no-op and resolves without changing layout.\n */\n setEnabledSafeTopMargin(options: { enabled: boolean; id?: string }): Promise<void>;\n\n /**\n * Sets the enabled safe bottom margin of the webview at runtime.\n * When `id` is omitted, targets the active webview.\n * On Web, this method is a no-op and resolves without changing layout.\n */\n setEnabledSafeBottomMargin(options: { enabled: boolean; id?: string }): Promise<void>;\n\n /**\n * Opens a secured window for OAuth2 authentication.\n *\n * On web, the redirect page should post the final URL to a `BroadcastChannel` and close itself.\n * On mobile, register a custom redirect URI scheme (for example `myapp://oauth_callback/`) in Info.plist and AndroidManifest.xml.\n * See the README section \"openSecureWindow (OAuth)\" for full setup examples.\n *\n * @param options - the options for the openSecureWindow call\n */\n openSecureWindow(options: OpenSecureWindowOptions): Promise<OpenSecureWindowResponse>;\n}\n\n/**\n * JavaScript APIs available in the InAppBrowser WebView.\n *\n * These APIs are automatically injected into all webpages loaded in the InAppBrowser WebView.\n *\n * @example\n * // Closing the webview from JavaScript\n * window.mobileApp.close();\n *\n * // Sending a message from webview to the native app\n * window.mobileApp.postMessage({ key: \"value\" });\n *\n * @since 6.10.0\n */\nexport interface InAppBrowserWebViewAPIs {\n /**\n * mobileApp - Global object injected into the WebView providing communication with the native app\n */\n mobileApp: {\n /**\n * Close the WebView from JavaScript\n *\n * @example\n * // Add a button to close the webview\n * const closeButton = document.createElement(\"button\");\n * closeButton.textContent = \"Close WebView\";\n * closeButton.addEventListener(\"click\", () => {\n * window.mobileApp.close();\n * });\n * document.body.appendChild(closeButton);\n *\n * @since 6.10.0\n */\n close(): void;\n\n /**\n * Send a message from the WebView to the native app\n * The native app can listen for these messages with the \"messageFromWebview\" event\n *\n * @param message Object to send to the native app\n * @example\n * // Send data to native app\n * window.mobileApp.postMessage({\n * action: \"dataSubmitted\",\n * data: { username: \"test\", email: \"test@example.com\" }\n * });\n *\n * @since 6.10.0\n */\n postMessage(message: Record<string, any>): void;\n\n /**\n * Hide the WebView from JavaScript (requires allowWebViewJsVisibilityControl: true in CapacitorConfig)\n *\n * @since 8.0.8\n */\n hide(): void;\n\n /**\n * Show the WebView from JavaScript (requires allowWebViewJsVisibilityControl: true in CapacitorConfig)\n *\n * @since 8.0.8\n */\n show(): void;\n\n /**\n * Capture the current WebView viewport as a PNG screenshot.\n * Requires `allowScreenshotsFromWebPage` to be enabled when opening the webview.\n *\n * @since 8.4.0\n */\n takeScreenshot(): Promise<ScreenshotResult>;\n };\n\n /**\n * Get the native Capacitor plugin version\n *\n * @returns {Promise<{ id: string }>} an Promise with version for this device\n * @throws An error if the something went wrong\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
|
@@ -415,7 +415,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
415
415
|
case aware = "AWARE"
|
|
416
416
|
case fakeVisible = "FAKE_VISIBLE"
|
|
417
417
|
}
|
|
418
|
-
private let pluginVersion: String = "8.14.
|
|
418
|
+
private let pluginVersion: String = "8.14.3"
|
|
419
419
|
public let identifier = "CapgoInAppBrowserPlugin"
|
|
420
420
|
public let jsName = "CapgoInAppBrowser"
|
|
421
421
|
public let pluginMethods: [CAPPluginMethod] = [
|