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
@@ -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