@capgo/inappbrowser 7.26.0 → 7.26.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
@@ -8,6 +8,10 @@
8
8
 
9
9
  Capacitor plugin in app browser with urlChangeEvent, two way communication, camera and microphone usage, etc.
10
10
 
11
+ ## Documentation
12
+
13
+ The most complete doc is available here: https://capgo.app/docs/plugins/inappbrowser/
14
+
11
15
  ## Install
12
16
 
13
17
  ```bash
@@ -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 PLUGIN_VERSION = "7.26.0";
53
+ private final String PLUGIN_VERSION = "7.26.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;
@@ -660,6 +660,7 @@ public class InAppBrowserPlugin extends Plugin implements WebViewDialog.Permissi
660
660
  );
661
661
  webViewDialog.activity = InAppBrowserPlugin.this.getActivity();
662
662
  webViewDialog.presentWebView();
663
+ call.resolve();
663
664
  }
664
665
  }
665
666
  );
@@ -928,22 +928,26 @@ public class WebViewDialog extends Dialog {
928
928
 
929
929
  // Apply system insets to WebView content view (compatible with all Android versions)
930
930
  ViewCompat.setOnApplyWindowInsetsListener(_webView, (v, windowInsets) -> {
931
- Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
931
+ Insets bars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
932
+ Insets ime = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
932
933
  Boolean keyboardVisible = windowInsets.isVisible(WindowInsetsCompat.Type.ime());
933
934
 
934
935
  ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
935
936
 
936
- // // Apply margins based on Android version
937
- if (_options.getEnabledSafeMargin()) {
938
- mlp.bottomMargin = insets.bottom;
939
- } else {
940
- mlp.bottomMargin = 0;
941
- }
937
+ // Apply safe margin inset to bottom margin if enabled in options or fallback to 0px
938
+ int navBottom = _options.getEnabledSafeMargin() ? bars.bottom : 0;
939
+
940
+ // Apply top inset only if useTopInset option is enabled or fallback to 0px
941
+ int navTop = _options.getUseTopInset() ? bars.top : 0;
942
+
943
+ // Avoid double-applying top inset; AppBar/status bar handled above on Android 15+
944
+ mlp.topMargin = isAndroid15Plus ? 0 : navTop;
945
+
946
+ // Apply larger of navigation bar or keyboard inset to bottom margin
947
+ mlp.bottomMargin = Math.max(navBottom, ime.bottom);
942
948
 
943
- // Use system top inset only when explicitly enabled otherwise keep legacy 0px margin
944
- mlp.topMargin = _options.getUseTopInset() ? insets.top : 0;
945
- mlp.leftMargin = insets.left;
946
- mlp.rightMargin = insets.right;
949
+ mlp.leftMargin = bars.left;
950
+ mlp.rightMargin = bars.right;
947
951
  v.setLayoutParams(mlp);
948
952
 
949
953
  return WindowInsetsCompat.CONSUMED;
@@ -24,7 +24,7 @@ extension UIColor {
24
24
  */
25
25
  @objc(InAppBrowserPlugin)
26
26
  public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
27
- private let PLUGIN_VERSION: String = "7.26.0"
27
+ private let PLUGIN_VERSION: String = "7.26.2"
28
28
  public let identifier = "InAppBrowserPlugin"
29
29
  public let jsName = "InAppBrowser"
30
30
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/inappbrowser",
3
- "version": "7.26.0",
3
+ "version": "7.26.2",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",