Is there a way to detect when the visible window is closed by the user? #383
-
Hello, I want to open a visible instance of |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
After initializing browser.on('Inspector.detached') do
...
end I still don't have a good way to wait until the |
Beta Was this translation helpful? Give feedback.
-
Since every window_closed = false
browser.on('Inspector.detached') do
window_closed = true
end
until window_closed
sleep(1)
end
browser.quit
exit |
Beta Was this translation helpful? Give feedback.
Since every
browser.on(...) { ... }
block is executed using Concurrent Ruby, one cannot simply callexit
as all exceptions are silently rescued within the blocks; andexit
raisesSystemExit
. However, you can use this really simple solution that sets a local variable and busy waits until it's set: