You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: second instance send "--allow-file-access-from-files" to master instance on Windows #32933
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
15.3.7, 17.0.1
What operating system are you using?
Windows
Operating System Version
Win10 x64
What arch are you using?
x64
Last Known Working Electron version
???
Expected Behavior
$myApp.exe --path C:\tmp\foo.txt --foo=1 --show 1
The command above is converted into argv (below) in the second instance and is received without any changes in the master instance when requestSingleInstanceLock is used.
No --allow-file-access-from-files is send to master instance because it was not included in original argv and no sorting is performed.
Optionally if --allow-file-access-from-files is needed by Chromium, it should be appended or inserted after the application path but before the first user argument.
Actual Behavior
The argv is correctly built in the second instance, but Electron inserts a --allow-file-access-from-files flag at an unexpected position that may destroy argument parsing when sending to master. In addition the argv received by the master seem to be "sorted".
The argv received by the master instance via app.on('second-instance'):
Hey @nornagon, could you please update the documentation that other users know that argv isn't actually the original command line arguments that are passed to the application but a pre-parsed one? According to the linked issue, a user should never use the provided information because they may invalid.
Since when is additionalData available as requestSingleInstanceLock parameter? v15 doesn't seem to have this option available according TS definitions.
Activity
nornagon commentedon Feb 16, 2022
Duplicate of #20322
second-instanceevent process arguments rip apart "name-value" arguments #20322fxha commentedon Feb 17, 2022
Hey @nornagon, could you please update the documentation that other users know that
argvisn't actually the original command line arguments that are passed to the application but a pre-parsed one? According to the linked issue, a user should never use the provided information because they may invalid.Since when is
additionalDataavailable asrequestSingleInstanceLockparameter? v15 doesn't seem to have this option available according TS definitions.