Closed mrlayki closed 3 years ago
@ZekeLu help......
Please read this thread first: https://stackoverflow.com/questions/5480114/os-x-design-decisions-terminate-the-app-on-last-window-close. On MacOS, the Chrome process won't terminate when all its window are closed. You can use ⌘+Q to terminate the Chrome process.
And I guess you want to do something in your code when the Chrome process is terminated. This is what you need:
<-chromedp.FromContext(ctx).Browser.LostConnection
Thanks
What versions are you running?
What did you do? Include clear steps.
(Mac OS) When I click X to close the browser, the browser does not exit completely. At this time, the program cannot trigger context canceled.
What did you expect to see?
How should I code to trigger context canceled to end the task when I click X to close the browser? In other words, how should I code to make it completely close when I click X to close the browser?
My code: