@capgo/capacitor-inappbrowser 8.6.35 → 8.7.0-beta.pr598.346.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.
- package/README.md +127 -1
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/CapgoInAppBrowserPlugin.java +194 -3
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/Options.java +30 -0
- package/android/src/main/java/ee/forgr/capacitor_inappbrowser/WebViewDialog.java +388 -8
- package/dist/docs.json +303 -4
- package/dist/esm/definitions.d.ts +127 -1
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +10 -1
- package/dist/esm/web.js +16 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +16 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +16 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/InAppBrowserPlugin/InAppBrowserPlugin.swift +429 -32
- package/ios/Sources/InAppBrowserPlugin/ProxySchemeHandler.swift +0 -1
- package/ios/Sources/InAppBrowserPlugin/WKWebViewController.swift +59 -30
- package/package.json +1 -1
|
@@ -387,6 +387,7 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
387
387
|
open var allowWebViewJsVisibilityControl = false
|
|
388
388
|
open var allowScreenshotsFromWebPage = false
|
|
389
389
|
open var captureConsoleLogs = false
|
|
390
|
+
open var persistWebViewData = true
|
|
390
391
|
open var handleDownloads = false
|
|
391
392
|
open var delegate: WKWebViewControllerDelegate?
|
|
392
393
|
open var bypassedSSLHosts: [String]?
|
|
@@ -432,6 +433,8 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
432
433
|
var waitsForPopupNavigation = false
|
|
433
434
|
var hiddenPopupWindow = false
|
|
434
435
|
var opensHidden = false
|
|
436
|
+
var isLayeredBehind = false
|
|
437
|
+
var transparentHostBackground = true
|
|
435
438
|
|
|
436
439
|
// Dimension properties
|
|
437
440
|
var customWidth: CGFloat?
|
|
@@ -748,45 +751,67 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
748
751
|
.compactMap { $0 as? UIWindowScene }
|
|
749
752
|
.first { $0.activationState == .foregroundActive }
|
|
750
753
|
?? UIApplication.shared.connectedScenes
|
|
751
|
-
|
|
752
|
-
|
|
754
|
+
.compactMap { $0 as? UIWindowScene }
|
|
755
|
+
.first
|
|
753
756
|
return windowScene?.statusBarManager?.statusBarFrame.height ?? 0
|
|
754
757
|
}
|
|
755
758
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
759
|
+
private func applyNavigationBarBackground(color: UIColor) {
|
|
760
|
+
guard let navigationBar = navigationController?.navigationBar else {
|
|
761
|
+
return
|
|
762
|
+
}
|
|
760
763
|
|
|
761
|
-
|
|
762
|
-
|
|
764
|
+
navigationBar.backgroundColor = color
|
|
765
|
+
navigationBar.barTintColor = color
|
|
766
|
+
navigationBar.isTranslucent = false
|
|
767
|
+
navigationBar.setBackgroundImage(UIImage(), for: .default)
|
|
768
|
+
navigationBar.shadowImage = UIImage()
|
|
769
|
+
navigationBar.setValue(true, forKey: "hidesShadow")
|
|
763
770
|
|
|
764
|
-
if
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
771
|
+
if #available(iOS 13.0, *) {
|
|
772
|
+
let appearance = UINavigationBarAppearance()
|
|
773
|
+
appearance.configureWithOpaqueBackground()
|
|
774
|
+
appearance.backgroundColor = color
|
|
775
|
+
appearance.backgroundEffect = nil
|
|
776
|
+
appearance.shadowColor = .clear
|
|
777
|
+
appearance.shadowImage = UIImage()
|
|
768
778
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
779
|
+
if let titleTextAttributes = navigationBar.titleTextAttributes {
|
|
780
|
+
appearance.titleTextAttributes = titleTextAttributes
|
|
781
|
+
}
|
|
782
|
+
if let largeTitleTextAttributes = navigationBar.largeTitleTextAttributes {
|
|
783
|
+
appearance.largeTitleTextAttributes = largeTitleTextAttributes
|
|
784
|
+
}
|
|
772
785
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
])
|
|
786
|
+
navigationBar.standardAppearance = appearance
|
|
787
|
+
navigationBar.compactAppearance = appearance
|
|
788
|
+
navigationBar.scrollEdgeAppearance = appearance
|
|
789
|
+
navigationBar.compactScrollEdgeAppearance = appearance
|
|
790
|
+
}
|
|
791
|
+
}
|
|
780
792
|
|
|
781
|
-
|
|
782
|
-
|
|
793
|
+
// Make status bar background with colored view underneath
|
|
794
|
+
open func setupStatusBarBackground(color: UIColor) {
|
|
795
|
+
statusBarBackgroundView?.removeFromSuperview()
|
|
796
|
+
statusBarBackgroundView = UIView()
|
|
783
797
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
navigationController?.navigationBar.isTranslucent = true
|
|
798
|
+
guard let navController = navigationController,
|
|
799
|
+
let navView = navController.view,
|
|
800
|
+
let statusBarBackgroundView else {
|
|
801
|
+
return
|
|
789
802
|
}
|
|
803
|
+
navView.insertSubview(statusBarBackgroundView, at: 0)
|
|
804
|
+
statusBarBackgroundView.translatesAutoresizingMaskIntoConstraints = false
|
|
805
|
+
statusBarBackgroundView.backgroundColor = color
|
|
806
|
+
|
|
807
|
+
NSLayoutConstraint.activate([
|
|
808
|
+
statusBarBackgroundView.topAnchor.constraint(equalTo: navView.topAnchor),
|
|
809
|
+
statusBarBackgroundView.leadingAnchor.constraint(equalTo: navView.leadingAnchor),
|
|
810
|
+
statusBarBackgroundView.trailingAnchor.constraint(equalTo: navView.trailingAnchor),
|
|
811
|
+
statusBarBackgroundView.bottomAnchor.constraint(equalTo: navController.navigationBar.bottomAnchor, constant: 1)
|
|
812
|
+
])
|
|
813
|
+
|
|
814
|
+
applyNavigationBarBackground(color: color)
|
|
790
815
|
}
|
|
791
816
|
|
|
792
817
|
// Override to use our custom status bar style
|
|
@@ -1513,6 +1538,9 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
1513
1538
|
self.edgesForExtendedLayout = [.bottom]
|
|
1514
1539
|
|
|
1515
1540
|
let webConfiguration = initialWebConfiguration ?? WKWebViewConfiguration()
|
|
1541
|
+
if !persistWebViewData {
|
|
1542
|
+
webConfiguration.websiteDataStore = .nonPersistent()
|
|
1543
|
+
}
|
|
1516
1544
|
let userContentController = webConfiguration.userContentController
|
|
1517
1545
|
userContentController.removeAllUserScripts()
|
|
1518
1546
|
userContentController.removeScriptMessageHandler(forName: "messageHandler")
|
|
@@ -1763,6 +1791,8 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
|
|
|
1763
1791
|
self.blockedHosts = parent.blockedHosts
|
|
1764
1792
|
self.authorizedAppLinks = parent.authorizedAppLinks
|
|
1765
1793
|
self.activeNativeNavigationForWebview = parent.activeNativeNavigationForWebview
|
|
1794
|
+
self.initialWebConfiguration = configuration
|
|
1795
|
+
self.persistWebViewData = parent.persistWebViewData
|
|
1766
1796
|
self.disableOverscroll = parent.disableOverscroll
|
|
1767
1797
|
self.proxyRequests = parent.proxyRequests
|
|
1768
1798
|
self.proxySchemeHandler = proxySchemeHandler
|
|
@@ -1935,7 +1965,6 @@ public extension WKWebViewController {
|
|
|
1935
1965
|
return false
|
|
1936
1966
|
}
|
|
1937
1967
|
|
|
1938
|
-
|
|
1939
1968
|
func load(source sourceValue: WKWebSource) {
|
|
1940
1969
|
switch sourceValue {
|
|
1941
1970
|
case .remote(let url):
|