-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Closed
Labels
Description
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:
second-instance
would get the originalargv
, not the Chromium one.- If a user pass a custom data
app.requestSingleInstanceLock(argv)
, then thesecond-instance
would return this custom data asargv
, probably processed byJSON.parse(JSON.stringify(argv))
.
Jelmerro, dperetti, bpasero and SimonSiefke