@capgo/inappbrowser 6.11.0 → 6.11.1

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,22 @@ 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 ? _webView.getUrl() : "";
554
552
  dismiss();
555
- _options.getCallbacks().closeEvent(_webView.getUrl());
556
- _webView.destroy();
553
+ if (_options != null && _options.getCallbacks() != null) {
554
+ _options.getCallbacks().closeEvent(currentUrl);
555
+ }
557
556
  }
558
557
  }
559
558
  )
560
559
  .setNegativeButton(_options.getCloseModalCancel(), null)
561
560
  .show();
562
561
  } else {
562
+ String currentUrl = _webView != null ? _webView.getUrl() : "";
563
563
  dismiss();
564
- _options.getCallbacks().closeEvent(_webView.getUrl());
565
- _webView.destroy();
564
+ if (_options != null && _options.getCallbacks() != null) {
565
+ _options.getCallbacks().closeEvent(currentUrl);
566
+ }
566
567
  }
567
568
  }
568
569
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/inappbrowser",
3
- "version": "6.11.0",
3
+ "version": "6.11.1",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",