Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit fd14cfc

Browse files
committed
Fix killing ff
1 parent ada5b58 commit fd14cfc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

components/browser.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,17 @@ class Firefox(Browser):
301301
browsertime_binary = 'firefox'
302302
extra_processes = ['firefox', 'Firefox', 'plugin-container']
303303

304-
def terminate(self):
304+
def kill(self, force: bool):
305305
if is_win():
306-
subprocess.call(['taskkill', '/IM', 'firefox.exe'])
306+
subprocess.call(['taskkill', '/IM', 'firefox.exe'] + ['-9'] if force else [])
307307
if is_mac():
308-
subprocess.call(['killall', 'firefox'])
309-
time.sleep(2)
308+
subprocess.call(['killall', 'Firefox'] + ['-9'] if force else [])
309+
310+
def terminate(self):
311+
self.kill(False)
312+
time.sleep(2)
310313
super().terminate()
314+
self.kill(True)
311315

312316
def prepare_profile(self):
313317
cache_dir = None

0 commit comments

Comments
 (0)