@capgo/inappbrowser 7.3.0 → 7.3.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.
@@ -145,13 +145,10 @@ public class WebViewDialog extends Dialog {
145
145
  if (activity != null) {
146
146
  activity.runOnUiThread(() -> {
147
147
  try {
148
+ String currentUrl = _webView != null ? _webView.getUrl() : "";
148
149
  dismiss();
149
- if (_webView != null) {
150
- String currentUrl = _webView.getUrl();
151
- if (_options != null && _options.getCallbacks() != null) {
152
- _options.getCallbacks().closeEvent(currentUrl);
153
- }
154
- _webView.destroy();
150
+ if (_options != null && _options.getCallbacks() != null) {
151
+ _options.getCallbacks().closeEvent(currentUrl);
155
152
  }
156
153
  } catch (Exception e) {
157
154
  Log.e("InAppBrowser", "Error closing WebView: " + e.getMessage());
@@ -551,18 +548,24 @@ public class WebViewDialog extends Dialog {
551
548
  new OnClickListener() {
552
549
  public void onClick(DialogInterface dialog, int which) {
553
550
  // Close button clicked, do something
551
+ String currentUrl = _webView != null
552
+ ? _webView.getUrl()
553
+ : "";
554
554
  dismiss();
555
- _options.getCallbacks().closeEvent(_webView.getUrl());
556
- _webView.destroy();
555
+ if (_options != null && _options.getCallbacks() != null) {
556
+ _options.getCallbacks().closeEvent(currentUrl);
557
+ }
557
558
  }
558
559
  }
559
560
  )
560
561
  .setNegativeButton(_options.getCloseModalCancel(), null)
561
562
  .show();
562
563
  } else {
564
+ String currentUrl = _webView != null ? _webView.getUrl() : "";
563
565
  dismiss();
564
- _options.getCallbacks().closeEvent(_webView.getUrl());
565
- _webView.destroy();
566
+ if (_options != null && _options.getCallbacks() != null) {
567
+ _options.getCallbacks().closeEvent(currentUrl);
568
+ }
566
569
  }
567
570
  }
568
571
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/inappbrowser",
3
- "version": "7.3.0",
3
+ "version": "7.3.2",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",