@dynamic-labs/react-native-extension 4.92.4 → 4.93.0

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.
Files changed (40) hide show
  1. package/android/EmbeddedWebViewController.kt +19 -2
  2. package/android/dynamic/embeddedwebview/EmbeddedWebViewController.kt +19 -2
  3. package/android/embeddedwebview/EmbeddedWebViewController.kt +19 -2
  4. package/android/java/xyz/dynamic/embeddedwebview/EmbeddedWebViewController.kt +19 -2
  5. package/android/main/java/xyz/dynamic/embeddedwebview/EmbeddedWebViewController.kt +19 -2
  6. package/android/src/main/java/xyz/dynamic/embeddedwebview/EmbeddedWebViewController.kt +19 -2
  7. package/android/xyz/dynamic/embeddedwebview/EmbeddedWebViewController.kt +19 -2
  8. package/index.cjs +252 -796
  9. package/index.js +251 -797
  10. package/ios/EmbeddedWebViewController.swift +7 -6
  11. package/package.json +6 -6
  12. package/src/ReactNativeExtension/ReactNativeExtension.d.ts +11 -2
  13. package/src/components/WebView/EmbeddedWebView/EmbeddedWebView.d.ts +6 -19
  14. package/src/components/WebView/WebView.d.ts +17 -6
  15. package/src/errors/WebViewFailedToLoadError.d.ts +1 -86
  16. package/src/components/WebView/EmbeddedWebView/embeddedWebViewPhaseTimers/embeddedWebViewPhaseTimers.d.ts +0 -66
  17. package/src/components/WebView/EmbeddedWebView/embeddedWebViewPhaseTimers/index.d.ts +0 -1
  18. package/src/components/WebView/constants.d.ts +0 -3
  19. package/src/components/WebView/successLog/emitSuccessLog.d.ts +0 -35
  20. package/src/components/WebView/successLog/index.d.ts +0 -3
  21. package/src/components/WebView/useWebViewLoadingTimeout/index.d.ts +0 -1
  22. package/src/components/WebView/useWebViewLoadingTimeout/useWebViewLoadingTimeout.d.ts +0 -4
  23. package/src/components/WebView/useWebViewPhaseTimers/index.d.ts +0 -1
  24. package/src/components/WebView/useWebViewPhaseTimers/useWebViewPhaseTimers.d.ts +0 -46
  25. package/src/components/WebView/useWebViewRecoveryTimeout/index.d.ts +0 -1
  26. package/src/components/WebView/useWebViewRecoveryTimeout/useWebViewRecoveryTimeout.d.ts +0 -12
  27. package/src/components/WebView/useWebViewSuccessLog/index.d.ts +0 -1
  28. package/src/components/WebView/useWebViewSuccessLog/useWebViewSuccessLog.d.ts +0 -28
  29. package/src/components/WebView/utils/assignEnvironmentIdToUrl/assignEnvironmentIdToUrl.d.ts +0 -1
  30. package/src/components/WebView/utils/assignEnvironmentIdToUrl/index.d.ts +0 -1
  31. package/src/components/WebView/utils/assignStartTimeToUrl/assignStartTimeToUrl.d.ts +0 -1
  32. package/src/components/WebView/utils/assignStartTimeToUrl/index.d.ts +0 -1
  33. package/src/components/WebView/utils/hasClearStateInUrl/hasClearStateInUrl.d.ts +0 -1
  34. package/src/components/WebView/utils/hasClearStateInUrl/index.d.ts +0 -1
  35. package/src/components/WebView/utils/increaseRetryToUrl/increaseRetryToUrl.d.ts +0 -1
  36. package/src/components/WebView/utils/increaseRetryToUrl/index.d.ts +0 -1
  37. package/src/components/WebView/utils/setClearStateToUrl/index.d.ts +0 -1
  38. package/src/components/WebView/utils/setClearStateToUrl/setClearStateToUrl.d.ts +0 -1
  39. package/src/components/WebView/webViewPhaseTimerCore/index.d.ts +0 -2
  40. package/src/components/WebView/webViewPhaseTimerCore/webViewPhaseTimerCore.d.ts +0 -123
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).
@@ -113,7 +113,24 @@ object EmbeddedWebViewController {
113
113
  )
114
114
  return@runOnMain
115
115
  }
116
- val webView = ensureWebView() ?: return@runOnMain
116
+ val webView = ensureWebView()
117
+ if (webView == null) {
118
+ // ensureWebView() needs appContext.currentActivity to host the
119
+ // overlay; during early startup or backgrounding there may be none
120
+ // yet. Surface the failure instead of silently dropping the load —
121
+ // the JS retry engine treats this domain as transient and retries,
122
+ // by which point an activity usually exists.
123
+ emitLoadError(
124
+ url = url,
125
+ code = 0,
126
+ // The event-domain constant trips FireHog's generic high-entropy
127
+ // string detector; it is a public event name, not a secret.
128
+ domain = "EmbeddedWebViewNoActivity", // firehog:ignore
129
+ description = "No current activity available to host the embedded webview",
130
+ isProvisional = true,
131
+ )
132
+ return@runOnMain
133
+ }
117
134
  // Pre-approve the origin so the first `shouldOverrideUrlLoading` call
118
135
  // can skip the JS round-trip. On cold boot the JS thread may be too
119
136
  // congested to respond within the navigation-decision timeout, silently
@@ -370,7 +387,7 @@ object EmbeddedWebViewController {
370
387
  pendingNavigationUrls[id] = url
371
388
 
372
389
  val timeout = Runnable {
373
- // 2 s default-cancel: drop the stashed URL and surface as a load
390
+ // Default-cancel on timeout: drop the stashed URL and surface as a load
374
391
  // error so JS sees the timeout (matches iOS's cancellation semantics
375
392
  // but adds an explicit signal — iOS gets WebKitErrorDomain 102, which
376
393
  // is filtered out, so neither side emits a network error).