Skip to content

fix: don't open a window in a second instance - #2596

Open
eXistenZNL wants to merge 1 commit into
ferdium:developfrom
eXistenZNL:fix/second-instance-window
Open

eXistenZNL wants to merge 1 commit into
ferdium:developfrom
eXistenZNL:fix/second-instance-window

Conversation

@eXistenZNL

@eXistenZNL eXistenZNL commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

This PR stops a second instance of Ferdium from starting up. When Ferdium is already running, a second instance passes its arguments to the running one and calls app.quit(), but the ready event still fires, so it goes on to create a window before it quits. It now returns early from the ready handler when it didn't get the single instance lock. Every link opened in Ferdium while it runs starts such a second instance.

Part of a Larger Feature

This PR is part of a larger feature: letting Ferdium open links in the service they belong to, so it behaves more like the native apps of those services. That covers web links (for example a Slack permalink handed to Ferdium by a link router) and the app links of a service (for example the slack:// link behind the "Open in app" button on a Slack web page). Each recipe decides which links are its own, so a service can add support for its links without changes to Ferdium itself. App links can be enabled on Linux and Windows; macOS will follow in a later PR.

The feature is split up so each part can be reviewed on its own:

  1. fix: handle deep links on Linux #2595
  2. fix: don't open a window in a second instance #2596 👈 You are here
  3. feat: open http(s) links in the service they belong to #2597 (builds on 1)
  4. feat: open app links like slack:// in the service they belong to #2598 (builds on 3)
  5. feat: open links and app links in Slack and WhatsApp ferdium-recipes#761 (needs 4)

Motivation and Context

Ferdium handles a ton of services for me; with this change it can behave much more like the various native apps that exist for each service. Having this feature makes the whole process of getting a link into Ferdium (where you are logged in to a service) much more integrated.

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (pnpm prepare-code)
  • pnpm test passes
  • I tested/previewed my changes locally

Release Notes

Fixed a second Ferdium instance starting up briefly when Ferdium is opened again while it is already running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant