After creating a script that included closing a firefox tab and hiding the window I realized I could not open firefox and just got a “Firefox is already running” error every time after running this script once.
I tried running the command:
$ sudo killall firefox
As there may have been some hidden windows however this didn’t work.
Then I tried reinstalling firefox:
$ sudo apt-get install --reinstall firefox
This didn’t seem to work either.
After some research I found this:
$ sudo rm -fr /home/"USERNAME"/.mozilla
This worked and I could open firefox again however I don’t believe its the best way of solving this problem.