How to close Chrome's native host exe when browser is closed

229 views
Skip to first unread message

Chris Kim

unread,
Jul 26, 2019, 3:48:06 AM7/26/19
to Chromium Extensions
Hello, Guys.

I'm working on developing Chrome Extension for several weeks. I have almost completed demo version of chrome extension now. but I have one problems I don't know so that I wanna get some help from you guys. My host program is running even though chrome browser was closed. and then my host program is launching again when chrome browser was re-open. which means my host programs are stacking whenever chrome browser was all closing then re-opening. how can I solve this problem? Plz help me and advice me.

Thanks in advance :D

PhistucK

unread,
Jul 26, 2019, 4:25:29 AM7/26/19
to Chris Kim, Chromium Extensions
Usually, when you use a native host, there is a chrome.exe (the extension process) that executes a cmd.exe that executes the native host in the first place.
Do those chrome.exe and cmd.exe survive as well, or only your native host?
The former sounds like a problem in Chrome (or intentional, if you enable background extensions/applications in the Chrome settings perhaps).
The latter sounds like a problem with your native host (perhaps you are telling the operating system that you are not accepting its shutdown - not kill - request, for example).

PhistucK


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/bd0fb01d-d2cf-4c68-aac7-9a83665b3b2e%40chromium.org.

Aleksandr G.

unread,
Jul 26, 2019, 5:01:42 AM7/26/19
to Chromium Extensions
Check your host code. You should exit your Host process in case read operation from stdin returns error. Definitely sure the problem located there in 99%.

Chris Kim

unread,
Jul 28, 2019, 8:53:23 PM7/28/19
to Chromium Extensions, cjsc...@gmail.com
Thxs to reply :D

I have checked what you said. Actually, my host opens both participate in Chrome.exe and by alone. So when browser closed, my host that opens by alone is still running. did I something wrong?
I developed host by MFC. cuz I need to get windows caption for communicating with another app.
or if I deploy my chrome extension, it would be solved?

On Friday, 26 July 2019 17:25:29 UTC+9, PhistucK wrote:
Usually, when you use a native host, there is a chrome.exe (the extension process) that executes a cmd.exe that executes the native host in the first place.
Do those chrome.exe and cmd.exe survive as well, or only your native host?
The former sounds like a problem in Chrome (or intentional, if you enable background extensions/applications in the Chrome settings perhaps).
The latter sounds like a problem with your native host (perhaps you are telling the operating system that you are not accepting its shutdown - not kill - request, for example).

PhistucK


On Fri, Jul 26, 2019 at 10:48 AM Chris Kim <cjsc...@gmail.com> wrote:
Hello, Guys.

I'm working on developing Chrome Extension for several weeks. I have almost completed demo version of chrome extension now. but I have one problems I don't know so that I wanna get some help from you guys. My host program is running even though chrome browser was closed. and then my host program is launching again when chrome browser was re-open. which means my host programs are stacking whenever chrome browser was all closing then re-opening. how can I solve this problem? Plz help me and advice me.

Thanks in advance :D

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

PhistucK

unread,
Jul 29, 2019, 1:38:00 AM7/29/19
to Chris Kim, Chromium Extensions
I am not sure I understand what you were trying to say, sorry.

PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/5b9785dd-3c91-4a07-8fc8-0d2d66900dce%40chromium.org.

Chris Kim

unread,
Jul 29, 2019, 8:54:33 PM7/29/19
to Chromium Extensions, cjsc...@gmail.com
Oh, I'm sorry about my english.

I mean. when I run my chrome extension. host opens both way under chrome.exe and just run itself which isn't under any process. then it shows two running processes on task manager. So when I closed all the chrome browser, of course the process under chrome.exe was closed. but another process wasn't closed by closing browser. I made my host using C++ MFC. it runs windowless. I wanna close host when closed browser. 

On Monday, 29 July 2019 14:38:00 UTC+9, PhistucK wrote:
I am not sure I understand what you were trying to say, sorry.

PhistucK


On Mon, Jul 29, 2019 at 3:53 AM Chris Kim <cjsc...@gmail.com> wrote:
Thxs to reply :D

