Page 1 of 1

Google didn't close correctly issue

Posted: 14 Aug 2020, 06:16
by Epialis
Hey all...

I have a script that opens a new window in chrome and then closes it with the use of a button. Problem is, is that you get this google didn't shut down properly and asks to restore the windows. I have searched on this but haven't found anything. I have temporarily used the mouse to move to the X and exit that popup, but would like to know if there is a way to do so without having to automate the mouse to the X position? Thank you!

Re: Google didn't close correctly issue

Posted: 15 Aug 2020, 19:11
by Epialis
No idea? :(

I just used mouse clicking coords to close it.. but it's annoying lol... YAY

Re: Google didn't close correctly issue

Posted: 16 Aug 2020, 02:10
by madsounds
Hi, please show the script so I could try to launch it :-)

Re: Google didn't close correctly issue

Posted: 16 Aug 2020, 03:14
by Epialis
@madsounds

I don't mind, but the script is not the cause, it's when you stop the process while the browser is still open... next time you go back to the browser, then it pops up a box that says it did not close properly and would you like to restore the page. There must b a work around this? Thank you.

Re: Google didn't close correctly issue

Posted: 16 Aug 2020, 04:36
by madsounds
If you want to avoid such Chrome's error window, after browser crashed last time, I've heard it's impossible to disable this error. But you of course can close it via AHK.

I'm not sure if "Restore pages?" is window's title or just a text, so try one of this:

Code: Select all

loop
{
	WinClose % "Restore pages? ahk_exe chrome.exe ahk_class Chrome_WidgetWin_1" ;if "Restore pages?" is title
	Sleep 100
}

Code: Select all

loop
{
	WinClose % "ahk_exe chrome.exe ahk_class Chrome_WidgetWin_1", % "Restore pages?" ;if "Restore pages?" is text
	Sleep 100
}
And maybe also there's a way to prevent such windows.

Re: Google didn't close correctly issue

Posted: 16 Aug 2020, 16:17
by Epialis
@madsounds

Thanks for the post. I tried both and no go. :( Appreciate you taking the time.... But you did give me an idea to see if there's something on that window the Spy might find to work with. I'll let you know.

Re: Google didn't close correctly issue  Topic is solved

Posted: 16 Aug 2020, 17:40
by Epialis
Okay, I found a work around that does the trick. Finally got rid of that thing.

Make sure you close google and its processes. It worked like a charm.

Edit the file located at C:\Users\username\AppData\Local\Google\Chrome\User Data\Default

Right click "Preference" file and click edit. ctrl+f to find the following values, and change the value to:

"exit_type": "none",

"exited_cleanly":true,

Save the file, and change the attribute to "read only" so chrome can't change it back.

Re: Google didn't close correctly issue

Posted: 16 Aug 2020, 19:39
by madsounds
It's nice you found a solution!

Re: Google didn't close correctly issue

Posted: 16 Aug 2020, 21:41
by Epialis
Thank you... It has been working well. I open a lot of windows usually and sometimes I just end the process through my admin program I made... so when you just end the process all the time, you get that irritating popup from google. It works well and thank you... I'm glad I figured it out too. Blessings!