File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -302,13 +302,6 @@ Chromote <- R6Class(
302302 private $ sessions [[sid ]] <- NULL
303303 session $ mark_closed()
304304 })
305-
306- # When a target crashes, raise a warning.
307- # The session cannot be closed because no session id is returned by the
308- # Inspector.targetCrashed event
309- self $ protocol $ Inspector $ targetCrashed(function (msg ) {
310- warning(" Chromote has received a Inspector.targetCrashed event. This means that the ChromoteSession has probably crashed." )
311- })
312305 },
313306
314307 # =========================================================================
Original file line number Diff line number Diff line change @@ -85,6 +85,19 @@ ChromoteSession <- R6Class(
8585 private $ pixel_ratio <- value $ result $ value
8686 })
8787
88+ # When a target crashes, raise a warning.
89+ if (! is.null(self $ Inspector $ targetCrashed )) {
90+ p <- p $
91+ then(function (value ) {
92+ self $ Inspector $ targetCrashed(timeout_ = NULL , wait_ = FALSE , function (value ) {
93+ warning(" Chromote has received a Inspector.targetCrashed event. This means that the ChromoteSession has probably crashed." )
94+ # Even if no targetId nor sessionId is returned by Inspector.targetCashed
95+ # mark the session as closed. This will close all sessions..
96+ self $ mark_closed()
97+ })
98+ })
99+ }
100+
88101 if (wait_ ) {
89102 self $ wait_for(p )
90103 } else {
You can’t perform that action at this time.
0 commit comments