Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How can I reset firefox via command script (linux)

  • 4 replies
  • 2 have this problem
  • 1580 views
  • Last reply by cor-el

more options

I am trying to set up a Jenkins build server that uses SeleniumHQ and Firefox ESR during integration tests.

I have installed Firefox ESR 24 and seleniumHq 2.42.2

I have found that the Firefox profile/state is getting corrupted when the selenium code exits.

This prevents the selenium FirefoxDriver from establishing a control connection because firefox is blocked on Firefox's 'last time I crashed - what do you want to do? Start fresh or attempt to recover?' screen.

What I would like to do is ensure that I always start clean with a pure factory-default Firefox configuration at the start of each run.

i.e., a "Reset to factory defaults" configuration.

This should be OK because the Jenkins account is only used for this build process.

Unfortunately, there is no documentation on how/what to blow away in order to accomplish this.

What do I need to do to accomplish this? I see that there is a ~/.cache/mozilla directory, but that doesn't seem to be the magic location that I seek... .

Chosen solution

The main profile folder is in this location:

  • Windows: C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>\
  • Linux: ~/.mozilla/firefox/<profile>/

You would have to delete this folder in case files get corrupted when you close Firefox. The other location is for the cache and some other files like about:newtab thumbnails and phishing protection database.

Read this answer in context 👍 2

All Replies (4)

more options

See if this can help;

Reset Firefox {web link} is a LAST RESORT ! !

more options

Chosen Solution

The main profile folder is in this location:

  • Windows: C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\Profiles\<profile>\
  • Linux: ~/.mozilla/firefox/<profile>/

You would have to delete this folder in case files get corrupted when you close Firefox. The other location is for the cache and some other files like about:newtab thumbnails and phishing protection database.

more options

Thank you. The locations should solve my problem.

To clarify. I'm trying to get this working on a headless linux system running under a restricted user account.

While there are many great things available in the firefox UI for managing profiles, being able to do the equivalent actions via simple CLI actions or options (e.g., firefox --reset-profile ) would greatly simplify my life.

Without a CLI (or the storage locations of these settings -- thank you!), I can't reliably restore my automated build environment to a pristine state -- and I wanted to avoid writing a screen scraping tool to wrap and control firefox's profile manager to find and click the Reset Firefox button. Just seemed too meta...

more options