simple-web-server icon indicating copy to clipboard operation
simple-web-server copied to clipboard

Open at startup in the background

Open shoudeyunkaijianyueming opened this issue 1 year ago • 10 comments

Can it be turned on and self-starting, and the window is closed directly after opening, there is no sign, but it is turned on and self-starting

ps: At present, it is turned on and self-starting. I need to close the window after turning it on. Although it is only a click, it will affect the experience very much, thank you!

shoudeyunkaijianyueming avatar Apr 15 '23 07:04 shoudeyunkaijianyueming

Are you using Windows or macOS? Have you changed your setting so that the program launches when you turn in your computer?

terreng avatar Apr 15 '23 16:04 terreng

I am a mac, and this is how I use it, but after setting it like this, a window will appear every time I turn it on.

image

shoudeyunkaijianyueming avatar Apr 16 '23 09:04 shoudeyunkaijianyueming

image

It looks like this when booting, and I don't want this window to appear, it's silent in the background

shoudeyunkaijianyueming avatar Apr 16 '23 12:04 shoudeyunkaijianyueming

Thanks for the suggestion. It looks like this might take more than just a little work to do, so it might not happen for awhile.

Related: https://www.github.com/Teamwork/node-auto-launch/issues/93 https://www.github.com/electron/electron/issues/7312

terreng avatar Apr 16 '23 14:04 terreng

It's okay, I can wait, looking forward to your new update.

shoudeyunkaijianyueming avatar Apr 17 '23 00:04 shoudeyunkaijianyueming

+1

lucianoshl avatar Sep 07 '23 15:09 lucianoshl

+1

rishit537 avatar Sep 17 '23 20:09 rishit537

For macOS we can use the openAsHidden flag of app.setLoginItemSettings, but it only works on macOS non-MAS builds. However, we should be able to pass a custom argument to detect opening at startup and avoid creating the window.

See https://www.electronjs.org/docs/latest/api/app#appsetloginitemsettingssettings-macos-windows

terreng avatar Oct 22 '23 01:10 terreng

For macOS we can use the openAsHidden flag of app.setLoginItemSettings, but it only works on macOS non-MAS builds. However, we should be able to pass a custom argument to detect opening at startup and avoid creating the window.

See https://www.electronjs.org/docs/latest/api/app#appsetloginitemsettingssettings-macos-windows

Eagerly waiting for a solution in windows.

rishit537 avatar Oct 22 '23 02:10 rishit537

For windows, you can create a shortcut to the application at C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\. Windows supports defining launch arguments with shortcuts

ethanaobrien avatar Oct 22 '23 05:10 ethanaobrien