@capgo/capacitor-inappbrowser 8.6.34 → 8.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/docs.json CHANGED
@@ -118,6 +118,21 @@
118
118
  "complexTypes": [],
119
119
  "slug": "clearcache"
120
120
  },
121
+ {
122
+ "name": "clearAllBrowsingData",
123
+ "signature": "() => Promise<any>",
124
+ "parameters": [],
125
+ "returns": "Promise<any>",
126
+ "tags": [
127
+ {
128
+ "name": "since",
129
+ "text": "8.6.36"
130
+ }
131
+ ],
132
+ "docs": "Clear all browsing data from the default store and any opened managed webviews.\n\nThis removes cookies, disk cache, memory cache, local storage, session storage, IndexedDB,\nWebSQL where supported, form data, and HTTP auth data where the platform exposes it.",
133
+ "complexTypes": [],
134
+ "slug": "clearallbrowsingdata"
135
+ },
121
136
  {
122
137
  "name": "getCookies",
123
138
  "signature": "(options: GetCookieOptions) => Promise<Record<string, string>>",
@@ -206,6 +221,58 @@
206
221
  "complexTypes": [],
207
222
  "slug": "show"
208
223
  },
224
+ {
225
+ "name": "sendToBack",
226
+ "signature": "(options?: LayerOptions | undefined) => Promise<void>",
227
+ "parameters": [
228
+ {
229
+ "name": "options",
230
+ "docs": "",
231
+ "type": "LayerOptions | undefined"
232
+ }
233
+ ],
234
+ "returns": "Promise<void>",
235
+ "tags": [],
236
+ "docs": "Moves the native browser behind the Capacitor host WebView.\nUse `dispatchInputEvent()` to forward overlay gestures to the browser while it is behind the app UI.",
237
+ "complexTypes": [
238
+ "LayerOptions"
239
+ ],
240
+ "slug": "sendtoback"
241
+ },
242
+ {
243
+ "name": "bringToFront",
244
+ "signature": "(options?: { id?: string | undefined; } | undefined) => Promise<void>",
245
+ "parameters": [
246
+ {
247
+ "name": "options",
248
+ "docs": "",
249
+ "type": "{ id?: string | undefined; } | undefined"
250
+ }
251
+ ],
252
+ "returns": "Promise<void>",
253
+ "tags": [],
254
+ "docs": "Moves a browser that was behind the host WebView back to the front.\nWhen `id` is omitted, targets the active webview.",
255
+ "complexTypes": [],
256
+ "slug": "bringtofront"
257
+ },
258
+ {
259
+ "name": "dispatchInputEvent",
260
+ "signature": "(options: DispatchInputEventOptions) => Promise<void>",
261
+ "parameters": [
262
+ {
263
+ "name": "options",
264
+ "docs": "",
265
+ "type": "DispatchInputEventOptions"
266
+ }
267
+ ],
268
+ "returns": "Promise<void>",
269
+ "tags": [],
270
+ "docs": "Dispatches a click, touch, or scroll event to a managed browser.\nCoordinates are relative to the browser viewport in CSS pixels.",
271
+ "complexTypes": [
272
+ "DispatchInputEventOptions"
273
+ ],
274
+ "slug": "dispatchinputevent"
275
+ },
209
276
  {
210
277
  "name": "openWebView",
211
278
  "signature": "(options: OpenWebViewOptions) => Promise<{ id: string; }>",
@@ -346,8 +413,13 @@
346
413
  }
347
414
  ],
348
415
  "returns": "Promise<PluginListenerHandle>",
349
- "tags": [],
350
- "docs": "",
416
+ "tags": [
417
+ {
418
+ "name": "since",
419
+ "text": "0.0.1"
420
+ }
421
+ ],
422
+ "docs": "Listen for buttonNearDone clicks.\n\nThe event payload contains the webview `id`.",
351
423
  "complexTypes": [
352
424
  "PluginListenerHandle",
353
425
  "ButtonNearListener"
@@ -1084,6 +1156,124 @@
1084
1156
  }
1085
1157
  ]
1086
1158
  },
