Skip to content

FR: second-instance event should get the original argv or a custom data #23220

@xmedeko

Description

@xmedeko

Preflight Checklist

  • [x ] I have read the Contributing Guidelines for this project.
  • [x ] I agree to follow the Code of Conduct that this project adheres to.
  • [x ] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem Description

Following #20322 - for me as an Electron user, it's unacceptable that second-instance manipulates order of arguments, it's incompatible e.g. with yargs style (e.g. myapp.exe -a 1 -b 2). Current behaviour on Windows is confusing, not well documented.

Proposed Solution

Although I have described a workaround, I would like Electron to somehow overcome Chromium deficiency and pass the original argv to the second-instance event or pass any custom data comfortably.

I think the best solution could be by adding a string only param msg to app.requestSingleInstanceLock(msg) and the second-instance would returns the fourth value msg.

Other solution may be:

  1. second-instance would get the original argv, not the Chromium one.
  2. If a user pass a custom data app.requestSingleInstanceLock(argv), then the second-instance would return this custom data as argv, probably processed by JSON.parse(JSON.stringify(argv)).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions