@capgo/inappbrowser 8.1.5 → 8.1.6

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.
@@ -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 = "8.1.5";
53
+ private final String pluginVersion = "8.1.6";
54
54
 
55
55
  public static final String CUSTOM_TAB_PACKAGE_NAME = "com.android.chrome"; // Change when in stable
56
56
  private CustomTabsClient customTabsClient;
@@ -28,7 +28,7 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
28
28
  case aware = "AWARE"
29
29
  case fakeVisible = "FAKE_VISIBLE"
30
30
  }
31
- private let pluginVersion: String = "8.1.5"
31
+ private let pluginVersion: String = "8.1.6"
32
32
  public let identifier = "InAppBrowserPlugin"
33
33
  public let jsName = "InAppBrowser"
34
34
  public let pluginMethods: [CAPPluginMethod] = [
@@ -57,6 +57,9 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
57
57
  var isHidden = false
58
58
  var invisibilityMode: InvisibilityMode = .aware
59
59
  var webViewController: WKWebViewController?
60
+ private weak var presentationContainerView: UIView?
61
+ private var presentationContainerWasInteractive = true
62
+ private var presentationContainerPreviousAlpha: CGFloat = 1
60
63
  private var closeModalTitle: String?
61
64
  private var closeModalDescription: String?
62
65
  private var closeModalOk: String?
@@ -829,6 +832,15 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
829
832
  if let navController = self.navigationWebViewController, navController.presentingViewController != nil {
830
833
  navController.view.isHidden = true
831
834
  navController.view.isUserInteractionEnabled = false
835
+ if let containerView = navController.view.superview {
836
+ if self.presentationContainerView == nil || self.presentationContainerView !== containerView {
837
+ self.presentationContainerView = containerView
838
+ self.presentationContainerWasInteractive = containerView.isUserInteractionEnabled
839
+ self.presentationContainerPreviousAlpha = containerView.alpha
840
+ }
841
+ containerView.isUserInteractionEnabled = false
842
+ containerView.alpha = 0
843
+ }
832
844
  }
833
845
 
834
846
  if !self.attachWebViewToWindow(webView) {
@@ -843,6 +855,13 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
843
855
  if let navController = self.navigationWebViewController {
844
856
  navController.view.isHidden = false
845
857
  navController.view.isUserInteractionEnabled = true
858
+ if let containerView = self.presentationContainerView {
859
+ containerView.isUserInteractionEnabled = self.presentationContainerWasInteractive
860
+ containerView.alpha = self.presentationContainerPreviousAlpha
861
+ self.presentationContainerView = nil
862
+ self.presentationContainerWasInteractive = true
863
+ self.presentationContainerPreviousAlpha = 1
864
+ }
846
865
 
847
866
  if navController.presentingViewController == nil {
848
867
  self.bridge?.viewController?.present(navController, animated: true, completion: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/inappbrowser",
3
- "version": "8.1.5",
3
+ "version": "8.1.6",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",