The most important Firefox command line options
The Firefox web browser supports a number of command line options that it can be run with to customize startup of the web browser.
You may have come upon some of them in the past, for instance the command -P "profile name" to start the browser with the specified profile, or -private to start a new private browsing session.
The following guide lists important command line options for Firefox. It is not a complete list of all available options, as many are used only for specific purposes that have little to no value to users of the browser.
You find the complete listing of command line options on the Firefox Developer website. Note that many of the command line options work in other Mozilla-based products, even third-party programs, as well.
Important Firefox command line options
Profile specific options
- -CreateProfile profile name -- This creates a new user profile, but won't start it right away.
- -CreateProfile "profile name profile dir" -- Same as above, but will specify a custom profile directory on top of that.
- -ProfileManager, or -P -- Opens the built-in profile manager.
- -P "profile name" -- Starts Firefox with the specified profile. Profile manager is opened if the specified profile does not exist. Works only if no other instance of Firefox is running.
- -no-remote -- Add this to the -P commands to create a new instance of the browser. This lets you run multiple profiles at the same time.
Browser specific options
- -headless -- Start Firefox in headless mode. Requires Firefox 55 on Linux, Firefox 56 on Windows and Mac OS X.
- -new-tab URL -- loads the specified URL in a new tab in Firefox.
- -new-window URL -- loads the specified URL in a new Firefox window.
- -private -- Launches Firefox in private browsing mode. Can be used to run Firefox in private browsing mode all the time.
- -private-window -- Open a private window.
- -private-window URL -- Open the URL in a new private window. If a private browsing window is open already, open the URL in that window instead.
- -search term -- Run the search using the default Firefox search engine.
- -url URL -- Load the URL in a new tab or window. Can be run without -url, and multiple URLs separated by space can be opened using the command.
Other options
- -safe-mode -- Starts Firefox in Safe Mode. You may also hold down the Shift-key while opening Firefox to start the browser in Safe Mode.
- -devtools -- Start Firefox with Developer Tools loaded and open.
- -inspector URL -- Inspect the specified address in the DOM Inspector.
- -jsconsole -- Start Firefox with the Browser Console.
- -tray -- Start Firefox minimized.
–tray or -tray does not open it minimized.
@daneyul eb, the article is dated 2017/10, some things have changed since.
You can check Firefox/CommandLineOptions – MozillaWiki at [https://wiki.mozilla.org/Firefox/CommandLineOptions]
-kiosk is another i don’t see there (i might be blind) puts it in kiosk mode (duh) at lauch.
combined with -url very useful
Cortana and Search go separate ways. You find a search bar and a Cortana button on the Windows taskbar in the new Windows 10 release.
With the latest update, “-private-window URL” stated having a weird behavior. It opens the page in the private window but opens a non private empty window as well!
. . . I got lots of help with it, getting my questions answered, I just combined it into something useful.
. . . If I know someone likes it, and finds it useful, that’s worth a lot more to me, thanks!
If you look at the top of the “Instructions” tab, I see that I started experimenting with how to do this 12/30/09 . . . so, it’s taken me 9 years to get it to this point.
. . . But, I had this big breakthrough in automation only recently, after FF57 came out (11/14/17), and SQLite Manager no longer worked.
Yes, please let me know how it works for you, or if I can answer any questions.
Here’s what I figured out. There’s too much to put here, so, I’ve put it on a 4-page PDF on my Google Docs:
4 Ways to get to Firefox “Other Bookmarks”, from slowest to fastest
The following are 4 macros that I have in Excel 2010.
The first two just use VBA.
The second two use NirCmd.
https://drive.google.com/open?id=1eche0L-qHRWVA_yEh0JiL1k5SNK4HpCt
Thanks sludge7051-x for those VBS x Nircmd alternatives.
I’m trying to launch my FF’s bookmark library at a specific location (bookmark’s folder)…
Unlike Google Chrome’s bookmark manager, which assign an unique URL for each bookmark folder created, FF provide literrally no way to use it’s bookmark manager (library) efficiently.. Would you think of any possible way we could use nircmd to point to any one of those from the command line ?
I just posted this (I thought it could be useful to others). My solution is to just get all the bookmarks into Excel, and then work with them there:
Firefox Bookmarks to .xlsm [SOLVED] . . . https://www.mrexcel.com/forum/excel-questions/1040778-firefox-bookmarks-xlsm-solved.html#post4995974
@sludge7051-x, That my friend, is awesome. Have you made this in 6 days only ?
I haven’t actually tried it yet, but I’v read that first post describing what and how it does..
Trying it right now. This is some great exemple of the power of sharing & caring.. I totally appreciate (and admire this) … if you’ve got some crypto wallet pub key to provide, please put it somewhere in a signature, or pm me. I’d gladly donate for such a selfless & caring share.
Will provide input on my experience with it.
I want to make a macro in Excel 2010 that goes to “Other Bookmarks” . . . I can’t figure out how to do it
The closest I can get is, I open this, and it default opens to “All Bookmarks” . . . this is a “skin”
“C:\Program Files (x86)\Mozilla Firefox\firefox.exe” -chrome chrome://browser/content/places/places.xul
But, what I want is, and can only be done from within Firefox – I use this Keyboard Shortcut, and it default opens to “Other Bookmarks”
Ctrl + Shift + B
What I’ve tried:
1.) VBA “Call Send Keys” from Excel 2010 does not act on Firefox
2.) AutoHotKey is not able to communicate with Firefox: open FF, then input ^+b
Is there an easy “switch” I can just add to the Shortcut “-chrome”?
Or, is there a Firefox CLI, that I can use in a BAT file, and have another text file “act on” it, to open to “Other Bookmarks”? Any idea where the commands to do so are provided?
Thanks, Martin — this is useful info to squirrel away for future reference, and because it’s limited to Firefox, it’s easier to read than Mozilla’s page.
For what it’s worth, it doesn’t seem to matter whether the profile switch is uppercase (-P) or lowercase (-p), at least in Windows. I accidentally used a lowercase switch in my Firefox shortcuts and my two Firefox installs open with their correct respective profiles regardless. I vaguely remember that Linux is strictly case-sensitive when it comes to command-line entries. I have no idea whether OSX is, but since OSX is based on BSD, I’m guessing it might be as well. Best to play it safe and stick with an uppercase -P. You do not want to accidentally open a carefully curated pre-55 profile in a 55+ Firefox, or vice versa. (I know, because I’ve done it. Thankfully, I had recent backup profiles on hand.)
Will these still be available once FF57 arrives?
Yes they will.
Thank you Martin. :)
or point shortcut to waterfox exe….
Martin, Soren, Pants, Chef-Koch, anybody, what’s going on with Dash in Firefox / YouTube? it doesn’t fully buffer the video anymore or do anything regardless if i have media.mediasource.enabled set to true or false and if i right click on YouTube’s video player and left click on “Stats For Nerds” which looks totally different now, Dash is no longer listed. Can anybody tell me anything please? is there a new preference that will handle anything like this which i doubt? is there anyway to get the video to fully buffer again? is Scroogle just throttling the download speeds on YouTube now so Dash is irrelevant ?
Martin’s article on Dash https://www.ghacks.net/2016/08/31/how-to-enforce-full-video-buffering-on-youtube/ and an add-on i was using to give me a toggle button so i could quickly toggle media.mediasource.enabled without having to go to about:config every time https://addons.mozilla.org/en-US/firefox/addon/youtube-without-dash-playback/ which i guess is now abandoned because the developer will not respond if he plans on making it a web extension or not, if he even can make it a web extension. i’m sure someone here, maybe one of the people i mentioned at the beginning of this comment will know if it could be made a web extension or not, i would think that it could.
> YouTube doesn’t fully buffer the video anymore or do anything regardless if i have media.mediasource.enabled set to true or false
Yes, it’s the new version of YouTube, they must have done something to prevent full buffer, but it’s possible that some add-ons can fix it for you. I didn’t look into the change at all, just confirmed that even with MediaSource disabled YouTube still doesn’t buffer the whole video, so I don’t know which web standard they use to achieve that, could be just regular JS, in which case a solution may be to use a NoScript surrogate or some Grease/Violentmonkey script. But there may exist specific add-ons whose only purpose is to fully buffer YouTube videos, the question being are they updated to work with the new YouTube player yet.
On Mac you can bring up Firefoxe’s Profile Manager by holding down the option (alt) key while launching FF.
“safe mode” is oxymoronic here, isn’t it? It means you’ll be launching your browser bare naked, without the benefit of any extensions (inclusive of adblocking and privacy addons).
from support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode
“Safe Mode is a special Firefox mode that can be used to troubleshoot and fix problems. Safe Mode temporarily turns off hardware acceleration, resets some settings, and disables add-ons”
from kb.mozillazine.org/Safe_mode
==========
Safe Mode is a debugging startup mode available in Firefox, Thunderbird, and SeaMonkey 2, where all added extensions are disabled, the default theme is used, and default localstore settings (toolbar settings and controls) are used. Safe Mode also disables hardware acceleration, the Just-in-time (JIT) JavaScript compiler, and any changes made via userContent.css and userChrome.css. Any changes made to preference settings remain in effect in Safe Mode, however, and all available plugins are used. To summarize:
Safe Mode temporarily affects the following:
All extensions are disabled.
The default theme is used, without a persona.
The Just-in-time (JIT) JavaScript compiler is disabled.
The userChrome.css and userContent.css files are ignored.
The default toolbar layout is used.
Hardware acceleration is disabled.
Safe Mode has no effect on the following:
The status of plugins is not affected.
Custom preferences are not affected.
==========
After reading “all that”, I still honestly don’t know whether SafeMode flat-out disables javascript execution
(and, looking forward, wonder whether SafeMode suppresses asm.js execution)
I am very sure you are trying your hardest to not be a troll, but sure, enjoy urself trying hard to troll at the same time.