1159
+ {
1160
+ "name": "LayerOptions",
1161
+ "slug": "layeroptions",
1162
+ "docs": "",
1163
+ "tags": [],
1164
+ "methods": [],
1165
+ "properties": [
1166
+ {
1167
+ "name": "id",
1168
+ "tags": [],
1169
+ "docs": "Target webview id. If omitted, targets the active webview.",
1170
+ "complexTypes": [],
1171
+ "type": "string | undefined"
1172
+ },
1173
+ {
1174
+ "name": "transparentBackground",
1175
+ "tags": [
1176
+ {
1177
+ "text": "true",
1178
+ "name": "default"
1179
+ }
1180
+ ],
1181
+ "docs": "Makes the Capacitor host WebView transparent while this native webview is behind it.",
1182
+ "complexTypes": [],
1183
+ "type": "boolean | undefined"
1184
+ }
1185
+ ]
1186
+ },
1187
+ {
1188
+ "name": "DispatchPointerInputEventOptions",
1189
+ "slug": "dispatchpointerinputeventoptions",
1190
+ "docs": "",
1191
+ "tags": [],
1192
+ "methods": [],
1193
+ "properties": [
1194
+ {
1195
+ "name": "id",
1196
+ "tags": [],
1197
+ "docs": "Target webview id. If omitted, targets the active webview.",
1198
+ "complexTypes": [],
1199
+ "type": "string | undefined"
1200
+ },
1201
+ {
1202
+ "name": "type",
1203
+ "tags": [],
1204
+ "docs": "Input event to dispatch to the webview.",
1205
+ "complexTypes": [
1206
+ "WebViewPointerInputEventType"
1207
+ ],
1208
+ "type": "WebViewPointerInputEventType"
1209
+ },
1210
+ {
1211
+ "name": "x",
1212
+ "tags": [],
1213
+ "docs": "X coordinate in CSS pixels from the webview's left edge.",
1214
+ "complexTypes": [],
1215
+ "type": "number"
1216
+ },
1217
+ {
1218
+ "name": "y",
1219
+ "tags": [],
1220
+ "docs": "Y coordinate in CSS pixels from the webview's top edge.",
1221
+ "complexTypes": [],
1222
+ "type": "number"
1223
+ }
1224
+ ]
1225
+ },
1226
+ {
1227
+ "name": "DispatchScrollInputEventOptions",
1228
+ "slug": "dispatchscrollinputeventoptions",
1229
+ "docs": "",
1230
+ "tags": [],
1231
+ "methods": [],
1232
+ "properties": [
1233
+ {
1234
+ "name": "id",
1235
+ "tags": [],
1236
+ "docs": "Target webview id. If omitted, targets the active webview.",
1237
+ "complexTypes": [],
1238
+ "type": "string | undefined"
1239
+ },
1240
+ {
1241
+ "name": "type",
1242
+ "tags": [],
1243
+ "docs": "Input event to dispatch to the webview.",
1244
+ "complexTypes": [],
1245
+ "type": "'scroll'"
1246
+ },
1247
+ {
1248
+ "name": "x",
1249
+ "tags": [],
1250
+ "docs": "X coordinate in CSS pixels from the webview's left edge.",
1251
+ "complexTypes": [],
1252
+ "type": "number"
1253
+ },
1254
+ {
1255
+ "name": "y",
1256
+ "tags": [],
1257
+ "docs": "Y coordinate in CSS pixels from the webview's top edge.",
1258
+ "complexTypes": [],
1259
+ "type": "number"
1260
+ },
1261
+ {
1262
+ "name": "deltaX",
1263
+ "tags": [],
1264
+ "docs": "Horizontal scroll delta in CSS pixels. Used when `type` is `scroll`.",
1265
+ "complexTypes": [],
1266
+ "type": "number"
1267
+ },
1268
+ {
1269
+ "name": "deltaY",
1270
+ "tags": [],
1271
+ "docs": "Vertical scroll delta in CSS pixels. Used when `type` is `scroll`.",
1272
+ "complexTypes": [],
1273
+ "type": "number"
1274
+ }
1275
+ ]
1276
+ },
1087
1277
  {
1088
1278
  "name": "OpenWebViewOptions",
1089
1279
  "slug": "openwebviewoptions",
@@ -1247,6 +1437,22 @@
1247
1437
  "complexTypes": [],
1248
1438
  "type": "boolean | undefined"
1249
1439
  },
