fix(deep-link): ChromeOS deep link calls filtered and ignored by plugin (fix #3207) (#3214)

This commit is contained in:
Josh
2026-03-12 22:02:08 +00:00
committed by GitHub
parent 35aad24773
commit 024ec0c29c
3 changed files with 14 additions and 3 deletions
+6
View File
@@ -0,0 +1,6 @@
---
"deep-link": patch
"deep-link-js": patch
---
Account for differing Android VIEW intent in ChromeOS, fixing deep-link behaviour on Chromium platforms.
@@ -44,11 +44,14 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
private var currentUrl: String? = null
private var channel: Channel? = null
private var config: PluginConfig? = null
companion object {
var instance: DeepLinkPlugin? = null
}
private fun isViewIntent(action: String?): Boolean {
return action == Intent.ACTION_VIEW || action == "org.chromium.arc.intent.action.VIEW"
}
@Command
fun getCurrent(invoke: Invoke) {
val ret = JSObject()
@@ -74,7 +77,7 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
val intent = activity.intent
if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
if (isViewIntent(intent.action) && intent.data != null) {
val url = intent.data.toString()
if (isDeepLink(url)) {
// TODO: check if it makes sense to split up init url and last url
@@ -87,7 +90,7 @@ class DeepLinkPlugin(private val activity: Activity): Plugin(activity) {
}
override fun onNewIntent(intent: Intent) {
if (intent.action == Intent.ACTION_VIEW && intent.data != null) {
if (isViewIntent(intent.action) && intent.data != null) {
val url = intent.data.toString()
if (isDeepLink(url)) {
this.currentUrl = url
+2
View File
@@ -25,6 +25,8 @@ fn intent_filter(domain: &AssociatedDomain) -> String {
format!(
r#"<intent-filter {auto_verify}>
<action android:name="android.intent.action.VIEW" />
<!-- ChromeOS ARC++ uses a different action for deep links -->
<action android:name="org.chromium.arc.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
{schemes}