Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I minimize to tray when I close a Chrome app?

I would like to minimize my app to the tray when the user presses close, similar to how Spotify operates. It doesn't have to a Windows system tray, but I do want my window to be closed.

However, the scripts in the webpage should be running so that a close behaves similarly to a minimize without a window.

Is there a way to do this besides keeping scripts in the manifest.json?

like image 399
dot_zero Avatar asked Oct 16 '25 03:10

dot_zero


2 Answers

No way to do this.

The Close icon is system level. Codes in Chrome app can not work with it.

like image 81
Hank X Avatar answered Oct 18 '25 05:10

Hank X


You can remove the native window controls using

chrome.app.window.create("any.html", { frame: "none" })

You can hide a window using

chrome.app.window.current().hide()

And show it using

chrome.app.window.current().show()

App Window Docs: https://developer.chrome.com/apps/app_window

like image 29
Daniel Herr Avatar answered Oct 18 '25 04:10

Daniel Herr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!