expo-web-browser 15.0.11-canary-20251205-a1dedc6 → 15.0.11-canary-20251210-1f163e3
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/CHANGELOG.md +3 -1
- package/android/build.gradle +2 -2
- package/android/src/main/AndroidManifest.xml +9 -0
- package/android/src/main/java/expo/modules/webbrowser/BrowserProxyActivity.kt +94 -0
- package/android/src/main/java/expo/modules/webbrowser/CustomTabsActivitiesHelper.kt +35 -7
- package/android/src/main/java/expo/modules/webbrowser/WebBrowserModule.kt +6 -19
- package/android/src/main/java/expo/modules/webbrowser/WebBrowserOptions.kt +9 -8
- package/android/src/main/java/expo/modules/webbrowser/WebBrowserPackage.kt +25 -0
- package/build/WebBrowser.types.d.ts +14 -0
- package/build/WebBrowser.types.d.ts.map +1 -1
- package/build/WebBrowser.types.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/{15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.module → 15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.module} +22 -22
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/{15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.pom → 15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251210-1f163e3/expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/WebBrowser.types.ts +14 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6-sources.jar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6-sources.jar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6-sources.jar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6-sources.jar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6-sources.jar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.aar +0 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.aar.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.aar.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.aar.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.aar.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/15.0.11-canary-20251205-a1dedc6/expo.modules.webbrowser-15.0.11-canary-20251205-a1dedc6.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
### 🐛 Bug fixes
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- [Android] Fix the browser closing after the app is backgrounded by adding a new option to use a proxy activity to launch custom tabs. ([#41457](https://github.com/expo/expo/pull/41457) by [@lukmccall](https://github.com/lukmccall))
|
|
12
|
+
|
|
13
|
+
### 💡 Others
|
|
12
14
|
|
|
13
15
|
## 15.0.10 - 2025-12-05
|
|
14
16
|
|
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '15.0.11-canary-
|
|
7
|
+
version = '15.0.11-canary-20251210-1f163e3'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.webbrowser"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 18
|
|
13
|
-
versionName '15.0.11-canary-
|
|
13
|
+
versionName '15.0.11-canary-20251210-1f163e3'
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -5,4 +5,13 @@
|
|
|
5
5
|
<action android:name="android.support.customtabs.action.CustomTabsService" />
|
|
6
6
|
</intent>
|
|
7
7
|
</queries>
|
|
8
|
+
|
|
9
|
+
<application>
|
|
10
|
+
<activity
|
|
11
|
+
android:name=".BrowserProxyActivity"
|
|
12
|
+
android:taskAffinity=".webContainer"
|
|
13
|
+
android:launchMode="singleTop"
|
|
14
|
+
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
15
|
+
android:exported="false"/>
|
|
16
|
+
</application>
|
|
8
17
|
</manifest>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
package expo.modules.webbrowser
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import android.os.Build
|
|
6
|
+
import android.os.Bundle
|
|
7
|
+
import androidx.browser.customtabs.CustomTabsIntent
|
|
8
|
+
import androidx.core.net.toUri
|
|
9
|
+
import java.lang.ref.WeakReference
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Trampoline Activity that serves as a proxy to launch Custom Tabs in a separate task.
|
|
13
|
+
*/
|
|
14
|
+
class BrowserProxyActivity : Activity() {
|
|
15
|
+
companion object {
|
|
16
|
+
const val EXTRA_URL = "expo.modules.webbrowser.EXTRA_URL"
|
|
17
|
+
const val EXTRA_CUSTOM_TABS_INTENT_DATA = "expo.modules.webbrowser.EXTRA_CUSTOM_TABS_INTENT_DATA"
|
|
18
|
+
|
|
19
|
+
var instance: WeakReference<BrowserProxyActivity> = WeakReference(null)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
private var hasLaunchedCustomTab = false
|
|
23
|
+
private var wasPaused = false
|
|
24
|
+
|
|
25
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
26
|
+
super.onCreate(savedInstanceState)
|
|
27
|
+
|
|
28
|
+
if (savedInstanceState != null) {
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
val url = intent.getStringExtra(EXTRA_URL)
|
|
33
|
+
val customTabsIntentData: Intent? = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
|
34
|
+
intent.getParcelableExtra(EXTRA_CUSTOM_TABS_INTENT_DATA, Intent::class.java)
|
|
35
|
+
} else {
|
|
36
|
+
@Suppress("DEPRECATION")
|
|
37
|
+
intent.getParcelableExtra(EXTRA_CUSTOM_TABS_INTENT_DATA)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (url == null || customTabsIntentData == null) {
|
|
41
|
+
finish()
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
val customTabsIntent = CustomTabsIntent.Builder().build()
|
|
46
|
+
|
|
47
|
+
customTabsIntentData.extras?.let { customTabsIntent.intent.putExtras(it) }
|
|
48
|
+
customTabsIntentData.`package`?.let { customTabsIntent.intent.`package` = it }
|
|
49
|
+
|
|
50
|
+
customTabsIntent.launchUrl(this, url.toUri())
|
|
51
|
+
|
|
52
|
+
instance = WeakReference(this)
|
|
53
|
+
hasLaunchedCustomTab = true
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
override fun onResume() {
|
|
57
|
+
super.onResume()
|
|
58
|
+
|
|
59
|
+
// Only finish if we've been paused before (meaning the custom tab was shown and is now dismissed)
|
|
60
|
+
// The first onResume happens right after onCreate before the custom tab shows up,
|
|
61
|
+
// so we ignore that one
|
|
62
|
+
if (hasLaunchedCustomTab && wasPaused) {
|
|
63
|
+
returnToMainApp()
|
|
64
|
+
finish()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
override fun onPause() {
|
|
69
|
+
super.onPause()
|
|
70
|
+
wasPaused = true
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private fun returnToMainApp() {
|
|
74
|
+
val packageManager = packageManager
|
|
75
|
+
val launchIntent = packageManager.getLaunchIntentForPackage(packageName)
|
|
76
|
+
|
|
77
|
+
if (launchIntent != null) {
|
|
78
|
+
launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
|
79
|
+
startActivity(launchIntent)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
override fun onSaveInstanceState(outState: Bundle) {
|
|
84
|
+
super.onSaveInstanceState(outState)
|
|
85
|
+
outState.putBoolean("hasLaunchedCustomTab", hasLaunchedCustomTab)
|
|
86
|
+
outState.putBoolean("wasPaused", wasPaused)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
|
90
|
+
super.onRestoreInstanceState(savedInstanceState)
|
|
91
|
+
hasLaunchedCustomTab = savedInstanceState.getBoolean("hasLaunchedCustomTab", false)
|
|
92
|
+
wasPaused = savedInstanceState.getBoolean("wasPaused", false)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -68,15 +68,43 @@ internal class CustomTabsActivitiesHelper(
|
|
|
68
68
|
/**
|
|
69
69
|
* @throws CurrentActivityNotFoundException
|
|
70
70
|
*/
|
|
71
|
-
fun startCustomTabs(tabsIntent: CustomTabsIntent) {
|
|
72
|
-
tabsIntent.intent.data
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
fun startCustomTabs(tabsIntent: CustomTabsIntent, options: OpenBrowserOptions) {
|
|
72
|
+
val url = tabsIntent.intent.data ?: throw NoUrlProvidedException()
|
|
73
|
+
|
|
74
|
+
if (!options.shouldCreateTask) {
|
|
75
|
+
tabsIntent.launchUrl(currentActivity, url)
|
|
76
|
+
return
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Use the proxy activity only when creating a new task AND useProxyActivity is enabled
|
|
80
|
+
// This prevents the Custom Tab from being destroyed when the main activity
|
|
81
|
+
// has singleTask launch mode
|
|
82
|
+
if (options.useProxyActivity) {
|
|
83
|
+
val proxyIntent = Intent(currentActivity, BrowserProxyActivity::class.java).apply {
|
|
84
|
+
putExtra(BrowserProxyActivity.EXTRA_URL, url.toString())
|
|
85
|
+
putExtra(BrowserProxyActivity.EXTRA_CUSTOM_TABS_INTENT_DATA, tabsIntent.intent)
|
|
86
|
+
|
|
87
|
+
// The proxy activity will be in a different task due to its taskAffinity
|
|
88
|
+
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
currentActivity.startActivity(proxyIntent)
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Launcher Custom Tab without proxy activity
|
|
96
|
+
tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
97
|
+
if (!options.showInRecents) {
|
|
98
|
+
tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
|
99
|
+
tabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
tabsIntent.launchUrl(currentActivity, url)
|
|
75
103
|
}
|
|
76
104
|
|
|
77
|
-
|
|
105
|
+
// endregion
|
|
78
106
|
|
|
79
|
-
|
|
107
|
+
// region Private helpers
|
|
80
108
|
|
|
81
109
|
/**
|
|
82
110
|
* @throws CurrentActivityNotFoundException
|
|
@@ -99,7 +127,7 @@ internal class CustomTabsActivitiesHelper(
|
|
|
99
127
|
private val currentActivity: Activity
|
|
100
128
|
get() = appContext.throwingActivity
|
|
101
129
|
|
|
102
|
-
|
|
130
|
+
// endregion
|
|
103
131
|
}
|
|
104
132
|
|
|
105
133
|
private inline fun <T, R> Collection<T>.mapToDistinctArrayList(mapper: (T) -> R): ArrayList<R> {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
package expo.modules.webbrowser
|
|
2
2
|
|
|
3
3
|
import expo.modules.core.errors.CurrentActivityNotFoundException
|
|
4
|
-
import android.content.Intent
|
|
5
|
-
import android.net.Uri
|
|
6
4
|
import android.os.Bundle
|
|
7
5
|
import android.text.TextUtils
|
|
8
6
|
import androidx.browser.customtabs.CustomTabColorSchemeParams
|
|
@@ -60,7 +58,7 @@ class WebBrowserModule : Module() {
|
|
|
60
58
|
|
|
61
59
|
AsyncFunction("mayInitWithUrlAsync") { url: String, packageName: String? ->
|
|
62
60
|
val resolvedPackageName = givenOrPreferredPackageName(packageName)
|
|
63
|
-
connectionHelper.mayInitWithUrl(resolvedPackageName,
|
|
61
|
+
connectionHelper.mayInitWithUrl(resolvedPackageName, url.toUri())
|
|
64
62
|
return@AsyncFunction bundleOf(
|
|
65
63
|
SERVICE_PACKAGE_KEY to resolvedPackageName
|
|
66
64
|
)
|
|
@@ -94,7 +92,7 @@ class WebBrowserModule : Module() {
|
|
|
94
92
|
throw NoMatchingActivityException()
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
customTabsResolver.startCustomTabs(tabsIntent)
|
|
95
|
+
customTabsResolver.startCustomTabs(tabsIntent, options)
|
|
98
96
|
|
|
99
97
|
return@AsyncFunction bundleOf(
|
|
100
98
|
"type" to "opened"
|
|
@@ -131,24 +129,13 @@ class WebBrowserModule : Module() {
|
|
|
131
129
|
builder.setShareState(CustomTabsIntent.SHARE_STATE_ON)
|
|
132
130
|
}
|
|
133
131
|
|
|
134
|
-
|
|
135
|
-
// We cannot use the builder's method enableUrlBarHiding, because there is
|
|
136
|
-
// no corresponding disable method and some browsers enable it by default.
|
|
137
|
-
intent.putExtra(CustomTabsIntent.EXTRA_ENABLE_URLBAR_HIDING, options.enableBarCollapsing)
|
|
132
|
+
builder.setUrlBarHidingEnabled(options.enableBarCollapsing)
|
|
138
133
|
|
|
134
|
+
return builder.build().apply {
|
|
139
135
|
val packageName = options.browserPackage
|
|
140
136
|
if (!TextUtils.isEmpty(packageName)) {
|
|
141
137
|
intent.setPackage(packageName)
|
|
142
138
|
}
|
|
143
|
-
|
|
144
|
-
if (options.shouldCreateTask) {
|
|
145
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
|
146
|
-
|
|
147
|
-
if (!options.showInRecents) {
|
|
148
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
|
|
149
|
-
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY)
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
139
|
}
|
|
153
140
|
}
|
|
154
141
|
|
|
@@ -160,9 +147,9 @@ class WebBrowserModule : Module() {
|
|
|
160
147
|
packageName?.takeIf { it.isNotEmpty() }.ifNull {
|
|
161
148
|
customTabsResolver.getPreferredCustomTabsResolvingActivity(null)
|
|
162
149
|
}
|
|
163
|
-
} catch (
|
|
150
|
+
} catch (_: CurrentActivityNotFoundException) {
|
|
164
151
|
throw NoPreferredPackageFound()
|
|
165
|
-
} catch (
|
|
152
|
+
} catch (_: PackageManagerNotFoundException) {
|
|
166
153
|
throw NoPreferredPackageFound()
|
|
167
154
|
}
|
|
168
155
|
|
|
@@ -4,12 +4,13 @@ import expo.modules.kotlin.records.Field
|
|
|
4
4
|
import expo.modules.kotlin.records.Record
|
|
5
5
|
|
|
6
6
|
internal data class OpenBrowserOptions(
|
|
7
|
-
@Field
|
|
8
|
-
@Field
|
|
9
|
-
@Field
|
|
10
|
-
@Field
|
|
11
|
-
@Field
|
|
12
|
-
@Field
|
|
13
|
-
@Field
|
|
14
|
-
@Field(key = "createTask")
|
|
7
|
+
@Field val toolbarColor: Int? = null,
|
|
8
|
+
@Field val secondaryToolbarColor: Int? = null,
|
|
9
|
+
@Field val browserPackage: String? = null,
|
|
10
|
+
@Field val showTitle: Boolean = false,
|
|
11
|
+
@Field val enableDefaultShareMenuItem: Boolean = false,
|
|
12
|
+
@Field val enableBarCollapsing: Boolean = false,
|
|
13
|
+
@Field val showInRecents: Boolean = false,
|
|
14
|
+
@Field(key = "createTask") val shouldCreateTask: Boolean = true,
|
|
15
|
+
@Field val useProxyActivity: Boolean = true
|
|
15
16
|
) : Record
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
package expo.modules.webbrowser
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import expo.modules.core.interfaces.Package
|
|
6
|
+
import expo.modules.core.interfaces.ReactActivityLifecycleListener
|
|
7
|
+
|
|
8
|
+
class WebBrowserPackage : Package {
|
|
9
|
+
override fun createReactActivityLifecycleListeners(activityContext: Context?): List<ReactActivityLifecycleListener?> {
|
|
10
|
+
return listOf(
|
|
11
|
+
object : ReactActivityLifecycleListener {
|
|
12
|
+
override fun onNewIntent(intent: Intent): Boolean {
|
|
13
|
+
if (intent.action == "android.intent.action.VIEW") {
|
|
14
|
+
val browserProxy = BrowserProxyActivity.instance.get()
|
|
15
|
+
if (browserProxy?.isFinishing == false) {
|
|
16
|
+
browserProxy.finishAndRemoveTask()
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -46,6 +46,20 @@ export type WebBrowserOpenOptions = {
|
|
|
46
46
|
* @platform android
|
|
47
47
|
*/
|
|
48
48
|
createTask?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* A boolean determining whether to use a proxy activity to launch the browser.
|
|
51
|
+
* It's available only when `createTask` is `true`. Otherwise, it'll be ignored.
|
|
52
|
+
* When `true`, browser will be launched through a
|
|
53
|
+
* transparent proxy activity with a different task affinity. This prevents browser
|
|
54
|
+
* from being destroyed when the app is backgrounded.
|
|
55
|
+
* When `true`, `showInRecents` is always treated as `true`.
|
|
56
|
+
*
|
|
57
|
+
* Set to `false` to use the legacy direct launch behavior.
|
|
58
|
+
*
|
|
59
|
+
* @default true
|
|
60
|
+
* @platform android
|
|
61
|
+
*/
|
|
62
|
+
useProxyActivity?: boolean;
|
|
49
63
|
/**
|
|
50
64
|
* Tint color for controls in SKSafariViewController. Supports React Native [color formats](https://reactnative.dev/docs/colors).
|
|
51
65
|
* @platform ios
|
|
@@ -1 +1 @@
|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M,8BAA8B,GAAG,mBAAmB,CAAC;AACjE,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACzD,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAG3D,MAAM,MAAM,oCAAoC,GAAG;IACjD;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAGF,MAAM,MAAM,mCAAmC,GAAG;IAChD;;OAEG;IACH,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebBrowser.types.js","sourceRoot":"","sources":["../src/WebBrowser.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WebBrowser.types.js","sourceRoot":"","sources":["../src/WebBrowser.types.ts"],"names":[],"mappings":"AAkJA,2BAA2B;AAC3B,MAAM,CAAN,IAAY,oBAcX;AAdD,WAAY,oBAAoB;IAC9B;;OAEG;IACH,yCAAiB,CAAA;IACjB;;OAEG;IACH,2CAAmB,CAAA;IACnB;;OAEG;IACH,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EAdW,oBAAoB,KAApB,oBAAoB,QAc/B;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAN,IAAY,2BAoCX;AApCD,WAAY,2BAA2B;IACrC;;OAEG;IACH,yDAA0B,CAAA;IAC1B;;OAEG;IACH,uDAAwB,CAAA;IACxB;;OAEG;IACH,uDAAwB,CAAA;IACxB;;OAEG;IACH,iEAAkC,CAAA;IAClC;;OAEG;IACH,kEAAmC,CAAA;IACnC;;OAEG;IACH,0EAA2C,CAAA;IAC3C;;OAEG;IACH,kDAAmB,CAAA;IACnB;;;;;OAKG;IACH,sDAAuB,CAAA;AACzB,CAAC,EApCW,2BAA2B,KAA3B,2BAA2B,QAoCtC","sourcesContent":["export type RedirectEvent = {\n url: string;\n};\n\n// @needsAudit @docsMissing\nexport type WebBrowserWindowFeatures = Record<string, number | boolean | string>;\n\n// @needsAudit\nexport type WebBrowserOpenOptions = {\n /**\n * Color of the toolbar. Supports React Native [color formats](https://reactnative.dev/docs/colors).\n */\n toolbarColor?: string;\n /**\n * Package name of a browser to be used to handle Custom Tabs. List of\n * available packages is to be queried by [`getCustomTabsSupportingBrowsers`](#webbrowsergetcustomtabssupportingbrowsersasync) method.\n * @platform android\n */\n browserPackage?: string;\n /**\n * A boolean determining whether the toolbar should be hiding when a user scrolls the website.\n */\n enableBarCollapsing?: boolean;\n /**\n * Color of the secondary toolbar. Supports React Native [color formats](https://reactnative.dev/docs/colors).\n * @platform android\n */\n secondaryToolbarColor?: string;\n /**\n * A boolean determining whether the browser should show the title of website on the toolbar.\n * @platform android\n */\n showTitle?: boolean;\n /**\n * A boolean determining whether a default share item should be added to the menu.\n * @platform android\n */\n enableDefaultShareMenuItem?: boolean;\n /**\n * A boolean determining whether browsed website should be shown as separate\n * entry in Android recents/multitasking view. Requires `createTask` to be `true` (default).\n * @default false\n * @platform android\n */\n showInRecents?: boolean;\n /**\n * A boolean determining whether the browser should open in a new task or in\n * the same task as your app.\n * @default true\n * @platform android\n */\n createTask?: boolean;\n /**\n * A boolean determining whether to use a proxy activity to launch the browser.\n * It's available only when `createTask` is `true`. Otherwise, it'll be ignored.\n * When `true`, browser will be launched through a\n * transparent proxy activity with a different task affinity. This prevents browser\n * from being destroyed when the app is backgrounded.\n * When `true`, `showInRecents` is always treated as `true`.\n *\n * Set to `false` to use the legacy direct launch behavior.\n *\n * @default true\n * @platform android\n */\n useProxyActivity?: boolean;\n /**\n * Tint color for controls in SKSafariViewController. Supports React Native [color formats](https://reactnative.dev/docs/colors).\n * @platform ios\n */\n controlsColor?: string;\n /**\n * The style of the dismiss button. Should be one of: `done`, `close`, or `cancel`.\n * @platform ios\n */\n dismissButtonStyle?: 'done' | 'close' | 'cancel';\n /**\n * A boolean determining whether Safari should enter Reader mode, if it is available.\n * @platform ios\n */\n readerMode?: boolean;\n /**\n * The [presentation style](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621355-modalpresentationstyle)\n * of the browser window.\n * @default WebBrowser.WebBrowserPresentationStyle.OverFullScreen\n * @platform ios\n */\n presentationStyle?: WebBrowserPresentationStyle;\n /**\n * Name to assign to the popup window.\n * @platform web\n */\n windowName?: string;\n /**\n * Features to use with `window.open()`.\n * @platform web\n */\n windowFeatures?: string | WebBrowserWindowFeatures;\n};\n\n/**\n * If there is no native AuthSession implementation available (which is the case on Android) the params inherited from\n * [`WebBrowserOpenOptions`](#webbrowseropenoptions) will be used in the browser polyfill. Otherwise, the browser parameters will be ignored.\n */\nexport type AuthSessionOpenOptions = WebBrowserOpenOptions & {\n /**\n * Determines whether the session should ask the browser for a private authentication session.\n * Set this to `true` to request that the browser doesn’t share cookies or other browsing data between the authentication session and the user’s normal browser session.\n * Whether the request is honored depends on the user’s default web browser.\n *\n * @default false\n * @platform ios\n */\n preferEphemeralSession?: boolean;\n};\n\nexport type WebBrowserAuthSessionResult = WebBrowserRedirectResult | WebBrowserResult;\n\n// @needsAudit\nexport type WebBrowserCustomTabsResults = {\n /**\n * Default package chosen by user, `null` if there is no such packages. Also `null` usually means,\n * that user will be prompted to choose from available packages.\n */\n defaultBrowserPackage?: string;\n /**\n * Package preferred by `CustomTabsClient` to be used to handle Custom Tabs. It favors browser\n * chosen by user as default, as long as it is present on both `browserPackages` and\n * `servicePackages` lists. Only such browsers are considered as fully supporting Custom Tabs.\n * It might be `null` when there is no such browser installed or when default browser is not in\n * `servicePackages` list.\n */\n preferredBrowserPackage?: string;\n /**\n * All packages recognized by `PackageManager` as capable of handling Custom Tabs. Empty array\n * means there is no supporting browsers on device.\n */\n browserPackages: string[];\n /**\n * All packages recognized by `PackageManager` as capable of handling Custom Tabs Service.\n * This service is used by [`warmUpAsync`](#webbrowserwarmupasyncbrowserpackage), [`mayInitWithUrlAsync`](#webbrowsermayinitwithurlasyncurl-browserpackage)\n * and [`coolDownAsync`](#webbrowsercooldownasyncbrowserpackage).\n */\n servicePackages: string[];\n};\n\n// @needsAudit @docsMissing\nexport enum WebBrowserResultType {\n /**\n * @platform ios\n */\n CANCEL = 'cancel',\n /**\n * @platform ios\n */\n DISMISS = 'dismiss',\n /**\n * @platform android\n */\n OPENED = 'opened',\n LOCKED = 'locked',\n}\n\n// @needsAudit\n/**\n * A browser presentation style. Its values are directly mapped to the [`UIModalPresentationStyle`](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621355-modalpresentationstyle).\n *\n * @platform ios\n */\nexport enum WebBrowserPresentationStyle {\n /**\n * A presentation style in which the presented browser covers the screen.\n */\n FULL_SCREEN = 'fullScreen',\n /**\n * A presentation style that partially covers the underlying content.\n */\n PAGE_SHEET = 'pageSheet',\n /**\n * A presentation style that displays the browser centered in the screen.\n */\n FORM_SHEET = 'formSheet',\n /**\n * A presentation style where the browser is displayed over the app's content.\n */\n CURRENT_CONTEXT = 'currentContext',\n /**\n * A presentation style in which the browser view covers the screen.\n */\n OVER_FULL_SCREEN = 'overFullScreen',\n /**\n * A presentation style where the browser is displayed over the app's content.\n */\n OVER_CURRENT_CONTEXT = 'overCurrentContext',\n /**\n * A presentation style where the browser is displayed in a popover view.\n */\n POPOVER = 'popover',\n /**\n * The default presentation style chosen by the system.\n * On older iOS versions, falls back to `WebBrowserPresentationStyle.FullScreen`.\n *\n * @platform ios\n */\n AUTOMATIC = 'automatic',\n}\n\n// @needsAudit\nexport type WebBrowserResult = {\n /**\n * Type of the result.\n */\n type: WebBrowserResultType;\n};\n\n// @needsAudit @docsMissing\nexport type WebBrowserRedirectResult = {\n /**\n * Type of the result.\n */\n type: 'success';\n url: string;\n};\n\nexport type ServiceActionResult = {\n servicePackage?: string;\n};\n\nexport type WebBrowserMayInitWithUrlResult = ServiceActionResult;\nexport type WebBrowserWarmUpResult = ServiceActionResult;\nexport type WebBrowserCoolDownResult = ServiceActionResult;\n\n// @needsAudit\nexport type WebBrowserCompleteAuthSessionOptions = {\n /**\n * Attempt to close the window without checking to see if the auth redirect matches the cached redirect URL.\n */\n skipRedirectCheck?: boolean;\n};\n\n// @needsAudit\nexport type WebBrowserCompleteAuthSessionResult = {\n /**\n * Type of the result.\n */\n type: 'success' | 'failed';\n /**\n * Additional description or reasoning of the result.\n */\n message: string;\n};\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
06ea97a70a42e4b159cfbd5bd356e987
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
9cc9f35c2b5a4d0ac7ecb1bf82da9708769c85c7
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a8f81a06ac9192351958fded7442498bb32dd54eea11e31046c909bc7230ec03
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
076da63f70370cb210d0ce7fd9144f1706f75f9023e46d085c8aae046179aea53884cb0029d7a46b305a91594d4f7e0b2de49da36f94b6a6354388bc9c25f3c2
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e401c84c5618498af1bb6468424fa1e9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
980f96fcff3e3f938b55997464db6e083a549e71
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
58b8e61082aedada6f2a6f2fd5c4db4f2fb55c1a501277c6e78a443d67e1ce7e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aca79a51b71120142b71d86145b797ac9f79cabcb828363d6360033352ad5bd7d9b059aca87d926134c26cf2216fc1dd1c6d40a2665d64c2ab4fefb55f23aa82
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.webbrowser",
|
|
6
|
-
"version": "15.0.11-canary-
|
|
6
|
+
"version": "15.0.11-canary-20251210-1f163e3",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.webbrowser-15.0.11-canary-
|
|
28
|
-
"url": "expo.modules.webbrowser-15.0.11-canary-
|
|
29
|
-
"size":
|
|
30
|
-
"sha512": "
|
|
31
|
-
"sha256": "
|
|
32
|
-
"sha1": "
|
|
33
|
-
"md5": "
|
|
27
|
+
"name": "expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar",
|
|
28
|
+
"url": "expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar",
|
|
29
|
+
"size": 47915,
|
|
30
|
+
"sha512": "aca79a51b71120142b71d86145b797ac9f79cabcb828363d6360033352ad5bd7d9b059aca87d926134c26cf2216fc1dd1c6d40a2665d64c2ab4fefb55f23aa82",
|
|
31
|
+
"sha256": "58b8e61082aedada6f2a6f2fd5c4db4f2fb55c1a501277c6e78a443d67e1ce7e",
|
|
32
|
+
"sha1": "980f96fcff3e3f938b55997464db6e083a549e71",
|
|
33
|
+
"md5": "e401c84c5618498af1bb6468424fa1e9"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
},
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
],
|
|
68
68
|
"files": [
|
|
69
69
|
{
|
|
70
|
-
"name": "expo.modules.webbrowser-15.0.11-canary-
|
|
71
|
-
"url": "expo.modules.webbrowser-15.0.11-canary-
|
|
72
|
-
"size":
|
|
73
|
-
"sha512": "
|
|
74
|
-
"sha256": "
|
|
75
|
-
"sha1": "
|
|
76
|
-
"md5": "
|
|
70
|
+
"name": "expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar",
|
|
71
|
+
"url": "expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3.aar",
|
|
72
|
+
"size": 47915,
|
|
73
|
+
"sha512": "aca79a51b71120142b71d86145b797ac9f79cabcb828363d6360033352ad5bd7d9b059aca87d926134c26cf2216fc1dd1c6d40a2665d64c2ab4fefb55f23aa82",
|
|
74
|
+
"sha256": "58b8e61082aedada6f2a6f2fd5c4db4f2fb55c1a501277c6e78a443d67e1ce7e",
|
|
75
|
+
"sha1": "980f96fcff3e3f938b55997464db6e083a549e71",
|
|
76
|
+
"md5": "e401c84c5618498af1bb6468424fa1e9"
|
|
77
77
|
}
|
|
78
78
|
]
|
|
79
79
|
},
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
},
|
|
88
88
|
"files": [
|
|
89
89
|
{
|
|
90
|
-
"name": "expo.modules.webbrowser-15.0.11-canary-
|
|
91
|
-
"url": "expo.modules.webbrowser-15.0.11-canary-
|
|
92
|
-
"size":
|
|
93
|
-
"sha512": "
|
|
94
|
-
"sha256": "
|
|
95
|
-
"sha1": "
|
|
96
|
-
"md5": "
|
|
90
|
+
"name": "expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar",
|
|
91
|
+
"url": "expo.modules.webbrowser-15.0.11-canary-20251210-1f163e3-sources.jar",
|
|
92
|
+
"size": 8169,
|
|
93
|
+
"sha512": "076da63f70370cb210d0ce7fd9144f1706f75f9023e46d085c8aae046179aea53884cb0029d7a46b305a91594d4f7e0b2de49da36f94b6a6354388bc9c25f3c2",
|
|
94
|
+
"sha256": "a8f81a06ac9192351958fded7442498bb32dd54eea11e31046c909bc7230ec03",
|
|
95
|
+
"sha1": "9cc9f35c2b5a4d0ac7ecb1bf82da9708769c85c7",
|
|
96
|
+
"md5": "06ea97a70a42e4b159cfbd5bd356e987"
|
|
97
97
|
}
|
|
98
98
|
]
|
|
99
99
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a42acae438b1fc2d859e04e53802a4b4
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
efacfbf50e3f7e12d1732fd79b53891188e588ea
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0af3922df3e142255ee071e638eb95c89982a3f385b562dce226ad95ea59643c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8d8a880feea2feff11f0f5d20e85dea9650b2252aeb75200ad1f3203884f6cb87d3c3601d2d36ac4a03054fd1e57cab317a24220d5d0752164183229091cc9ae
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.webbrowser</artifactId>
|
|
12
|
-
<version>15.0.11-canary-
|
|
12
|
+
<version>15.0.11-canary-20251210-1f163e3</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.webbrowser</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
34895986d050a3bb08904362ea672358
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7a50a3b01a41d653ea04f2187e3f44ba7f4e797a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
58cbf713aacce59f44f28b6d150fb9821002884098257288396ddaa31ea30391
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1c8217a57ae4aa80c16be0086bd4b441e6a21b999d725fb370b483912ac6b5965679b1468c17a184f2f678af99ab8a41528d092514cdd497566500de454737c8
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.webbrowser</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>15.0.11-canary-
|
|
7
|
-
<release>15.0.11-canary-
|
|
6
|
+
<latest>15.0.11-canary-20251210-1f163e3</latest>
|
|
7
|
+
<release>15.0.11-canary-20251210-1f163e3</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>15.0.11-canary-
|
|
9
|
+
<version>15.0.11-canary-20251210-1f163e3</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20251210173244</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
9a34336b2a5cfaea21142f45e6bee021
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
21559e89486ddb73baba754172aa081f7c0c408f
|
package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2713b7d339a55b31afc145612e0adafbef9c6024d6f11a540e5cd952f4233c54
|
package/local-maven-repo/host/exp/exponent/expo.modules.webbrowser/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
d9e454af833cf05e98364f4687867cbc6626deea006aceeeb47a34fa5d8fcdf8a357a2e04744762c7b7e6a30d8942f6b5dba547caf36acffb742a01d08df49da
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-web-browser",
|
|
3
|
-
"version": "15.0.11-canary-
|
|
3
|
+
"version": "15.0.11-canary-20251210-1f163e3",
|
|
4
4
|
"description": "Provides access to the system's web browser and supports handling redirects. On iOS, it uses SFSafariViewController or ASWebAuthenticationSession, depending on the method you call, and on Android it uses ChromeCustomTabs. As of iOS 11, SFSafariViewController no longer shares cookies with Safari, so if you are using WebBrowser for authentication you will want to use WebBrowser.openAuthSessionAsync, and if you just want to open a webpage (such as your app privacy policy), then use WebBrowser.openBrowserAsync.",
|
|
5
5
|
"main": "build/WebBrowser.js",
|
|
6
6
|
"types": "build/WebBrowser.d.ts",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"preset": "expo-module-scripts"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"expo-module-scripts": "5.1.0-canary-
|
|
39
|
+
"expo-module-scripts": "5.1.0-canary-20251210-1f163e3"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"expo": "55.0.0-canary-
|
|
42
|
+
"expo": "55.0.0-canary-20251210-1f163e3",
|
|
43
43
|
"react-native": "*"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/src/WebBrowser.types.ts
CHANGED
|
@@ -50,6 +50,20 @@ export type WebBrowserOpenOptions = {
|
|
|
50
50
|
* @platform android
|
|
51
51
|
*/
|
|
52
52
|
createTask?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* A boolean determining whether to use a proxy activity to launch the browser.
|
|
55
|
+
* It's available only when `createTask` is `true`. Otherwise, it'll be ignored.
|
|
56
|
+
* When `true`, browser will be launched through a
|
|
57
|
+
* transparent proxy activity with a different task affinity. This prevents browser
|
|
58
|
+
* from being destroyed when the app is backgrounded.
|
|
59
|
+
* When `true`, `showInRecents` is always treated as `true`.
|
|
60
|
+
*
|
|
61
|
+
* Set to `false` to use the legacy direct launch behavior.
|
|
62
|
+
*
|
|
63
|
+
* @default true
|
|
64
|
+
* @platform android
|
|
65
|
+
*/
|
|
66
|
+
useProxyActivity?: boolean;
|
|
53
67
|
/**
|
|
54
68
|
* Tint color for controls in SKSafariViewController. Supports React Native [color formats](https://reactnative.dev/docs/colors).
|
|
55
69
|
* @platform ios
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
597229c8acbdb0cb66a8cc67bee5d3e2
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
badf641b53a4fc051795aaa430b0a119b85a3dab
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
226ce0c4b274d09771d41e3e1fb1fee44cebb87a5c8c5304ca799f6889be9e50
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cb205a40f7a6a699303dfb8283471b9c20b8f9a98e3f3be3a386b19e2cc71a6742f11900988303751b03ec3c936c489e41062404023fef8c9a5d93664ae2bc0b
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3b740aaeee3041ab055cc397fda19ad9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8f6945e42c9e7954120d7c2e25318d3212834416
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dcf177bf57c9ad585839cdc30851b94effd29d149fda0340ead1766b4f9673d7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ab014a3a7bae9a8a22771127e357b6d926199a4d78aedd09b8f73fe9be1923d502721444ff78eec26e53d22e8f3717a39a1ae4006698c8ba285f425ec638dddf
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
89a98da57fe137670d0d6bc365b7f12b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
10a4277ae4ea9d8e47b166942d7ee1e1375d74cc
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d53d7ba9ec5b1215a620eb1a08118477b6b799b8c80e44db23b2114094fa6476
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
785f7e97646a7a3828969832f86ab61ac60bec390c2bf6a4e413554680d25eaec794fd442b9f327b227c0a1f79c2564fa904a65cc1d89bef531552abe88c2dee
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
19bc5fed907cdd5c38f672243719b24b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bda2f5882399f2baf15be5d0707cc84f6a7186ff
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
69614b73be8c74be922b092c0fedacefa363d91f4375197dd688ea334da72f2a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e44840adb91a35c991ad76bc1c94da1527e5d8be1e70ace7aa6a25aec2f35421843a141656e3cba339bbe2ef297eef5d05f8075f69afe2ffd45c37b2eddb2930
|