Skip to content

Commit

Permalink
Clear out Firefox crash reports
Browse files Browse the repository at this point in the history
Fix #59
  • Loading branch information
pmeenan committed Sep 22, 2017
1 parent 78daa37 commit 44f9187
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/firefox.py
Expand Up @@ -88,6 +88,21 @@ def prepare(self, job, task):
shutil.copytree(profile_template, task['profile'])
except Exception:
pass
# delete any unsent crash reports
crash_dir = None
if platform.system() == 'Windows':
if 'APPDATA' in os.environ:
crash_dir = os.path.join(os.environ['APPDATA'],
'Mozilla', 'Firefox', 'Crash Reports')
else:
crash_dir = os.path.join(os.path.expanduser('~'),
'.mozilla', 'firefox', 'Crash Reports')
if crash_dir and os.path.isdir(crash_dir):
logging.debug("Clearing crash reports in %s", crash_dir)
try:
shutil.rmtree(crash_dir)
except Exception:
pass

def launch(self, _job, task):
"""Launch the browser"""
Expand Down

0 comments on commit 44f9187

Please sign in to comment.