Skip to content

Firefox custom tabs remain in recents screen after pressing back #510

@chenxiaolong

Description

@chenxiaolong

Steps to reproduce

  1. Click on a link in an app
  2. In the URLCheck popup, open the link in Firefox
  3. Press the system back button (or swipe gesture)

Expected behavior

The Firefox custom tab closes and is not present in Android's recents screen.

Actual behavior

The Firefox custom tab activity remains in the recents screen.

URLCheck version

3.4 (Github release)

Android version

Android 16

Android Custom/Specific ROM or Device

GrapheneOS

Other details

I can reproduce this with Firefox (141.0.3), Firefox Beta (142.0b9), and Firefox Nightly (143.0a1 - 2016107450). However, I do not see this issue with a Chromium-based browser (139.0.7258.62.1).

I wasn't sure if the issue was in URLCheck or Firefox because this issue does not happen when Firefox is set as the default browser.

When opening a custom tab with URLCheck + Firefox, I see this in the logcat:

2025-08-09 17:37:05.337354 -0400 I/ActivityTaskManager( 1207): START u0 {act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... flg=0x10000000 xflg=0x4 cmp=org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity (has extras)} with LAUNCH_MULTIPLE from uid 10191 (sr=236176333) (BAL_ALLOW_VISIBLE_WINDOW) result code=0
2025-08-09 17:37:05.338544 -0400 V/WindowManagerShell( 2375): Transition requested (#357): android.os.BinderProxy@ace92ec TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=1877 effectiveUid=10213 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... flg=0x10800000 cmp=org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity } baseActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} topActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} origActivity=null realActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} numActivities=1 lastActiveTime=33448005 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@940a6b5} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 199 - 0, 0) topActivityInfo=ActivityInfo{850514a org.mozilla.fenix.IntentReceiverActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=false isVisible=false isVisibleRequested=false isTopActivityNoDisplay=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true isActivityStackTransparent=true lastNonFullscreenBounds=Rect(342, 893 - 1003, 2237) capturedLink=https://links.n.zavvi.com/<redacted> capturedLinkTimestamp=0 requestedVisibleTypes=-9 topActivityRequestOpenInBrowserEducationTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 topActivityAppBounds=Rect(0, 0 - 1344, 2992) isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false topActivityLetterboxBounds=null cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=inactive}} topActivityMainWindowFrame=null}, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 357 }
2025-08-09 17:37:05.344778 -0400 I/AppWidgetServiceImpl( 1207): Received broadcast: android.intent.action.PACKAGE_UNSTOPPED on user 0
2025-08-09 17:37:05.368154 -0400 I/ActivityManager( 1207): Start proc 20485:org.mozilla.firefox_beta/u0a213 for next-top-activity {org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity}
2025-08-09 17:37:05.618929 -0400 I/AconfigPackage(20485): com.android.intentresolver is mapped to system
2025-08-09 17:37:05.818756 -0400 I/ActivityTaskManager( 1207): START u0 {act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... xflg=0x4 cmp=org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity (has extras)} with LAUNCH_MULTIPLE from uid 10213 (sr=5266383) (BAL_ALLOW_VISIBLE_WINDOW) result code=0
2025-08-09 17:37:05.919473 -0400 I/BroadcastQueue( 1207): BOOT_COMPLETED_BROADCAST_COMPLETION_LATENCY_REPORTED action:android.intent.action.BOOT_COMPLETED dispatchLatency:0 completeLatency:295 dispatchRealLatency:1 completeRealLatency:295 receiversSize:1 userId:0 userType:android.os.usertype.full.SYSTEM
2025-08-09 17:37:06.051113 -0400 W/ActivityManager( 1207): Receiver with filter android.content.IntentFilter@8ac302d already registered for pid 20485, callerPackage is org.mozilla.firefox_beta
2025-08-09 17:37:06.079659 -0400 V/WindowManager( 1207): Sent Transition (#357) createdAt=08-09 17:37:05.329 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=1877 effectiveUid=10213 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... flg=0x10800000 cmp=org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity } baseActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} topActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} origActivity=null realActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} numActivities=1 lastActiveTime=33448005 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{5f9eadc Task{f4a595c #1877 type=standard I=org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 199 - 0, 0) topActivityInfo=ActivityInfo{32037e5 org.mozilla.fenix.IntentReceiverActivity} launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=false isVisible=false isVisibleRequested=false isTopActivityNoDisplay=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true isActivityStackTransparent=true lastNonFullscreenBounds=Rect(342, 893 - 1003, 2237) capturedLink=https://links.n.zavvi.com/<redacted> capturedLinkTimestamp=0 requestedVisibleTypes=-9 topActivityRequestOpenInBrowserEducationTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 topActivityAppBounds=Rect(0, 0 - 1344, 2992) isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false topActivityLetterboxBounds=null cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=inactive}} topActivityMainWindowFrame=null}, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 357 }

When closing a custom tab with URLCheck + Firefox:

2025-08-09 17:33:02.904889 -0400 V/WindowManagerShell( 2375): Transition requested (#319): android.os.BinderProxy@c36af79 TransitionRequestInfo { type = CLOSE, triggerTask = TaskInfo{userId=0 taskId=1869 effectiveUid=10213 displayId=0 isRunning=false baseIntent=Intent { act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... cmp=org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity } baseActivity=null topActivity=null origActivity=null realActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity} numActivities=0 lastActiveTime=33168742 supportsMultiWindow=true resizeMode=2 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@d55c4be} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 0 - 0, 0) topActivityInfo=null launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isTopActivityNoDisplay=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=false isActivityStackTransparent=true lastNonFullscreenBounds=Rect(342, 893 - 1003, 2237) capturedLink=https://links.n.zavvi.com/<redacted> capturedLinkTimestamp=21183746 requestedVisibleTypes=-9 topActivityRequestOpenInBrowserEducationTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 topActivityAppBounds=Rect(0, 0 - 0, 0) isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false topActivityLetterboxBounds=null cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=undefined}} topActivityMainWindowFrame=null}, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 319 }
2025-08-09 17:33:02.985640 -0400 V/WindowManager( 1207): Sent Transition (#319) createdAt=08-09 17:33:02.903 via request=TransitionRequestInfo { type = CLOSE, triggerTask = TaskInfo{userId=0 taskId=1869 effectiveUid=10213 displayId=0 isRunning=false baseIntent=Intent { act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... cmp=org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity } baseActivity=null topActivity=null origActivity=null realActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity} numActivities=0 lastActiveTime=33168742 supportsMultiWindow=true resizeMode=2 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{17c5e85 Task{4110841 #1869 type=standard I=org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 0 - 0, 0) topActivityInfo=null launchCookies=[] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isTopActivityNoDisplay=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=false isActivityStackTransparent=true lastNonFullscreenBounds=Rect(342, 893 - 1003, 2237) capturedLink=https://links.n.zavvi.com/<redacted> capturedLinkTimestamp=21183746 requestedVisibleTypes=-9 topActivityRequestOpenInBrowserEducationTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 topActivityAppBounds=Rect(0, 0 - 0, 0) isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false topActivityLetterboxBounds=null cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=undefined}} topActivityMainWindowFrame=null}, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 319 }

When opening a custom tab with Firefox only:

2025-08-09 17:33:35.799349 -0400 I/ActivityTaskManager( 1207): START u0 {act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... xflg=0x4 cmp=org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity (has extras)} with LAUNCH_MULTIPLE from uid 10209 (sr=125543098) (BAL_ALLOW_VISIBLE_WINDOW) result code=0
2025-08-09 17:33:35.800125 -0400 V/WindowManagerShell( 2375): Transition requested (#327): android.os.BinderProxy@510b2f0 TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=1838 effectiveUid=10209 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=com.fastmail.app cmp=com.fastmail.app/.ui.webview.WebViewActivity } baseActivity=ComponentInfo{com.fastmail.app/com.fastmail.app.ui.webview.WebViewActivity} topActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} origActivity=null realActivity=ComponentInfo{com.fastmail.app/com.fastmail.app.ui.webview.WebViewActivity} numActivities=2 lastActiveTime=33238465 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@4418069} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 0 - 0, 0) topActivityInfo=ActivityInfo{f39daee org.mozilla.fenix.IntentReceiverActivity} launchCookies=[android.os.BinderProxy@493a950] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isTopActivityNoDisplay=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true isActivityStackTransparent=false lastNonFullscreenBounds=Rect(342, 893 - 1003, 2237) capturedLink=https://links.n.zavvi.com/<redacted> capturedLinkTimestamp=0 requestedVisibleTypes=-9 topActivityRequestOpenInBrowserEducationTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 topActivityAppBounds=Rect(0, 0 - 1344, 2992) isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false topActivityLetterboxBounds=null cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=inactive}} topActivityMainWindowFrame=null}, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 327 }
2025-08-09 17:33:35.825005 -0400 I/ActivityManager( 1207): Start proc 17215:org.mozilla.firefox_beta/u0a213 for next-top-activity {org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity}
2025-08-09 17:33:36.033693 -0400 I/AconfigPackage(17215): com.android.intentresolver is mapped to system
2025-08-09 17:33:36.233249 -0400 I/ActivityTaskManager( 1207): START u0 {act=android.intent.action.VIEW dat=https://links.n.zavvi.com/... xflg=0x4 cmp=org.mozilla.firefox_beta/org.mozilla.fenix.customtabs.ExternalAppBrowserActivity (has extras)} with LAUNCH_MULTIPLE from uid 10213 (sr=55326779) (BAL_ALLOW_VISIBLE_WINDOW) result code=0
2025-08-09 17:33:36.424241 -0400 W/ActivityManager( 1207): Receiver with filter android.content.IntentFilter@13aeeb7 already registered for pid 17215, callerPackage is org.mozilla.firefox_beta
2025-08-09 17:33:36.431900 -0400 V/WindowManager( 1207): Sent Transition (#327) createdAt=08-09 17:33:35.792 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=1838 effectiveUid=10209 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=com.fastmail.app cmp=com.fastmail.app/.ui.webview.WebViewActivity } baseActivity=ComponentInfo{com.fastmail.app/com.fastmail.app.ui.webview.WebViewActivity} topActivity=ComponentInfo{org.mozilla.firefox_beta/org.mozilla.fenix.IntentReceiverActivity} origActivity=null realActivity=ComponentInfo{com.fastmail.app/com.fastmail.app.ui.webview.WebViewActivity} numActivities=2 lastActiveTime=33238465 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{1ee3f5b Task{115256b #1838 type=standard I=com.fastmail.app/.ui.webview.WebViewActivity}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 0 - 0, 0) topActivityInfo=ActivityInfo{5d57d89 org.mozilla.fenix.IntentReceiverActivity} launchCookies=[android.os.BinderProxy@c011284] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=true isVisible=true isVisibleRequested=true isTopActivityNoDisplay=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=true isActivityStackTransparent=false lastNonFullscreenBounds=Rect(342, 893 - 1003, 2237) capturedLink=https://links.n.zavvi.com/<redacted> capturedLinkTimestamp=0 requestedVisibleTypes=-9 topActivityRequestOpenInBrowserEducationTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=-1 topActivityLetterboxHeight=-1 topActivityAppBounds=Rect(0, 0 - 1344, 2992) isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false topActivityLetterboxBounds=null cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=inactive}} topActivityMainWindowFrame=null}, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 327 }

When closing a custom tab with Firefox only:

2025-08-09 17:41:37.577919 -0400 V/WindowManagerShell( 2375): Transition requested (#369): android.os.BinderProxy@a9c2bcd TransitionRequestInfo { type = CLOSE, triggerTask = null, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 369 }
2025-08-09 17:41:37.629007 -0400 V/WindowManager( 1207): Sent Transition (#369) createdAt=08-09 17:41:37.576 via request=TransitionRequestInfo { type = CLOSE, triggerTask = null, pipChange = null, remoteTransition = null, displayChange = null, flags = 0, debugId = 369 }

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions