diff --git a/app/src/main/kotlin/bums/lunatic/launcher/home/GeckoWeb.kt b/app/src/main/kotlin/bums/lunatic/launcher/home/GeckoWeb.kt index 8a2a77b4..462197f8 100644 --- a/app/src/main/kotlin/bums/lunatic/launcher/home/GeckoWeb.kt +++ b/app/src/main/kotlin/bums/lunatic/launcher/home/GeckoWeb.kt @@ -363,6 +363,19 @@ class GeckoWeb : BWebview { if (url.contains(getFilterF()) && privateMode) { this@GeckoWeb.visibility = View.INVISIBLE } + if (url?.startsWith("magnet:?") == true) { + Uri.parse(url)?.let { + context.startActivity(Intent().apply { + action = Intent.ACTION_VIEW + flags = + Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS.or(FLAG_ACTIVITY_CLEAR_TOP) + .or( + FLAG_ACTIVITY_NEW_TASK + ) + data = it + }) + } + } } override fun onPageStop(session: GeckoSession, success: Boolean) {