2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

For #26037: Open shared FireFox tab from another device in Firefox browser

This fix will allow the tab that's being shared from a device to open in FireFox browser in the device  that receives the tab, even if another browser is set as default in the destination device.

Co-Authored-By: Mugurell <Mugurell@users.noreply.github.com>
This commit is contained in:
indu 2022-08-11 10:31:59 +05:30 committed by Ryan VanderMeulen
parent 7d0c09fb3e
commit 979862357d

View File

@ -20,6 +20,7 @@ import androidx.core.content.getSystemService
import mozilla.components.concept.sync.Device
import mozilla.components.concept.sync.TabData
import mozilla.components.support.base.log.logger.Logger
import org.mozilla.fenix.IntentReceiverActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.utils.IntentUtils
@ -60,8 +61,11 @@ class NotificationManager(private val context: Context) {
logger.debug("${filteredTabs.size} tab(s) after filtering for unsupported schemes")
filteredTabs.forEach { tab ->
val showReceivedTabsIntentFlags = IntentUtils.defaultIntentPendingFlags or PendingIntent.FLAG_ONE_SHOT
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(tab.url))
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
val intent = Intent(context, IntentReceiverActivity::class.java).apply {
action = Intent.ACTION_VIEW
data = Uri.parse(tab.url)
flags = Intent.FLAG_ACTIVITY_NEW_TASK
}
intent.putExtra(RECEIVE_TABS_TAG, true)
val pendingIntent: PendingIntent =
PendingIntent.getActivity(context, 0, intent, showReceivedTabsIntentFlags)