@capgo/inappbrowser 7.28.2 → 7.29.2

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 CHANGED
@@ -18,6 +18,7 @@ The official Capacitor Browser plugin has strict security limitations that preve
18
18
  - **URL change monitoring** for navigation tracking
19
19
  - **Custom toolbars and UI** for branded experiences
20
20
  - **Cookie and cache management** for session control
21
+ - **Custom sizes** for extra control of the display position
21
22
 
22
23
  Perfect for OAuth flows, embedded web apps, video calls, and any scenario requiring deep integration with web content.
23
24
 
@@ -39,6 +40,33 @@ import { InAppBrowser } from '@capgo/inappbrowser'
39
40
  InAppBrowser.open({ url: "YOUR_URL" });
40
41
  ```
41
42
 
43
+ ### Open WebView with Custom Dimensions
44
+
45
+ By default, the webview opens in fullscreen. You can set custom dimensions to control the size and position:
46
+
47
+ ```js
48
+ import { InAppBrowser } from '@capgo/inappbrowser'
49
+
50
+ // Open with custom dimensions (400x600 at position 50,100)
51
+ InAppBrowser.openWebView({
52
+ url: "YOUR_URL",
53
+ width: 400,
54
+ height: 600,
55
+ x: 50,
56
+ y: 100
57
+ });
58
+
59
+ // Update dimensions at runtime
60
+ InAppBrowser.updateDimensions({
61
+ width: 500,
62
+ height: 700,
63
+ x: 100,
64
+ y: 150
65
+ });
66
+ ```
67
+
68
+ **Touch Passthrough**: When custom dimensions are set (not fullscreen), touches outside the webview bounds will pass through to the underlying Capacitor webview, allowing the user to interact with your app in the exposed areas. This enables picture-in-picture style experiences where the InAppBrowser floats above your content.
69
+
42
70
  ### Open WebView with Safe Margin
43
71
 
44
72
  To create a webView with a 20px bottom margin (safe margin area outside the browser):
@@ -190,6 +218,7 @@ window.mobileApp.close();
190
218
  * [`addListener('pageLoadError', ...)`](#addlistenerpageloaderror-)
191
219
  * [`removeAllListeners()`](#removealllisteners)
192
220
  * [`reload()`](#reload)
221
+ * [`updateDimensions(...)`](#updatedimensions)
193
222
  * [Interfaces](#interfaces)
194
223
  * [Type Aliases](#type-aliases)
195
224
  * [Enums](#enums)
@@ -552,6 +581,22 @@ Reload the current web page.
552
581
  --------------------
553
582
 
554
583
 
584
+ ### updateDimensions(...)
585
+
586
+ ```typescript
587
+ updateDimensions(options: DimensionOptions) => Promise<void>
588
+ ```
589
+
590
+ Update the dimensions of the webview.
591
+ Allows changing the size and position of the webview at runtime.
592
+
593
+ | Param | Type | Description |
594
+ | ------------- | ------------------------------------------------------------- | --------------------------------------- |
595
+ | **`options`** | <code><a href="#dimensionoptions">DimensionOptions</a></code> | Dimension options (width, height, x, y) |
596
+
597
+ --------------------
598
+
599
+
555
600
  ### Interfaces
556
601
 
557
602
 
@@ -636,6 +681,10 @@ Reload the current web page.
636
681
  | **`useTopInset`** | <code>boolean</code> | When true, applies the system status bar inset as the WebView top margin on Android. Keeps the legacy 0px margin by default for apps that handle padding themselves. | <code>false</code> | |
637
682
  | **`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 |