I have checked what you said. Actually, my host opens both participate in Chrome.exe and by alone. So when browser closed, my host that opens by alone is still running. did I something wrong?
I developed host by MFC. cuz I need to get windows caption for communicating with another app.
or if I deploy my chrome extension, it would be solved?

On Friday, 26 July 2019 17:25:29 UTC+9, PhistucK wrote:
Usually, when you use a native host, there is a chrome.exe (the extension process) that executes a cmd.exe that executes the native host in the first place.
Do those chrome.exe and cmd.exe survive as well, or only your native host?
The former sounds like a problem in Chrome (or intentional, if you enable background extensions/applications in the Chrome settings perhaps).
The latter sounds like a problem with your native host (perhaps you are telling the operating system that you are not accepting its shutdown - not kill - request, for example).

PhistucK


On Fri, Jul 26, 2019 at 10:48 AM Chris Kim <cjsc...@gmail.com> wrote:
Hello, Guys.

I'm working on developing Chrome Extension for several weeks. I have almost completed demo version of chrome extension now. but I have one problems I don't know so that I wanna get some help from you guys. My host program is running even though chrome browser was closed. and then my host program is launching again when chrome browser was re-open. which means my host programs are stacking whenever chrome browser was all closing then re-opening. how can I solve this problem? Plz help me and advice me.

Thanks in advance :D

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

PhistucK

unread,
Jul 30, 2019, 2:27:10 AM7/30/19
to Chris Kim, Chromium Extensions
I guess you need to make that standalone process a child/dependent process of the non-standalone process that Chrome originally ran. This way, when the non-standalone process exits, your process might exit as well.
Anyway, this discussion sounds like a Windows API discussion rather than anything specific to Chrome extensions or native hosts for Chrome extensions. You might want to use stackoverflow.com instead.

PhistucK


On Tue, Jul 30, 2019 at 3:54 AM Chris Kim <cjsc...@gmail.com> wrote:
Oh, I'm sorry about my english.

I mean. when I run my chrome extension. host opens both way under chrome.exe and just run itself which isn't under any process. then it shows two running processes on task manager. So when I closed all the chrome browser, of course the process under chrome.exe was closed. but another process wasn't closed by closing browser. I made my host using C++ MFC. it runs windowless. I wanna close host when closed browser. 

On Monday, 29 July 2019 14:38:00 UTC+9, PhistucK wrote:
I am not sure I understand what you were trying to say, sorry.

PhistucK


On Mon, Jul 29, 2019 at 3:53 AM Chris Kim <cjsc...@gmail.com> wrote:
Thxs to reply :D

I have checked what you said. Actually, my host opens both participate in Chrome.exe and by alone. So when browser closed, my host that opens by alone is still running. did I something wrong?
I developed host by MFC. cuz I need to get windows caption for communicating with another app.
or if I deploy my chrome extension, it would be solved?

On Friday, 26 July 2019 17:25:29 UTC+9, PhistucK wrote:
Usually, when you use a native host, there is a chrome.exe (the extension process) that executes a cmd.exe that executes the native host in the first place.
Do those chrome.exe and cmd.exe survive as well, or only your native host?
The former sounds like a problem in Chrome (or intentional, if you enable background extensions/applications in the Chrome settings perhaps).
The latter sounds like a problem with your native host (perhaps you are telling the operating system that you are not accepting its shutdown - not kill - request, for example).

PhistucK


On Fri, Jul 26, 2019 at 10:48 AM Chris Kim <cjsc...@gmail.com> wrote:
Hello, Guys.

I'm working on developing Chrome Extension for several weeks. I have almost completed demo version of chrome extension now. but I have one problems I don't know so that I wanna get some help from you guys. My host program is running even though chrome browser was closed. and then my host program is launching again when chrome browser was re-open. which means my host programs are stacking whenever chrome browser was all closing then re-opening. how can I solve this problem? Plz help me and advice me.

Thanks in advance :D

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/51fbfd71-0dd1-4098-8d76-e94cddaa370f%40chromium.org.
Reply all
Reply to author
Forward
0 new messages