This repository was archived by the owner on Feb 1, 2024. It is now read-only.
File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ def terminate(self, timeout = 20):
145
145
time .sleep (2 )
146
146
finally :
147
147
pass
148
+ else :
149
+ self .process = None
148
150
149
151
try :
150
152
if self .temp_user_data_dir is not None :
@@ -301,13 +303,17 @@ class Firefox(Browser):
301
303
browsertime_binary = 'firefox'
302
304
extra_processes = ['firefox' , 'Firefox' , 'plugin-container' ]
303
305
304
- def terminate (self ):
306
+ def kill (self , force : bool ):
305
307
if is_win ():
306
- subprocess .call (['taskkill' , '/IM' , 'firefox.exe' ])
308
+ subprocess .call (['taskkill' , '/IM' , 'firefox.exe' ] + [ '-9' ] if force else [] )
307
309
if is_mac ():
308
- subprocess .call (['killall' , 'firefox' ])
309
- time .sleep (2 )
310
+ subprocess .call (['killall' , 'Firefox' ] + ['-9' ] if force else [])
311
+
312
+ def terminate (self ):
313
+ self .kill (False )
314
+ time .sleep (2 )
310
315
super ().terminate ()
316
+ self .kill (True )
311
317
312
318
def prepare_profile (self ):
313
319
cache_dir = None
Original file line number Diff line number Diff line change @@ -32,4 +32,5 @@ def Run(
32
32
browser .terminate ()
33
33
raise e
34
34
35
+ browser .terminate ()
35
36
return res
You can’t perform that action at this time.
0 commit comments