638
683
  | **`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 |
684
+ | **`width`** | <code>number</code> | Width of the webview in pixels. If not set, webview will be fullscreen width. | <code>undefined (fullscreen)</code> | |
685
+ | **`height`** | <code>number</code> | Height of the webview in pixels. If not set, webview will be fullscreen height. | <code>undefined (fullscreen)</code> | |
686
+ | **`x`** | <code>number</code> | X position of the webview in pixels from the left edge. Only effective when width is set. | <code>0</code> | |
687
+ | **`y`** | <code>number</code> | Y position of the webview in pixels from the top edge. Only effective when height is set. | <code>0</code> | |
639
688
 
640
689
 
641
690
  #### Headers
@@ -680,6 +729,16 @@ Reload the current web page.
680
729
  | **`url`** | <code>string</code> | Emit when a button is clicked. | 0.0.1 |
681
730
 
682
731
 
732
+ #### DimensionOptions
733
+
734
+ | Prop | Type | Description |
735
+ | ------------ | ------------------- | --------------------------------------- |
736
+ | **`width`** | <code>number</code> | Width of the webview in pixels |
737
+ | **`height`** | <code>number</code> | Height of the webview in pixels |
738
+ | **`x`** | <code>number</code> | X position from the left edge in pixels |
739
+ | **`y`** | <code>number</code> | Y position from the top edge in pixels |
740
+
741
+
683
742
  ### Type Aliases
684
743
 
685
744
 
@@ -50,7 +50,7 @@ import org.json.JSONObject;
50
50
  )
51
51
  public class InAppBrowserPlugin extends Plugin implements WebViewDialog.PermissionHandler {
52
52
 
53
- private final String pluginVersion = "7.28.2";
53
+ private final String pluginVersion = "7.29.2";
54
54
 
55
55
  public static final String CUSTOM_TAB_PACKAGE_NAME = "com.android.chrome"; // Change when in stable
56
56
  private CustomTabsClient customTabsClient;
@@ -647,6 +647,31 @@ public class InAppBrowserPlugin extends Plugin implements WebViewDialog.Permissi
647
647
  // Set Google Pay support option
648
648
  options.setEnableGooglePaySupport(Boolean.TRUE.equals(call.getBoolean("enableGooglePaySupport", false)));
649
649
 
650
+ // Set dimensions if provided
651
+ Integer width = call.getInt("width");
652
+ Integer height = call.getInt("height");
653
+ Integer x = call.getInt("x");
654
+ Integer y = call.getInt("y");
655
+
656
+ // Validate dimension parameters
657
+ if (width != null && height == null) {
658
+ call.reject("Height must be specified when width is provided");
659
+ return;
660
+ }
661
+
662
+ if (width != null) {
663
+ options.setWidth(width);
664
+ }
665
+ if (height != null) {
666
+ options.setHeight(height);
667
+ }
668
+ if (x != null) {
669
+ options.setX(x);
670
+ }
671
+ if (y != null) {
672
+ options.setY(y);
673
+ }
674
+
650
675
  this.getActivity().runOnUiThread(
651
676
  new Runnable() {
652
677
  @Override
@@ -930,4 +955,36 @@ public class InAppBrowserPlugin extends Plugin implements WebViewDialog.Permissi
930
955
  call.reject("Could not get plugin version", e);
931
956
  }
932
957
  }
958
+
959
+ @PluginMethod
960
+ public void updateDimensions(PluginCall call) {
961
+ if (webViewDialog == null) {
962
+ call.reject("WebView is not initialized");
963
+ return;
964
+ }
965
+
966
+ Integer width = call.getInt("width");
967
+ Integer height = call.getInt("height");
968
+ Integer x = call.getInt("x");
969
+ Integer y = call.getInt("y");
970
+
971
+ this.getActivity().runOnUiThread(
972
+ new Runnable() {
973
+ @Override
974
+ public void run() {
975
+ try {
976
+ if (webViewDialog != null) {
977
+ webViewDialog.updateDimensions(width, height, x, y);
978
+ call.resolve();
979
+ } else {
980
+ call.reject("WebView is not initialized");
981
+ }
982
+ } catch (Exception e) {
983
+ Log.e("InAppBrowser", "Error updating dimensions: " + e.getMessage());
984
+ call.reject("Failed to update dimensions: " + e.getMessage());
985
+ }
986
+ }
987
+ }
988
+ );
989
+ }
933
990
  }
@@ -162,6 +162,42 @@ public class Options {
162
162
  private boolean useTopInset = false;
163
163
  private boolean enableGooglePaySupport = false;
164
164
  private List<String> blockedHosts = new ArrayList<>();
165
+ private Integer width = null;
166
+ private Integer height = null;
167
+ private Integer x = null;
168
+ private Integer y = null;
169
+
170
+ public Integer getWidth() {
171
+ return width;
172
+ }
173
+
174
+ public void setWidth(Integer width) {
175
+ this.width = width;
176
+ }
177
+
178
+ public Integer getHeight() {
179
+ return height;
180
+ }
181
+
182
+ public void setHeight(Integer height) {
183
+ this.height = height;
184
+ }
185
+
186
+ public Integer getX() {
187
+ return x;
188
+ }
189
+
190
+ public void setX(Integer x) {
191
+ this.x = x;
192
+ }
193
+
194
+ public Integer getY() {
195
+ return y;
196
+ }
197
+
198
+ public void setY(Integer y) {
199
+ this.y = y;
200
+ }
165
201
 
166
202
  public int getTextZoom() {
167
203
  return textZoom;
@@ -30,6 +30,7 @@ import android.text.TextUtils;
30
30
  import android.util.Base64;
31
31
  import android.util.Log;
32
32
  import android.util.TypedValue;
33
+ import android.view.KeyEvent;
33
34
  import android.view.View;
34
35
  import android.view.ViewGroup;
35
36
  import android.view.Window;
@@ -266,6 +267,19 @@ public class WebViewDialog extends Dialog {
266
267
  );
267
268
  setContentView(R.layout.activity_browser);
268
269
 
270
+ // If custom dimensions are set, configure for touch passthrough
271
+ if (_options != null && (_options.getWidth() != null || _options.getHeight() != null)) {
272
+ Window window = getWindow();
273
+ if (window != null) {
274
+ // Make the dialog background transparent
275
+ window.setBackgroundDrawableResource(android.R.color.transparent);
276
+ // Don't dim the background
277
+ window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
278
+ // Allow touches outside to pass through
279
+ window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
280
+ }
281
+ }
282
+
269
283
  // Set fitsSystemWindows only for Android 10 (API 29)
270
284
  if (android.os.Build.VERSION.SDK_INT == android.os.Build.VERSION_CODES.Q) {
271
285
  View coordinator = findViewById(R.id.coordinator_layout);
@@ -337,7 +351,8 @@ public class WebViewDialog extends Dialog {
337
351
  });
338
352
  }
339
353
 
340
- getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
354
+ // Set dimensions if specified, otherwise fullscreen
355
+ applyDimensions();
341
356
 
342
357
  this._webView = findViewById(R.id.browser_view);
343
358
 
@@ -2661,6 +2676,28 @@ public class WebViewDialog extends Dialog {
2661
2676
  }
2662
2677
  }
2663
2678
 
2679
+ @Override
2680
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
2681
+ // Forward volume key events to the MainActivity
2682
+ switch (keyCode) {
2683
+ case KeyEvent.KEYCODE_VOLUME_UP:
2684
+ case KeyEvent.KEYCODE_VOLUME_DOWN:
2685
+ return activity.onKeyDown(keyCode, event);
2686
+ }
2687
+ return super.onKeyDown(keyCode, event);
2688
+ }
2689
+
2690
+ @Override
2691
+ public boolean onKeyUp(int keyCode, KeyEvent event) {
2692
+ // Forward volume key events to the MainActivity
2693
+ switch (keyCode) {
2694
+ case KeyEvent.KEYCODE_VOLUME_UP:
2695
+ case KeyEvent.KEYCODE_VOLUME_DOWN:
2696
+ return activity.onKeyUp(keyCode, event);
2697
+ }
2698
+ return super.onKeyUp(keyCode, event);
2699
+ }
2700
+
2664
2701
  public static String getReasonPhrase(int statusCode) {
2665
2702
  return switch (statusCode) {
2666
2703
  case (200) -> "OK";
@@ -2671,7 +2708,7 @@ public class WebViewDialog extends Dialog {
2671
2708
  case (205) -> "Reset Content";
2672
2709
  case (206) -> "Partial Content";
2673
2710
  case (207) -> "Partial Update OK";
2674
- case (300) -> "Mutliple Choices";
2711
+ case (300) -> "Multiple Choices";
2675
2712
  case (301) -> "Moved Permanently";
2676
2713
  case (302) -> "Moved Temporarily";
2677
2714
  case (303) -> "See Other";
@@ -2956,4 +2993,67 @@ public class WebViewDialog extends Dialog {
2956
2993
  File image = File.createTempFile(imageFileName /* prefix */, ".jpg" /* suffix */, storageDir /* directory */);
2957
2994
  return image;
2958
2995
  }
2996
+
2997
+ /**
2998
+ * Apply dimensions to the webview window
2999
+ */
3000
+ private void applyDimensions() {
3001
+ Integer width = _options.getWidth();
3002
+ Integer height = _options.getHeight();
3003
+ Integer x = _options.getX();
3004
+ Integer y = _options.getY();
3005
+
3006
+ WindowManager.LayoutParams params = getWindow().getAttributes();
3007
+
3008
+ // If both width and height are specified, use custom dimensions
3009
+ if (width != null && height != null) {
3010
+ params.width = (int) getPixels(width);
3011
+ params.height = (int) getPixels(height);
3012
+ params.x = (x != null) ? (int) getPixels(x) : 0;
3013
+ params.y = (y != null) ? (int) getPixels(y) : 0;
3014
+ } else if (height != null && width == null) {
3015
+ // If only height is specified, use custom height with fullscreen width
3016
+ params.width = WindowManager.LayoutParams.MATCH_PARENT;
3017
+ params.height = (int) getPixels(height);
3018
+ params.x = 0;
3019
+ params.y = (y != null) ? (int) getPixels(y) : 0;
3020
+ } else {
3021
+ // Default to fullscreen
3022
+ params.width = WindowManager.LayoutParams.MATCH_PARENT;
3023
+ params.height = WindowManager.LayoutParams.MATCH_PARENT;
3024
+ params.x = 0;
3025
+ params.y = 0;
3026
+ }
3027
+
3028
+ getWindow().setAttributes(params);
3029
+ }
3030
+
3031
+ /**
3032
+ * Update dimensions at runtime
3033
+ */
3034
+ public void updateDimensions(Integer width, Integer height, Integer x, Integer y) {
3035
+ // Update options
3036
+ if (width != null) {
3037
+ _options.setWidth(width);
3038
+ }
3039
+ if (height != null) {
3040
+ _options.setHeight(height);
3041
+ }
3042
+ if (x != null) {
3043
+ _options.setX(x);
3044
+ }
3045
+ if (y != null) {
3046
+ _options.setY(y);
3047
+ }
3048
+
3049
+ // Apply new dimensions
3050
+ applyDimensions();
3051
+ }
3052
+
3053
+ /**
3054
+ * Convert density-independent pixels (dp) to actual pixels
3055
+ */
3056
+ private float getPixels(int dp) {
3057
+ return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, _context.getResources().getDisplayMetrics());
3058
+ }
2959
3059
  }
package/dist/docs.json CHANGED
@@ -429,6 +429,33 @@
429
429
  "docs": "Reload the current web page.",
430
430
  "complexTypes": [],
431
431
  "slug": "reload"
432
+ },
433
+ {
434
+ "name": "updateDimensions",
435
+ "signature": "(options: DimensionOptions) => Promise<void>",
436
+ "parameters": [
437
+ {
438
+ "name": "options",
439
+ "docs": "Dimension options (width, height, x, y)",
440
+ "type": "DimensionOptions"
441
+ }
442
+ ],
443
+ "returns": "Promise<void>",
444
+ "tags": [
445
+ {
446
+ "name": "param",
447
+ "text": "options Dimension options (width, height, x, y)"
448
+ },
449
+ {
450
+ "name": "returns",
451
+ "text": "Promise that resolves when dimensions are updated"
452
+ }
453
+ ],
454
+ "docs": "Update the dimensions of the webview.\nAllows changing the size and position of the webview at runtime.",
455
+ "complexTypes": [
456
+ "DimensionOptions"
457
+ ],
458
+ "slug": "updatedimensions"
432
459
  }
433
460
  ],
434
461
  "properties": []
@@ -1229,6 +1256,70 @@
1229
1256
  "docs": "blockedHosts: List of host patterns that should be blocked from loading in the InAppBrowser's internal navigations.\nAny request inside WebView to a URL with a host matching any of these patterns will be blocked.\nSupports wildcard patterns like:\n- \"*.example.com\" to block all subdomains\n- \"www.example.*\" to block wildcard domain extensions",
1230
1257
  "complexTypes": [],
1231
1258
  "type": "string[] | undefined"
1259
+ },
1260
+ {
1261
+ "name": "width",
1262
+ "tags": [
1263
+ {
1264
+ "text": "undefined (fullscreen)",
1265
+ "name": "default"
1266
+ },
1267
+ {
1268
+ "text": "width: 400",
1269
+ "name": "example"
1270
+ }
1271
+ ],
1272
+ "docs": "Width of the webview in pixels.\nIf not set, webview will be fullscreen width.",
1273
+ "complexTypes": [],
1274
+ "type": "number | undefined"
1275
+ },
1276
+ {
1277
+ "name": "height",
1278
+ "tags": [
1279
+ {
1280
+ "text": "undefined (fullscreen)",
1281
+ "name": "default"
1282
+ },
1283
+ {
1284
+ "text": "height: 600",
1285
+ "name": "example"
1286
+ }
1287
+ ],
1288
+ "docs": "Height of the webview in pixels.\nIf not set, webview will be fullscreen height.",
1289
+ "complexTypes": [],
1290
+ "type": "number | undefined"
1291
+ },
1292
+ {
1293
+ "name": "x",
1294
+ "tags": [
1295
+ {
1296
+ "text": "0",
1297
+ "name": "default"
1298
+ },
1299
+ {
1300
+ "text": "x: 50",
1301
+ "name": "example"
1302
+ }
1303
+ ],
1304
+ "docs": "X position of the webview in pixels from the left edge.\nOnly effective when width is set.",
1305
+ "complexTypes": [],
1306
+ "type": "number | undefined"
1307
+ },
1308
+ {
1309
+ "name": "y",
1310
+ "tags": [
1311
+ {
1312
+ "text": "0",
1313
+ "name": "default"
1314
+ },
1315
+ {
1316
+ "text": "y: 100",
1317
+ "name": "example"
1318
+ }
1319
+ ],
1320
+ "docs": "Y position of the webview in pixels from the top edge.\nOnly effective when height is set.",
1321
+ "complexTypes": [],
1322
+ "type": "number | undefined"
1232
1323
  }
1233
1324
  ]
1234
1325
  },
@@ -1377,6 +1468,43 @@
1377
1468
  "type": "string"
1378
1469
  }
1379
1470
  ]
1471
+ },
1472
+ {
1473
+ "name": "DimensionOptions",
1474
+ "slug": "dimensionoptions",
1475
+ "docs": "",
1476
+ "tags": [],
1477
+ "methods": [],
1478
+ "properties": [
1479
+ {
1480
+ "name": "width",
1481
+ "tags": [],
1482
+ "docs": "Width of the webview in pixels",
1483
+ "complexTypes": [],
1484
+ "type": "number | undefined"
1485
+ },
1486
+ {
1487
+ "name": "height",
1488
+ "tags": [],
1489
+ "docs": "Height of the webview in pixels",
1490
+ "complexTypes": [],
1491
+ "type": "number | undefined"
1492
+ },
1493
+ {
1494
+ "name": "x",
1495
+ "tags": [],
1496
+ "docs": "X position from the left edge in pixels",
1497
+ "complexTypes": [],
1498
+ "type": "number | undefined"
1499
+ },
1500
+ {
1501
+ "name": "y",
1502
+ "tags": [],
1503
+ "docs": "Y position from the top edge in pixels",
1504
+ "complexTypes": [],
1505
+ "type": "number | undefined"
1506
+ }
1507
+ ]
1380
1508
  }
1381
1509
  ],
1382
1510
  "enums": [
@@ -494,6 +494,56 @@ export interface OpenWebViewOptions {
494
494
  * blockedHosts: ["*.tracking.com", "ads.example.com"]
495
495
  */
496
496
  blockedHosts?: string[];
497
+ /**
498
+ * Width of the webview in pixels.
499
+ * If not set, webview will be fullscreen width.
500
+ * @default undefined (fullscreen)
501
+ * @example
502
+ * width: 400
503
+ */
504
+ width?: number;
505
+ /**
506
+ * Height of the webview in pixels.
507
+ * If not set, webview will be fullscreen height.
508
+ * @default undefined (fullscreen)
509
+ * @example
510
+ * height: 600
511
+ */
512
+ height?: number;
513
+ /**
514
+ * X position of the webview in pixels from the left edge.
515
+ * Only effective when width is set.
516
+ * @default 0
517
+ * @example
518
+ * x: 50
519
+ */
520
+ x?: number;
521
+ /**
522
+ * Y position of the webview in pixels from the top edge.
523
+ * Only effective when height is set.
524
+ * @default 0
525
+ * @example
526
+ * y: 100
527
+ */
528
+ y?: number;
529
+ }
530
+ export interface DimensionOptions {
531
+ /**
532
+ * Width of the webview in pixels
533
+ */
534
+ width?: number;
535
+ /**
536
+ * Height of the webview in pixels
537
+ */
538
+ height?: number;
539
+ /**
540
+ * X position from the left edge in pixels
541
+ */
542
+ x?: number;
543
+ /**
544
+ * Y position from the top edge in pixels
545
+ */
546
+ y?: number;
497
547
  }
498
548
  export interface InAppBrowserPlugin {
499
549
  /**
@@ -620,6 +670,14 @@ export interface InAppBrowserPlugin {
620
670
  * @since 1.0.0
621
671
  */
622
672
  reload(): Promise<any>;
673
+ /**
674
+ * Update the dimensions of the webview.
675
+ * Allows changing the size and position of the webview at runtime.
676
+ *
677
+ * @param options Dimension options (width, height, x, y)
678
+ * @returns Promise that resolves when dimensions are updated
679
+ */
680
+ updateDimensions(options: DimensionOptions): Promise<void>;
623
681
  }
624
682
  /**
625
683
  * JavaScript APIs available in the InAppBrowser WebView.
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAuBA,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","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface UrlEvent {\n /**\n * Emit when the url changes\n *\n * @since 0.0.1\n */\n url: string;\n}\nexport interface BtnEvent {\n /**\n * Emit when a button is clicked.\n *\n * @since 0.0.1\n */\n url: string;\n}\n\nexport type UrlChangeListener = (state: UrlEvent) => void;\nexport type ConfirmBtnListener = (state: BtnEvent) => void;\nexport type ButtonNearListener = (state: object) => void;\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 interface Headers {\n [key: string]: string;\n}\n\nexport interface GetCookieOptions {\n url: string;\n includeHttpOnly?: boolean;\n}\n\nexport interface ClearCookieOptions {\n url: string;\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\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\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 CloseWebviewOptions {\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 * 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 * 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 *\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 * 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 * 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 * 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 * @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 * 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 * 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 * proxyRequests is a regex expression. Please see [this pr](https://github.com/Cap-go/capacitor-inappbrowser/pull/222) for more info. (Android only)\n * @since 6.9.0\n */\n proxyRequests?: string;\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 * 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 * preventDeeplink: if true, the deeplink will not be opened, if false the deeplink will be opened when clicked on the link. on IOS each schema need to be added to info.plist file under LSApplicationQueriesSchemes when false to make it work.\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 * List of base URLs whose hosts are treated as authorized App Links (Android) and Universal Links (iOS).\n *\n * - On both platforms, only HTTPS links whose host matches any entry in this list\n * will attempt to open via the corresponding native application.\n * - If the app is not installed or the system cannot handle the link, the URL\n * will continue loading inside the in-app browser.\n * - Matching is host-based (case-insensitive), ignoring the \"www.\" prefix.\n * - When `preventDeeplink` is enabled, all external handling is blocked regardless of this list.\n *\n * @example\n * ```ts\n * [\"https://example.com\", \"https://subdomain.app.io\"]\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 * 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 * 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\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(): 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 *\n * @since 0.5.0\n */\n clearCookies(options: ClearCookieOptions): Promise<any>;\n /**\n * Clear all cookies\n *\n * @since 6.5.0\n */\n clearAllCookies(): Promise<any>;\n\n /**\n * Clear cache\n *\n * @since 6.5.0\n */\n clearCache(): 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 */\n close(options?: CloseWebviewOptions): Promise<any>;\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 *\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<any>;\n /**\n * Injects JavaScript code into the InAppBrowser window.\n */\n executeScript({ code }: { code: 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 */\n postMessage(options: { detail: Record<string, any> }): Promise<void>;\n /**\n * Sets the URL of the webview.\n */\n setUrl(options: { url: 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 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 * 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: { detail: Record<string, any> }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page is loaded\n */\n addListener(eventName: 'browserPageLoaded', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page load error\n */\n addListener(eventName: 'pageLoadError', listenerFunc: () => void): Promise<PluginListenerHandle>;\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(): Promise<any>;\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 /**\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":"AAuBA,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","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport interface UrlEvent {\n /**\n * Emit when the url changes\n *\n * @since 0.0.1\n */\n url: string;\n}\nexport interface BtnEvent {\n /**\n * Emit when a button is clicked.\n *\n * @since 0.0.1\n */\n url: string;\n}\n\nexport type UrlChangeListener = (state: UrlEvent) => void;\nexport type ConfirmBtnListener = (state: BtnEvent) => void;\nexport type ButtonNearListener = (state: object) => void;\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 interface Headers {\n [key: string]: string;\n}\n\nexport interface GetCookieOptions {\n url: string;\n includeHttpOnly?: boolean;\n}\n\nexport interface ClearCookieOptions {\n url: string;\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\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\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 CloseWebviewOptions {\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 * 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 * 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 *\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 * 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 * 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 * 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 * @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 * 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 * 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 * proxyRequests is a regex expression. Please see [this pr](https://github.com/Cap-go/capacitor-inappbrowser/pull/222) for more info. (Android only)\n * @since 6.9.0\n */\n proxyRequests?: string;\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 * 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 * preventDeeplink: if true, the deeplink will not be opened, if false the deeplink will be opened when clicked on the link. on IOS each schema need to be added to info.plist file under LSApplicationQueriesSchemes when false to make it work.\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 * List of base URLs whose hosts are treated as authorized App Links (Android) and Universal Links (iOS).\n *\n * - On both platforms, only HTTPS links whose host matches any entry in this list\n * will attempt to open via the corresponding native application.\n * - If the app is not installed or the system cannot handle the link, the URL\n * will continue loading inside the in-app browser.\n * - Matching is host-based (case-insensitive), ignoring the \"www.\" prefix.\n * - When `preventDeeplink` is enabled, all external handling is blocked regardless of this list.\n *\n * @example\n * ```ts\n * [\"https://example.com\", \"https://subdomain.app.io\"]\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 * 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 * 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 pixels.\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 pixels.\n * If not set, webview will be fullscreen height.\n * @default undefined (fullscreen)\n * @example\n * height: 600\n */\n height?: number;\n\n /**\n * X position of the webview in pixels from the left edge.\n * Only effective when width is set.\n * @default 0\n * @example\n * x: 50\n */\n x?: number;\n\n /**\n * Y position of the webview in pixels from the top edge.\n * Only effective when height is set.\n * @default 0\n * @example\n * y: 100\n */\n y?: number;\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(): 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 *\n * @since 0.5.0\n */\n clearCookies(options: ClearCookieOptions): Promise<any>;\n /**\n * Clear all cookies\n *\n * @since 6.5.0\n */\n clearAllCookies(): Promise<any>;\n\n /**\n * Clear cache\n *\n * @since 6.5.0\n */\n clearCache(): 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 */\n close(options?: CloseWebviewOptions): Promise<any>;\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 *\n * @since 0.1.0\n */\n openWebView(options: OpenWebViewOptions): Promise<any>;\n /**\n * Injects JavaScript code into the InAppBrowser window.\n */\n executeScript({ code }: { code: 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 */\n postMessage(options: { detail: Record<string, any> }): Promise<void>;\n /**\n * Sets the URL of the webview.\n */\n setUrl(options: { url: 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 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 * 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: { detail: Record<string, any> }) => void,\n ): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page is loaded\n */\n addListener(eventName: 'browserPageLoaded', listenerFunc: () => void): Promise<PluginListenerHandle>;\n\n /**\n * Will be triggered when page load error\n */\n addListener(eventName: 'pageLoadError', listenerFunc: () => void): Promise<PluginListenerHandle>;\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(): Promise<any>;\n\n /**\n * Update the dimensions of the webview.\n * Allows changing the size and position of the webview at runtime.\n *\n * @param options Dimension options (width, height, x, y)\n * @returns Promise that resolves when dimensions are updated\n */\n updateDimensions(options: DimensionOptions): Promise<void>;\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 /**\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"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import type { InAppBrowserPlugin, OpenWebViewOptions, OpenOptions, GetCookieOptions, ClearCookieOptions } from './definitions';
2
+ import type { InAppBrowserPlugin, OpenWebViewOptions, OpenOptions, GetCookieOptions, ClearCookieOptions, DimensionOptions } from './definitions';
3
3
  export declare class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {
4
4
  clearAllCookies(): Promise<any>;
5
5
  clearCache(): Promise<any>;
@@ -20,4 +20,5 @@ export declare class InAppBrowserWeb extends WebPlugin implements InAppBrowserPl
20
20
  getPluginVersion(): Promise<{
21
21
  version: string;
22
22
  }>;
23
+ updateDimensions(options: DimensionOptions): Promise<void>;
23
24
  }
package/dist/esm/web.js CHANGED
@@ -51,5 +51,10 @@ export class InAppBrowserWeb extends WebPlugin {
51
51
  async getPluginVersion() {
52
52
  return { version: 'web' };
53
53
  }
54
+ async updateDimensions(options) {
55
+ console.log('updateDimensions', options);
56
+ // Web platform doesn't support dimension control
57
+ return;
58
+ }
54
59
  }
55
60
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,eAAe;QACb,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B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CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO;IACT,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n OpenOptions,\n GetCookieOptions,\n ClearCookieOptions,\n} from './definitions';\n\nexport class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {\n clearAllCookies(): Promise<any> {\n console.log('clearAllCookies');\n return Promise.resolve();\n }\n clearCache(): Promise<any> {\n console.log('clearCache');\n return Promise.resolve();\n }\n async open(options: OpenOptions): Promise<any> {\n console.log('open', options);\n return options;\n }\n\n async clearCookies(options: ClearCookieOptions): Promise<any> {\n console.log('cleanCookies', options);\n return;\n }\n\n async getCookies(options: GetCookieOptions): Promise<any> {\n // Web implementation to get cookies\n return options;\n }\n\n async openWebView(options: OpenWebViewOptions): Promise<any> {\n console.log('openWebView', options);\n return options;\n }\n\n async executeScript({ code }: { code: string }): Promise<any> {\n console.log('code', code);\n return code;\n }\n\n async close(): Promise<any> {\n console.log('close');\n return;\n }\n\n async setUrl(options: { url: string }): Promise<any> {\n console.log('setUrl', options.url);\n return;\n }\n\n async reload(): Promise<any> {\n console.log('reload');\n return;\n }\n async postMessage(options: Record<string, any>): Promise<any> {\n console.log('postMessage', options);\n return options;\n }\n\n async goBack(): Promise<any> {\n console.log('goBack');\n return;\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,eAAe;QACb,OAAO,CAAC,GAAG,CAAC,i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,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,OAAO;IACT,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAAyB;QAC9C,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QACzC,iDAAiD;QACjD,OAAO;IACT,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n InAppBrowserPlugin,\n OpenWebViewOptions,\n OpenOptions,\n GetCookieOptions,\n ClearCookieOptions,\n DimensionOptions,\n} from './definitions';\n\nexport class InAppBrowserWeb extends WebPlugin implements InAppBrowserPlugin {\n clearAllCookies(): Promise<any> {\n console.log('clearAllCookies');\n return Promise.resolve();\n }\n clearCache(): Promise<any> {\n console.log('clearCache');\n return Promise.resolve();\n }\n async open(options: OpenOptions): Promise<any> {\n console.log('open', options);\n return options;\n }\n\n async clearCookies(options: ClearCookieOptions): Promise<any> {\n console.log('cleanCookies', options);\n return;\n }\n\n async getCookies(options: GetCookieOptions): Promise<any> {\n // Web implementation to get cookies\n return options;\n }\n\n async openWebView(options: OpenWebViewOptions): Promise<any> {\n console.log('openWebView', options);\n return options;\n }\n\n async executeScript({ code }: { code: string }): Promise<any> {\n console.log('code', code);\n return code;\n }\n\n async close(): Promise<any> {\n console.log('close');\n return;\n }\n\n async setUrl(options: { url: string }): Promise<any> {\n console.log('setUrl', options.url);\n return;\n }\n\n async reload(): Promise<any> {\n console.log('reload');\n return;\n }\n async postMessage(options: Record<string, any>): Promise<any> {\n console.log('postMessage', options);\n return options;\n }\n\n async goBack(): Promise<any> {\n console.log('goBack');\n return;\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n\n async updateDimensions(options: DimensionOptions): Promise<void> {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n}\n"]}
@@ -87,6 +87,11 @@ class InAppBrowserWeb extends core.WebPlugin {
87
87
  async getPluginVersion() {
88
88
  return { version: 'web' };
89
89
  }
90
+ async updateDimensions(options) {
91
+ console.log('updateDimensions', options);
92
+ // Web platform doesn't support dimension control
93
+ return;
94
+ }
90
95
  }
91
96
 
92
97
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst InAppBrowser = registerPlugin('InAppBrowser', {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n});\nexport * from './definitions';\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class InAppBrowserWeb extends WebPlugin {\n clearAllCookies() {\n console.log('clearAllCookies');\n return Promise.resolve();\n }\n clearCache() {\n console.log('clearCache');\n return Promise.resolve();\n }\n async open(options) {\n console.log('open', options);\n return options;\n }\n async clearCookies(options) {\n console.log('cleanCookies', options);\n return;\n }\n async getCookies(options) {\n // Web implementation to get cookies\n return options;\n }\n async openWebView(options) {\n console.log('openWebView', options);\n return options;\n }\n async executeScript({ code }) {\n console.log('code', code);\n return code;\n }\n async close() {\n console.log('close');\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload() {\n console.log('reload');\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;AACX,CAAC,UAAU,WAAW,EAAE;AACxB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;AACxC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,SAAS;AACtC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY;AAC5C;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;AAClC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;;AC1BhC,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;;ACFM,MAAM,eAAe,SAASC,cAAS,CAAC;AAC/C,IAAI,eAAe,GAAG;AACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,i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OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;AAC3C,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC7B,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst InAppBrowser = registerPlugin('InAppBrowser', {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n});\nexport * from './definitions';\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class InAppBrowserWeb extends WebPlugin {\n clearAllCookies() {\n console.log('clearAllCookies');\n return Promise.resolve();\n }\n clearCache() {\n console.log('clearCache');\n return Promise.resolve();\n }\n async open(options) {\n console.log('open', options);\n return options;\n }\n async clearCookies(options) {\n console.log('cleanCookies', options);\n return;\n }\n async getCookies(options) {\n // Web implementation to get cookies\n return options;\n }\n async openWebView(options) {\n console.log('openWebView', options);\n return options;\n }\n async executeScript({ code }) {\n console.log('code', code);\n return code;\n }\n async close() {\n console.log('close');\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload() {\n console.log('reload');\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async updateDimensions(options) {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,eAAe,EAAE;AAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;AACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;AACX,CAAC,UAAU,WAAW,EAAE;AACxB;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;AACxC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,SAAS,CAAC,GAAG,SAAS;AACtC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,YAAY,CAAC,GAAG,YAAY;AAC5C;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,CAAC,GAAG,OAAO;AAClC,CAAC,EAAEA,mBAAW,KAAKA,mBAAW,GAAG,EAAE,CAAC,CAAC;;AC1BhC,MAAC,YAAY,GAAGC,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;AACnE,CAAC;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,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC7B,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;AAC3C,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG;AACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;AAC7B,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ,IAAI,MAAM,gBAAgB,CAAC,OAAO,EAAE;AACpC,QAAQ,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC;AAChD;AACA,QAAQ;AACR,IAAI;AACJ;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -86,6 +86,11 @@ var capacitorInAppBrowser = (function (exports, core) {
86
86
  async getPluginVersion() {
87
87
  return { version: 'web' };
88
88
  }
89
+ async updateDimensions(options) {
90
+ console.log('updateDimensions', options);
91
+ // Web platform doesn't support dimension control
92
+ return;
93
+ }
89
94
  }
90
95
 
91
96
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst InAppBrowser = registerPlugin('InAppBrowser', {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n});\nexport * from './definitions';\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class InAppBrowserWeb extends WebPlugin {\n clearAllCookies() {\n console.log('clearAllCookies');\n return Promise.resolve();\n }\n clearCache() {\n console.log('clearCache');\n return Promise.resolve();\n }\n async open(options) {\n console.log('open', options);\n return options;\n }\n async clearCookies(options) {\n console.log('cleanCookies', options);\n return;\n }\n async getCookies(options) {\n // Web implementation to get cookies\n return options;\n }\n async openWebView(options) {\n console.log('openWebView', options);\n return options;\n }\n async executeScript({ code }) {\n console.log('code', code);\n return code;\n }\n async close() {\n console.log('close');\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload() {\n console.log('reload');\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;IACX,CAAC,UAAU,WAAW,EAAE;IACxB;IACA;IACA;IACA;IACA,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,UAAU;IACxC;IACA;IACA;IACA;I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AAM,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;IACjC,QAAQ,OAAO,IAAI;IACnB,IAAI;IACJ,IAAI,MAAM,KAAK,GAAG;IAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ;IACR,IAAI;IACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;IAC1B,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC;IAC1C,QAAQ;IACR,IAAI;IACJ,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC7B,QAAQ;IACR,IAAI;IACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC;IAC3C,QAAQ,OAAO,OAAO;IACtB,IAAI;IACJ,IAAI,MAAM,MAAM,GAAG;IACnB,QAAQ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC7B,QAAQ;IACR,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BackgroundColor;\n(function (BackgroundColor) {\n BackgroundColor[\"WHITE\"] = \"white\";\n BackgroundColor[\"BLACK\"] = \"black\";\n})(BackgroundColor || (BackgroundColor = {}));\nexport var ToolBarType;\n(function (ToolBarType) {\n /**\n * Shows a simple toolbar with just a close button and share button\n * @since 0.1.0\n */\n ToolBarType[\"ACTIVITY\"] = \"activity\";\n /**\n * Shows a simple toolbar with just a close button\n * @since 7.6.8\n */\n ToolBarType[\"COMPACT\"] = \"compact\";\n /**\n * Shows a full navigation toolbar with back/forward buttons\n * @since 0.1.0\n */\n ToolBarType[\"NAVIGATION\"] = \"navigation\";\n /**\n * Shows no toolbar\n * @since 0.1.0\n */\n ToolBarType[\"BLANK\"] = \"blank\";\n})(ToolBarType || (ToolBarType = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst InAppBrowser = registerPlugin('InAppBrowser', {\n web: () => import('./web').then((m) => new m.InAppBrowserWeb()),\n});\nexport * from './definitions';\nexport { InAppBrowser };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class InAppBrowserWeb extends WebPlugin {\n clearAllCookies() {\n console.log('clearAllCookies');\n return Promise.resolve();\n }\n clearCache() {\n console.log('clearCache');\n return Promise.resolve();\n }\n async open(options) {\n console.log('open', options);\n return options;\n }\n async clearCookies(options) {\n console.log('cleanCookies', options);\n return;\n }\n async getCookies(options) {\n // Web implementation to get cookies\n return options;\n }\n async openWebView(options) {\n console.log('openWebView', options);\n return options;\n }\n async executeScript({ code }) {\n console.log('code', code);\n return code;\n }\n async close() {\n console.log('close');\n return;\n }\n async setUrl(options) {\n console.log('setUrl', options.url);\n return;\n }\n async reload() {\n console.log('reload');\n return;\n }\n async postMessage(options) {\n console.log('postMessage', options);\n return options;\n }\n async goBack() {\n console.log('goBack');\n return;\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n async updateDimensions(options) {\n console.log('updateDimensions', options);\n // Web platform doesn't support dimension control\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BackgroundColor","ToolBarType","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,eAAe,EAAE;IAC5B,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO;IACtC,CAAC,EAAEA,uBAAe,KAAKA,uBAAe,GAAG,EAAE,CAAC,CAAC;AAClCC;IACX,CAAC,UAAU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"7.28.2"
27
+ private let pluginVersion: String = "7.29.2"
28
28
  public let identifier = "InAppBrowserPlugin"
29
29
  public let jsName = "InAppBrowser"
30
30
  public let pluginMethods: [CAPPluginMethod] = [
@@ -41,6 +41,7 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
41
41
  CAPPluginMethod(name: "close", returnType: CAPPluginReturnPromise),
42
42
  CAPPluginMethod(name: "executeScript", returnType: CAPPluginReturnPromise),
43
43
  CAPPluginMethod(name: "postMessage", returnType: CAPPluginReturnPromise),
44
+ CAPPluginMethod(name: "updateDimensions", returnType: CAPPluginReturnPromise),
44
45
  CAPPluginMethod(name: "getPluginVersion", returnType: CAPPluginReturnPromise)
45
46
  ]
46
47
  var navigationWebViewController: UINavigationController?
@@ -367,6 +368,18 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
367
368
 
368
369
  let credentials = self.readCredentials(call)
369
370
 
371
+ // Read dimension options
372
+ let width = call.getFloat("width")
373
+ let height = call.getFloat("height")
374
+ let x = call.getFloat("x")
375
+ let y = call.getFloat("y")
376
+
377
+ // Validate dimension parameters
378
+ if width != nil && height == nil {
379
+ call.reject("Height must be specified when width is provided")
380
+ return
381
+ }
382
+
370
383
  DispatchQueue.main.async {
371
384
  guard let url = URL(string: urlString) else {
372
385
  call.reject("Invalid URL format")
@@ -390,6 +403,20 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
390
403
  return
391
404
  }
392
405
 
406
+ // Set dimensions if provided
407
+ if let width = width {
408
+ webViewController.customWidth = CGFloat(width)
409
+ }
410
+ if let height = height {
411
+ webViewController.customHeight = CGFloat(height)
412
+ }
413
+ if let x = x {
414
+ webViewController.customX = CGFloat(x)
415
+ }
416
+ if let y = y {
417
+ webViewController.customY = CGFloat(y)
418
+ }
419
+
393
420
  // Set native navigation gestures before view loads
394
421
  webViewController.activeNativeNavigationForWebview = activeNativeNavigationForWebview
395
422
 
@@ -582,7 +609,41 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
582
609
 
583
610
  }
584
611
 
585
- self.navigationWebViewController?.modalPresentationStyle = .overCurrentContext
612
+ // Configure modal presentation for touch passthrough if custom dimensions are set
613
+ if width != nil || height != nil {
614
+ self.navigationWebViewController?.modalPresentationStyle = .overFullScreen
615
+
616
+ // Create a pass-through container
617
+ let containerView = PassThroughView()
618
+ containerView.backgroundColor = .clear
619
+
620
+ // Calculate dimensions - use screen width if only height is provided
621
+ let finalWidth = width != nil ? CGFloat(width!) : UIScreen.main.bounds.width
622
+ let finalHeight = height != nil ? CGFloat(height!) : UIScreen.main.bounds.height
623
+
624
+ containerView.targetFrame = CGRect(
625
+ x: CGFloat(x ?? 0),
626
+ y: CGFloat(y ?? 0),
627
+ width: finalWidth,
628
+ height: finalHeight
629
+ )
630
+
631
+ // Replace the navigation controller's view with our pass-through container
632
+ if let navController = self.navigationWebViewController {
633
+ let originalView = navController.view!
634
+ navController.view = containerView
635
+ containerView.addSubview(originalView)
636
+ originalView.frame = CGRect(
637
+ x: CGFloat(x ?? 0),
638
+ y: CGFloat(y ?? 0),
639
+ width: finalWidth,
640
+ height: finalHeight
641
+ )
642
+ }
643
+ } else {
644
+ self.navigationWebViewController?.modalPresentationStyle = .overCurrentContext
645
+ }
646
+
586
647
  self.navigationWebViewController?.modalTransitionStyle = .crossDissolve
587
648
  if toolbarType == "blank" {
588
649
  self.navigationWebViewController?.navigationBar.isHidden = true
@@ -865,4 +926,27 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
865
926
  call.resolve(["version": self.pluginVersion])
866
927
  }
867
928
 
929
+ @objc func updateDimensions(_ call: CAPPluginCall) {
930
+ let width = call.getFloat("width")
931
+ let height = call.getFloat("height")
932
+ let x = call.getFloat("x")
933
+ let y = call.getFloat("y")
934
+
935
+ DispatchQueue.main.async {
936
+ guard let webViewController = self.webViewController else {
937
+ call.reject("WebView is not initialized")
938
+ return
939
+ }
940
+
941
+ webViewController.updateDimensions(
942
+ width: width != nil ? CGFloat(width!) : nil,
943
+ height: height != nil ? CGFloat(height!) : nil,
944
+ x: x != nil ? CGFloat(x!) : nil,
945
+ y: y != nil ? CGFloat(y!) : nil
946
+ )
947
+
948
+ call.resolve()
949
+ }
950
+ }
951
+
868
952
  }
@@ -145,8 +145,15 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
145
145
  var authorizedAppLinks: [String] = []
146
146
  var activeNativeNavigationForWebview: Bool = true
147
147
 
148
+ // Dimension properties
149
+ var customWidth: CGFloat?
150
+ var customHeight: CGFloat?
151
+ var customX: CGFloat?
152
+ var customY: CGFloat?
153
+
148
154
  internal var preShowSemaphore: DispatchSemaphore?
149
155
  internal var preShowError: String?
156
+ private var isWebViewInitialized = false
150
157
 
151
158
  func setHeaders(headers: [String: String]) {
152
159
  self.headers = headers
@@ -388,6 +395,10 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
388
395
  override open func viewDidDisappear(_ animated: Bool) {
389
396
  super.viewDidDisappear(animated)
390
397
 
398
+ if self.isBeingDismissed || self.isMovingFromParent {
399
+ self.cleanupWebView()
400
+ }
401
+
391
402
  if let capacitorStatusBar = capacitorStatusBar {
392
403
  self.capBrowserPlugin?.bridge?.webView?.superview?.addSubview(capacitorStatusBar)
393
404
  self.capBrowserPlugin?.bridge?.webView?.frame.origin.y = capacitorStatusBar.frame.height
@@ -576,6 +587,10 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
576
587
  }
577
588
 
578
589
  open func initWebview(isInspectable: Bool = true) {
590
+ if self.isWebViewInitialized {
591
+ return
592
+ }
593
+ self.isWebViewInitialized = true
579
594
  self.view.backgroundColor = UIColor.white
580
595
 
581
596
  self.extendedLayoutIncludesOpaqueBars = true
@@ -583,11 +598,13 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
583
598
 
584
599
  let webConfiguration = WKWebViewConfiguration()
585
600
  let userContentController = WKUserContentController()
586
- userContentController.add(self, name: "messageHandler")
587
- userContentController.add(self, name: "preShowScriptError")
588
- userContentController.add(self, name: "preShowScriptSuccess")
589
- userContentController.add(self, name: "close")
590
- userContentController.add(self, name: "magicPrint")
601
+
602
+ let weakHandler = WeakScriptMessageHandler(self)
603
+ userContentController.add(weakHandler, name: "messageHandler")
604
+ userContentController.add(weakHandler, name: "preShowScriptError")
605
+ userContentController.add(weakHandler, name: "preShowScriptSuccess")
606
+ userContentController.add(weakHandler, name: "close")
607
+ userContentController.add(weakHandler, name: "magicPrint")
591
608
 
592
609
  // Inject JavaScript to override window.print
593
610
  let script = WKUserScript(
@@ -782,6 +799,9 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
782
799
  self.setupViewElements()
783
800
  setUpState()
784
801
  self.viewWasPresented = true
802
+
803
+ // Apply custom dimensions if specified
804
+ applyCustomDimensions()
785
805
  }
786
806
 
787
807
  // Force update button appearances
@@ -1898,6 +1918,52 @@ extension WKWebViewController: WKNavigationDelegate {
1898
1918
  decisionHandler(actionPolicy)
1899
1919
  }
1900
1920
  }
1921
+
1922
+ // MARK: - Dimension Management
1923
+
1924
+ /// Apply custom dimensions to the view if specified
1925
+ open func applyCustomDimensions() {
1926
+ guard let navigationController = navigationController else { return }
1927
+
1928
+ // Apply custom dimensions if both width and height are specified
1929
+ if let width = customWidth, let height = customHeight {
1930
+ let x = customX ?? 0
1931
+ let y = customY ?? 0
1932
+
1933
+ // Set the frame for the navigation controller's view
1934
+ navigationController.view.frame = CGRect(x: x, y: y, width: width, height: height)
1935
+ }
1936
+ // If only height is specified, use fullscreen width
1937
+ else if let height = customHeight, customWidth == nil {
1938
+ let x = customX ?? 0
1939
+ let y = customY ?? 0
1940
+ let screenWidth = UIScreen.main.bounds.width
1941
+
1942
+ // Set the frame with fullscreen width and custom height
1943
+ navigationController.view.frame = CGRect(x: x, y: y, width: screenWidth, height: height)
1944
+ }
1945
+ // Otherwise, use default fullscreen behavior (no action needed)
1946
+ }
1947
+
1948
+ /// Update dimensions at runtime
1949
+ open func updateDimensions(width: CGFloat?, height: CGFloat?, x: CGFloat?, y: CGFloat?) {
1950
+ // Update stored dimensions
1951
+ if let width = width {
1952
+ customWidth = width
1953
+ }
1954
+ if let height = height {
1955
+ customHeight = height
1956
+ }
1957
+ if let x = x {
1958
+ customX = x
1959
+ }
1960
+ if let y = y {
1961
+ customY = y
1962
+ }
1963
+
1964
+ // Apply the new dimensions
1965
+ applyCustomDimensions()
1966
+ }
1901
1967
  }
1902
1968
 
1903
1969
  class BlockBarButtonItem: UIBarButtonItem {
@@ -1905,6 +1971,36 @@ class BlockBarButtonItem: UIBarButtonItem {
1905
1971
  var block: ((WKWebViewController) -> Void)?
1906
1972
  }
1907
1973
 
1974
+ /// Custom view that passes touches outside a target frame to the underlying view
1975
+ class PassThroughView: UIView {
1976
+ var targetFrame: CGRect?
1977
+
1978
+ override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
1979
+ // If we have a target frame and the touch is outside it, pass through
1980
+ if let frame = targetFrame {
1981
+ if !frame.contains(point) {
1982
+ return nil // Pass through to underlying views
1983
+ }
1984
+ }
1985
+
1986
+ // Otherwise, handle normally
1987
+ return super.hitTest(point, with: event)
1988
+ }
1989
+ }
1990
+
1908
1991
  extension WKNavigationActionPolicy {
1909
1992
  static let preventDeeplinkActionPolicy = WKNavigationActionPolicy(rawValue: WKNavigationActionPolicy.allow.rawValue + 2)!
1910
1993
  }
1994
+
1995
+ class WeakScriptMessageHandler: NSObject, WKScriptMessageHandler {
1996
+ weak var delegate: WKScriptMessageHandler?
1997
+
1998
+ init(_ delegate: WKScriptMessageHandler) {
1999
+ self.delegate = delegate
2000
+ super.init()
2001
+ }
2002
+
2003
+ func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
2004
+ self.delegate?.userContentController(userContentController, didReceive: message)
2005
+ }
2006
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/inappbrowser",
3
- "version": "7.28.2",
3
+ "version": "7.29.2",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",