Skip to content

[Bug]: browserFinished on Android triggers when browser is minimized #2554

Closed

Description

@Prinzhorn

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 8.4.0
@capacitor/core: 8.4.0
@capacitor/android: 8.4.0
@capacitor/ios: 8.4.0

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/core: 8.4.0
@capacitor/android: 8.4.0
@capacitor/cli: 8.4.0

[success] Android looking great! 👌

Other API Details

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

For repro I used npm init @capacitor/app@latest and then replaced index.html body with

<button>Open browser</button>
<pre></pre>

and capacitor-welcome.js with

import { Browser } from '@capacitor/browser';

Browser.addListener('browserFinished', async () => {
  document.querySelector('pre').innerText += 'browserFinished\n';
});

document.querySelector('button').addEventListener('click', () => {
  Browser.open({
    url: 'https://example.com',
  });
});

Steps:

  1. Click "open browser"
  2. Minimize the browser
  3. browserFinished has fired
  4. It won't fire again when maximizing/minimizing or closing the browser
Screencast.from.2026-06-03.09-52-07.mp4

Expected Behavior

I expect browserFinished to tell me when the browser was closed

I open Auth0 in a browser (because of ionic-team/capacitor#7367). But I can't reliably know when the browser is done to remove the "loading" state (spinner) in my app.

Project Reproduction

https://github.com/Prinzhorn/capacitor-android-browser-close-event

Additional Information

No response

Activity

  1. added theissue type on Jun 3, 2026
  2. OS-ruimoreiramendes commented on Sep 22, 2026

    @OS-ruimoreiramendes
    Contributor

    Fixed in #2561

    Note: the fix works reliably on Android 14 and higher. On versions below Android 14, the OS doesn't deliver the close event when the Custom Tab is minimized to PiP, so the previous behavior is kept there.

  3. ionitron-bot commented on Oct 7, 2026

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

  4. locked and limited conversation to collaborators on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions