0

https://stackoverflow.com/a/18317327/3809427 says you can exit chrome by chrome.processes API. But this is Dev channel from 2013 to present (2023). Is there a way to exit chrome on stable channel from Chrome extension?

I want to develop an extension which exit Chrome when a user closes a "Main Window"(I plan to detect it by number of tabs, etc).

Loran
  • 223
  • 2
  • 15
  • There's only `chrome.debugger` API which you can use to invoke [Browser.close](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-close). – wOxxOm Jun 09 '23 at 05:06
  • @lamrongol - **Why** do you want to close Chrome from an extension? (your question sounds like an [XY problem](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem/66378#66378) to me) – Thomas Mueller Jun 09 '23 at 06:31
  • @ThomasMueller I want to develop an extension which exit Chrome when user closes a "Main Window"(I plan to detect it by number of tabs, etc). This is direct question, I think. But I'll add to the goal. – Loran Jun 09 '23 at 10:59
  • @lamrongol - I would use the [chrome.windows](https://developer.chrome.com/docs/extensions/reference/windows/) API to close all windows. – Thomas Mueller Jun 14 '23 at 10:59
  • @ThomasMueller Hmmm.... I think simply closing all windows, only last closed window will be shown when booting Chrome again. But similar problem may happen by using [chrome\.processes](https://developer.chrome.com/docs/extensions/reference/processes/) or [Browser.close](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-close). Sorry, I have not yet tried these methods because after questioning, I had other things to do. – Loran Jun 14 '23 at 21:54

0 Answers0