@capgo/capacitor-inappbrowser 8.6.34 → 8.6.35

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.
@@ -98,7 +98,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
98
98
  case aware = "AWARE"
99
99
  case fakeVisible = "FAKE_VISIBLE"
100
100
  }
101
- private let pluginVersion: String = "8.6.34"
101
+ private let pluginVersion: String = "8.6.35"
102
102
  public let identifier = "CapgoInAppBrowserPlugin"
103
103
  public let jsName = "CapgoInAppBrowser"
104
104
  public let pluginMethods: [CAPPluginMethod] = [
@@ -138,9 +138,6 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
138
138
  private var proxyBridges: [String: ProxyBridge] = [:]
139
139
  private var webViewStack: [String] = []
140
140
  private var activeWebViewId: String?
141
- private weak var presentationContainerView: UIView?
142
- private var presentationContainerWasInteractive = true
143
- private var presentationContainerPreviousAlpha: CGFloat = 1
144
141
  private var hiddenWebViewContainers: [ObjectIdentifier: UIView] = [:]
145
142
  private var closeModalTitle: String?
146
143
  private var closeModalDescription: String?
@@ -181,6 +178,13 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
181
178
  }
182
179
  }
183
180
 
181
+ private func dismissNavigationControllerIfPresented(_ navigationController: UINavigationController?) {
182
+ guard let navigationController, navigationController.presentingViewController != nil else {
183
+ return
184
+ }
185
+ navigationController.dismiss(animated: false)
186
+ }
187
+
184
188
  private func unregisterWebView(id: String) {
185
189
  if let webView = webViewControllers[id]?.capableWebView {
186
190
  cleanupHiddenWebViewContainer(for: webView)
@@ -1334,24 +1338,11 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
1334
1338
  self.isHidden = hidden
1335
1339
 
1336
1340
  if hidden {
1337
- if let navController = navigationController, navController.presentingViewController != nil {
1338
- navController.view.isHidden = true
1339
- navController.view.isUserInteractionEnabled = false
1340
- if let containerView = navController.view.superview {
1341
- if self.presentationContainerView == nil || self.presentationContainerView !== containerView {
1342
- self.presentationContainerView = containerView
1343
- self.presentationContainerWasInteractive = containerView.isUserInteractionEnabled
1344
- self.presentationContainerPreviousAlpha = containerView.alpha
1345
- }
1346
- containerView.isUserInteractionEnabled = false
1347
- containerView.alpha = 0
1348
- }
1349
- }
1350
-
1351
1341
  if !self.attachWebViewToWindow(webView) {
1352
1342
  call?.reject("Failed to get active window for hidden webview")
1353
1343
  return
1354
1344
  }
1345
+ self.dismissNavigationControllerIfPresented(navigationController)
1355
1346
  } else {
1356
1347
  if webView.superview !== webViewController.view {
1357
1348
  self.attachWebViewToController(webViewController, webView: webView)
@@ -1361,15 +1352,6 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
1361
1352
  if let resolvedId {
1362
1353
  self.setActiveWebView(id: resolvedId, webView: webViewController, navigationController: navController)
1363
1354
  }
1364
- navController.view.isHidden = false
1365
- navController.view.isUserInteractionEnabled = true
1366
- if let containerView = self.presentationContainerView {
1367
- containerView.isUserInteractionEnabled = self.presentationContainerWasInteractive
1368
- containerView.alpha = self.presentationContainerPreviousAlpha
1369
- self.presentationContainerView = nil
1370
- self.presentationContainerWasInteractive = true
1371
- self.presentationContainerPreviousAlpha = 1
1372
- }
1373
1355
 
1374
1356
  if navController.presentingViewController == nil {
1375
1357
  let presenter = self.bridge?.viewController?.presentedViewController ?? self.bridge?.viewController
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-inappbrowser",
3
- "version": "8.6.34",
3
+ "version": "8.6.35",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",