@capgo/capacitor-inappbrowser 8.13.5 → 8.14.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.
@@ -290,10 +290,13 @@ enum BrowsingDataStoreSupport {
290
290
  /// Keeps InAppBrowser cookies/storage separate from the Capacitor/Ionic host WKWebView.
291
291
  static let persistentStoreIdentifier = UUID(uuidString: "C4A96F00-1A8B-4650-9E55-1A8B00000650")!
292
292
 
293
- static func websiteDataStore(persistWebViewData: Bool) -> WKWebsiteDataStore {
293
+ static func websiteDataStore(persistWebViewData: Bool, useSharedDataStore: Bool = false) -> WKWebsiteDataStore {
294
294
  guard persistWebViewData else {
295
295
  return .nonPersistent()
296
296
  }
297
+ if useSharedDataStore {
298
+ return .default()
299
+ }
297
300
  return persistentWebsiteDataStore()
298
301
  }
299
302
 
@@ -412,7 +415,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
412
415
  case aware = "AWARE"
413
416
  case fakeVisible = "FAKE_VISIBLE"
414
417
  }
415
- private let pluginVersion: String = "8.13.5"
418
+ private let pluginVersion: String = "8.14.1"
416
419
  public let identifier = "CapgoInAppBrowserPlugin"
417
420
  public let jsName = "CapgoInAppBrowser"
418
421
  public let pluginMethods: [CAPPluginMethod] = [
@@ -1321,6 +1324,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
1321
1324
  let captureConsoleLogs = call.getBool("captureConsoleLogs", false)
1322
1325
  let handleDownloads = call.getBool("handleDownloads", false)
1323
1326
  let persistWebViewData = call.getBool("persistWebViewData", true)
1327
+ let useSharedDataStore = call.getBool("useSharedDataStore", false)
1324
1328
  let invisibilityModeRaw = call.getString("invisibilityMode", "AWARE")
1325
1329
  self.invisibilityMode = InvisibilityMode(rawValue: invisibilityModeRaw.uppercased()) ?? .aware
1326
1330
 
@@ -1479,6 +1483,7 @@ public class CapgoInAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
1479
1483
  webViewController.legacyProxyRequestURLRegexPattern = legacyProxyRequests.urlRegex?.pattern
1480
1484
  webViewController.openBlankTargetInWebView = openBlankTargetInWebView
1481
1485
  webViewController.persistWebViewData = persistWebViewData
1486
+ webViewController.useSharedDataStore = useSharedDataStore
1482
1487
  webViewController.setHeaders(headers: headers)
1483
1488
  if let customUserAgent = call.getString("customUserAgent"), !customUserAgent.isEmpty {
1484
1489
  webViewController.customUserAgent = customUserAgent
@@ -431,6 +431,7 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
431
431
  open var allowScreenshotsFromWebPage = false
432
432
  open var captureConsoleLogs = false
433
433
  open var persistWebViewData = true
434
+ open var useSharedDataStore = false
434
435
  open var handleDownloads = false
435
436
  open var delegate: WKWebViewControllerDelegate?
436
437
  open var bypassedSSLHosts: [String]?
@@ -2047,7 +2048,8 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
2047
2048
 
2048
2049
  let webConfiguration = initialWebConfiguration ?? WKWebViewConfiguration()
2049
2050
  webConfiguration.websiteDataStore = BrowsingDataStoreSupport.websiteDataStore(
2050
- persistWebViewData: persistWebViewData
2051
+ persistWebViewData: persistWebViewData,
2052
+ useSharedDataStore: useSharedDataStore
2051
2053
  )
2052
2054
  let userContentController = webConfiguration.userContentController
2053
2055
  userContentController.removeAllUserScripts()
@@ -2302,6 +2304,7 @@ open class WKWebViewController: UIViewController, WKScriptMessageHandler {
2302
2304
  configuration.userContentController = WKUserContentController()
2303
2305
  self.initialWebConfiguration = configuration
2304
2306
  self.persistWebViewData = parent.persistWebViewData
2307
+ self.useSharedDataStore = parent.useSharedDataStore
2305
2308
  self.enableReloadGesture = parent.enableReloadGesture
2306
2309
  self.disableOverscroll = parent.disableOverscroll
2307
2310
  self.proxyRequests = parent.proxyRequests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-inappbrowser",
3
- "version": "8.13.5",
3
+ "version": "8.14.1",
4
4
  "description": "Capacitor plugin in app browser",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",