Google didn't close correctly issue Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

Google didn't close correctly issue

14 Aug 2020, 06:16

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!
User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

Re: Google didn't close correctly issue

15 Aug 2020, 19:11

No idea? :(

I just used mouse clicking coords to close it.. but it's annoying lol... YAY
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: Google didn't close correctly issue

16 Aug 2020, 02:10

Hi, please show the script so I could try to launch it :-)
User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

Re: Google didn't close correctly issue

16 Aug 2020, 03:14

@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.
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: Google didn't close correctly issue

16 Aug 2020, 04:36

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.
User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

Re: Google didn't close correctly issue

16 Aug 2020, 16:17

@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.
User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

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

16 Aug 2020, 17:40

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.
madsounds
Posts: 59
Joined: 31 May 2019, 08:14

Re: Google didn't close correctly issue

16 Aug 2020, 19:39

It's nice you found a solution!
User avatar
Epialis
Posts: 858
Joined: 02 Aug 2020, 22:44

Re: Google didn't close correctly issue

16 Aug 2020, 21:41

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!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, RussF and 309 guests