1440
+ {
1441
+ "name": "persistWebViewData",
1442
+ "tags": [
1443
+ {
1444
+ "text": "true",
1445
+ "name": "default"
1446
+ },
1447
+ {
1448
+ "text": "8.6.36",
1449
+ "name": "since"
1450
+ }
1451
+ ],
1452
+ "docs": "Controls whether the webview should persist website data such as cache, cookies, local storage,\nIndexedDB, and session data.\n\nWhen false, iOS uses a non-persistent `WKWebsiteDataStore`. Android disables per-view cache and\nDOM/database storage where the system WebView supports it. Android cookies use the shared\nWebView cookie store, so call `clearAllBrowsingData()` to remove cookies and other global data.",
1453
+ "complexTypes": [],
1454
+ "type": "boolean | undefined"
1455
+ },
1250
1456
  {
1251
1457
  "name": "handleDownloads",
1252
1458
  "tags": [
@@ -2033,6 +2239,30 @@
2033
2239
  "complexTypes": [],
2034
2240
  "type": "number | undefined"
2035
2241
  },
2242
+ {
2243
+ "name": "toBack",
2244
+ "tags": [
2245
+ {
2246
+ "text": "false",
2247
+ "name": "default"
2248
+ }
2249
+ ],
2250
+ "docs": "Places the native browser behind the Capacitor host WebView.\nMake the app background transparent to reveal it, or rely on `transparentBackground` to clear the host WebView.",
2251
+ "complexTypes": [],
2252
+ "type": "boolean | undefined"
2253
+ },
2254
+ {
2255
+ "name": "transparentBackground",
2256
+ "tags": [
2257
+ {
2258
+ "text": "true",
2259
+ "name": "default"
2260
+ }
2261
+ ],
2262
+ "docs": "When `toBack` is true, makes the Capacitor host WebView transparent so the native browser can be seen behind Ionic content.\nIgnored when the browser is in front.",
2263
+ "complexTypes": [],
2264
+ "type": "boolean | undefined"
2265
+ },
2036
2266
  {
2037
2267
  "name": "disableOverscroll",
2038
2268
  "tags": [
@@ -2360,6 +2590,27 @@
2360
2590
  }
2361
2591
  ]
2362
2592
  },
2593
+ {
2594
+ "name": "ButtonNearDoneEvent",
2595
+ "slug": "buttonneardoneevent",
2596
+ "docs": "",
2597
+ "tags": [],
2598
+ "methods": [],
2599
+ "properties": [
2600
+ {
2601
+ "name": "id",
2602
+ "tags": [
2603
+ {
2604
+ "text": "8.6.36",
2605
+ "name": "since"
2606
+ }
2607
+ ],
2608
+ "docs": "Webview instance id.",
2609
+ "complexTypes": [],
2610
+ "type": "string"
2611
+ }
2612
+ ]
2613
+ },
2363
2614
  {
2364
2615
  "name": "BtnEvent",
2365
2616
  "slug": "btnevent",
@@ -3126,6 +3377,52 @@
3126
3377
  }
3127
3378
  ]
3128
3379
  },
3380
+ {
3381
+ "name": "DispatchInputEventOptions",
3382
+ "slug": "dispatchinputeventoptions",
3383
+ "docs": "",
3384
+ "types": [
3385
+ {
3386
+ "text": "DispatchPointerInputEventOptions",
3387
+ "complexTypes": [
3388
+ "DispatchPointerInputEventOptions"
3389
+ ]
3390
+ },
3391
+ {
3392
+ "text": "DispatchScrollInputEventOptions",
3393
+ "complexTypes": [
3394
+ "DispatchScrollInputEventOptions"
3395
+ ]
3396
+ }
3397
+ ]
3398
+ },
3399
+ {
3400
+ "name": "WebViewPointerInputEventType",
3401
+ "slug": "webviewpointerinputeventtype",
3402
+ "docs": "",
3403
+ "types": [
3404
+ {
3405
+ "text": "'click'",
3406
+ "complexTypes": []
3407
+ },
3408
+ {
3409
+ "text": "'touchstart'",
3410
+ "complexTypes": []
3411
+ },
3412
+ {
3413
+ "text": "'touchmove'",
3414
+ "complexTypes": []
3415
+ },
3416
+ {
3417
+ "text": "'touchend'",
3418
+ "complexTypes": []
3419
+ },
3420
+ {
3421
+ "text": "'touchcancel'",
3422
+ "complexTypes": []
3423
+ }
3424
+ ]
3425
+ },
3129
3426
  {
3130
3427
  "name": "UrlChangeListener",
3131
3428
  "slug": "urlchangelistener",
@@ -3145,8 +3442,10 @@
3145
3442
  "docs": "",
3146
3443
  "types": [
3147
3444
  {
3148
- "text": "(state: object): void",
3149
- "complexTypes": []
3445
+ "text": "(state: ButtonNearDoneEvent): void",
3446
+ "complexTypes": [
3447
+ "ButtonNearDoneEvent"
3448
+ ]
3150
3449
  }
3151
3450
  ]
3152
3451
  },
@@ -45,10 +45,20 @@ export interface BtnEvent {
45
45
  */
46
46
  url: string;
47
47
  }
48
+ export interface ButtonNearDoneEvent {
49
+ /**
50
+ * Webview instance id.
51
+ *
52
+ * @since 8.6.36
53
+ */
54
+ id: string;
55
+ }
48
56
  export type UrlChangeListener = (state: UrlEvent) => void;
49
57
  export type ConfirmBtnListener = (state: BtnEvent) => void;
50
- export type ButtonNearListener = (state: object) => void;
58
+ export type ButtonNearListener = (state: ButtonNearDoneEvent) => void;
51
59
  export type CustomSchemeInterceptedListener = (state: CustomSchemeInterceptedEvent) => void;
60
+ export type WebViewPointerInputEventType = 'click' | 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';
61
+ export type WebViewInputEventType = WebViewPointerInputEventType | 'scroll';
52
62
  export declare enum BackgroundColor {
53
63
  WHITE = "white",
54
64
  BLACK = "black"
@@ -104,6 +114,63 @@ export interface Credentials {
104
114
  username: string;
105
115
  password: string;
106
116
  }
117
+ export interface LayerOptions {
118
+ /**
119
+ * Target webview id. If omitted, targets the active webview.
120
+ */
121
+ id?: string;
122
+ /**
123
+ * Makes the Capacitor host WebView transparent while this native webview is behind it.
124
+ *
125
+ * @default true
126
+ */
127
+ transparentBackground?: boolean;
128
+ }
129
+ export interface DispatchPointerInputEventOptions {
130
+ /**
131
+ * Target webview id. If omitted, targets the active webview.
132
+ */
133
+ id?: string;
134
+ /**
135
+ * Input event to dispatch to the webview.
136
+ */
137
+ type: WebViewPointerInputEventType;
138
+ /**
139
+ * X coordinate in CSS pixels from the webview's left edge.
140
+ */
141
+ x: number;
142
+ /**
143
+ * Y coordinate in CSS pixels from the webview's top edge.
144
+ */
145
+ y: number;
146
+ }
147
+ export interface DispatchScrollInputEventOptions {
148
+ /**
149
+ * Target webview id. If omitted, targets the active webview.
150
+ */
151
+ id?: string;
152
+ /**
153
+ * Input event to dispatch to the webview.
154
+ */
155
+ type: 'scroll';
156
+ /**
157
+ * X coordinate in CSS pixels from the webview's left edge.
158
+ */
159
+ x: number;
160
+ /**
161
+ * Y coordinate in CSS pixels from the webview's top edge.
162
+ */
163
+ y: number;
164
+ /**
165
+ * Horizontal scroll delta in CSS pixels. Used when `type` is `scroll`.
166
+ */
167
+ deltaX: number;
168
+ /**
169
+ * Vertical scroll delta in CSS pixels. Used when `type` is `scroll`.
170
+ */
171
+ deltaY: number;
172
+ }
173
+ export type DispatchInputEventOptions = DispatchPointerInputEventOptions | DispatchScrollInputEventOptions;
107
174
  /**
108
175
  * Represents an intercepted HTTP request from the in-app browser webview.
109
176
  *
@@ -585,6 +652,18 @@ export interface OpenWebViewOptions {
585
652
  * @since 8.6.0
586
653
  */
587
654
  captureConsoleLogs?: boolean;
655
+ /**
656
+ * Controls whether the webview should persist website data such as cache, cookies, local storage,
657
+ * IndexedDB, and session data.
658
+ *
659
+ * When false, iOS uses a non-persistent `WKWebsiteDataStore`. Android disables per-view cache and
660
+ * DOM/database storage where the system WebView supports it. Android cookies use the shared
661
+ * WebView cookie store, so call `clearAllBrowsingData()` to remove cookies and other global data.
662
+ *
663
+ * @default true
664
+ * @since 8.6.36
665
+ */
666
+ persistWebViewData?: boolean;
588
667
  /**
589
668
  * Automatically handles downloads triggered inside the webview without requiring a custom JavaScript bridge.
590
669
  *
@@ -1048,6 +1127,20 @@ export interface OpenWebViewOptions {
1048
1127
  * y: 100
1049
1128
  */
1050
1129
  y?: number;
1130
+ /**
1131
+ * Places the native browser behind the Capacitor host WebView.
1132
+ * Make the app background transparent to reveal it, or rely on `transparentBackground` to clear the host WebView.
1133
+ *
1134
+ * @default false
1135
+ */
1136
+ toBack?: boolean;
1137
+ /**
1138
+ * When `toBack` is true, makes the Capacitor host WebView transparent so the native browser can be seen behind Ionic content.
1139
+ * Ignored when the browser is in front.
1140
+ *
1141
+ * @default true
1142
+ */
1143
+ transparentBackground?: boolean;
1051
1144
  /**
1052
1145
  * Disables the bounce (overscroll) effect on iOS WebView.
1053
1146
  * When enabled, prevents the rubber band scrolling effect when users scroll beyond content boundaries.
@@ -1148,6 +1241,15 @@ export interface InAppBrowserPlugin {
1148
1241
  clearCache(options?: {
1149
1242
  id?: string;
1150
1243
  }): Promise<any>;
1244
+ /**
1245
+ * Clear all browsing data from the default store and any opened managed webviews.
1246
+ *
1247
+ * This removes cookies, disk cache, memory cache, local storage, session storage, IndexedDB,
1248
+ * WebSQL where supported, form data, and HTTP auth data where the platform exposes it.
1249
+ *
1250
+ * @since 8.6.36
1251
+ */
1252
+ clearAllBrowsingData(): Promise<any>;
1151
1253
  /**
1152
1254
  * Get cookies for a specific URL.
1153
1255
  * @param options The options, including the URL to get cookies for.
@@ -1178,6 +1280,23 @@ export interface InAppBrowserPlugin {
1178
1280
  show(options?: {
1179
1281
  id?: string;
1180
1282
  }): Promise<void>;
1283
+ /**
1284
+ * Moves the native browser behind the Capacitor host WebView.
1285
+ * Use `dispatchInputEvent()` to forward overlay gestures to the browser while it is behind the app UI.
1286
+ */
1287
+ sendToBack(options?: LayerOptions): Promise<void>;
1288
+ /**
1289
+ * Moves a browser that was behind the host WebView back to the front.
1290
+ * When `id` is omitted, targets the active webview.
1291
+ */
1292
+ bringToFront(options?: {
1293
+ id?: string;
1294
+ }): Promise<void>;
1295
+ /**
1296
+ * Dispatches a click, touch, or scroll event to a managed browser.
1297
+ * Coordinates are relative to the browser viewport in CSS pixels.
1298
+ */
1299
+ dispatchInputEvent(options: DispatchInputEventOptions): Promise<void>;
1181
1300
  /**
1182
1301
  * Open url in a new webview with toolbars, and enhanced capabilities, like camera access, file access, listen events, inject javascript, bi directional communication, etc.
1183
1302
  *
@@ -1235,6 +1354,13 @@ export interface InAppBrowserPlugin {
1235
1354
  * @since 0.0.1
1236
1355
  */
1237
1356
  addListener(eventName: 'urlChangeEvent', listenerFunc: UrlChangeListener): Promise<PluginListenerHandle>;
1357
+ /**
1358
+ * Listen for buttonNearDone clicks.
1359
+ *
1360
+ * The event payload contains the webview `id`.
1361
+ *
1362
+ * @since 0.0.1
1363
+ */
1238
1364
  addListener(eventName: 'buttonNearDoneClick', listenerFunc: ButtonNearListener): Promise<PluginListenerHandle>;
1239
1365
  /**
1240
1366
  * Listen for close click only for openWebView