Command line arguments: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
mNo edit summary
Line 16: Line 16:
  ! Command
  ! Command
  ! Result
  ! Result
  ! Example
  ! Example (Mac)
  |-
  |-
  | profile "<path>"
  | profile "<path>"
  | Starts Firefox with profile located at the given path.
  | Starts Firefox with profile located at the given path.
  | firefox.exe -profile "E:\myprofile"
  | /Applications/Firefox.app/Contents/MacOS/firefox -profile "path/myprofile"
  |-  
  |-  
  | P "<profile name>"  
  | P "<profile name>"  
  | Starts Firefox with a given profile name (profile name is case sensitive).
  | Starts Firefox with a given profile name (profile name is case sensitive).
  | firefox.exe -P "Joel User"
  | /Applications/Firefox.app/Contents/MacOS/firefox -P "Joel User"
  |-
  |-
  | <url>
  | <url>
  | Launches Firefox and opens the given URL(s).
  | Launches Firefox and opens the given URL(s).
  | firefox.exe <nowiki>"www.mozilla.org|www.mozillazine.org"</nowiki>
  | /Applications/Firefox.app/Contents/MacOS/firefox <nowiki>"www.mozilla.org|www.mozillazine.org"</nowiki>
  |-
  |-
  | safe-mode
  | safe-mode
  | Launches Firefox without loading extensions or themes.
  | Launches Firefox without loading extensions or themes.
  | firefox.exe -safe-mode
  | /Applications/Firefox.app/Contents/MacOS/firefox -safe-mode
  |-
  |-
  | height <value>
  | height <value>
  | Sets height of the startup window to <value>.
  | Sets height of the startup window to <value>.
  | firefox.exe -height 600
  | /Applications/Firefox.app/Contents/MacOS/firefox -height 600
  |-
  |-
  | width <value>
  | width <value>
  | Sets width of the startup window to <value>.
  | Sets width of the startup window to <value>.
  | firefox.exe -width 800
  | /Applications/Firefox.app/Contents/MacOS/firefox -width 800
  |-
  |-
  | ProfileManager
  | ProfileManager
  | Starts with Profile Manager.
  | Starts with Profile Manager.
  | firefox.exe -ProfileManager
  | /Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager
  |-
  |-
  | UILocale <locale>
  | UILocale <locale>
  | Starts with <locale> resources as UI Locale.
  | Starts with <locale> resources as UI Locale.
  | firefox.exe -UILocale th-TH
  | /Applications/Firefox.app/Contents/MacOS/firefox -UILocale th-TH
  |-
  |-
  | contentLocale <locale>
  | contentLocale <locale>
  | Starts with <locale> resources as content Locale.
  | Starts with <locale> resources as content Locale.
  | firefox.exe -contentLocale TH
  | /Applications/Firefox.app/Contents/MacOS/firefox -contentLocale TH
  |-
  |-
  | console
  | console
  | Starts Firefox with a debugging console.
  | Starts Firefox with a debugging console.
  | firefox.exe -console
  | /Applications/Firefox.app/Contents/MacOS/firefox -console
  |-
  |-
  | jsconsole
  | jsconsole
  | Starts with Javascript Console.
  | Starts with Javascript Console.
  | firefox.exe -jsconsole
  | /Applications/Firefox.app/Contents/MacOS/firefox -jsconsole
  |-
  |-
  | inspector <url>
  | inspector <url>
  | Starts with the DOM Inspector.
  | Starts with the DOM Inspector.
  | firefox.exe -inspector http://www.google.com/
  | /Applications/Firefox.app/Contents/MacOS/firefox -inspector http://www.google.com/
  |-
  |-
  | chrome <url>
  | chrome <url>
  | Loads the specified chrome.
  | Loads the specified chrome.
  | firefox.exe -chrome chrome://inspector/content/inspector.xul
  | /Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://inspector/content/inspector.xul
  |-
  |-
  | new
  | new
  | Loads a new browser window.
  | Loads a new browser window.
  | firefox.exe -new
  | /Applications/Firefox.app/Contents/MacOS/firefox -new
  |-
  |-
  | install-global-extension "<path>"
  | install-global-extension "<path>"
  | Installs an extension globally.
  | Installs an extension globally.
  | firefox.exe -install-global-extension "C:\Temp\extension-file.xpi"
  | /Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension "path/extension-file.xpi"
  |}
  |}



Revision as of 20:55, 23 February 2006

You can use command line arguments to start your Mozilla application with special behaviour.

How to use command line arguments

For Windows users

  • Go to "Start -> Run" and enter the file path and file name of the application, followed by the command line arguments. For example,
"C:\Program Files\Mozilla Firefox\firefox.exe" -ProfileManager

(including the quotation marks). In this example the file path to the installation directory is C:\Program Files\Mozilla Firefox, the file name of the Firefox application is firefox.exe, and the command line argument we are using is ProfileManager. You should place a hyphen (-) directly before each command line argument that you wish to use.

  • If you regularly wish to start your application using command line arguments then you can also create a shortcut on your Desktop which includes them. To do this, right-click on an open space of the desktop and choose "New -> Shortcut". Follow the wizard to create the new shortcut. When it prompts you for location (not name), type the file path and file name followed by the command line arguments, exactly as in the example above.

For Linux and Mac OS X users

  • Go to your Terminal window and type what you want to execute. On Linux, the shortcuts to your Terminal window will vary in location depending on your desktop environment. On Mac OS X go to your Applications/Utilities folder and choose "Terminal".

List of command line arguments (incomplete)

See also the external links at the bottom of this article.

Command Result Example (Mac)
profile "<path>" Starts Firefox with profile located at the given path. /Applications/Firefox.app/Contents/MacOS/firefox -profile "path/myprofile"
P "<profile name>" Starts Firefox with a given profile name (profile name is case sensitive). /Applications/Firefox.app/Contents/MacOS/firefox -P "Joel User"
<url> Launches Firefox and opens the given URL(s). /Applications/Firefox.app/Contents/MacOS/firefox "www.mozilla.org|www.mozillazine.org"
safe-mode Launches Firefox without loading extensions or themes. /Applications/Firefox.app/Contents/MacOS/firefox -safe-mode
height <value> Sets height of the startup window to <value>. /Applications/Firefox.app/Contents/MacOS/firefox -height 600
width <value> Sets width of the startup window to <value>. /Applications/Firefox.app/Contents/MacOS/firefox -width 800
ProfileManager Starts with Profile Manager. /Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager
UILocale <locale> Starts with <locale> resources as UI Locale. /Applications/Firefox.app/Contents/MacOS/firefox -UILocale th-TH
contentLocale <locale> Starts with <locale> resources as content Locale. /Applications/Firefox.app/Contents/MacOS/firefox -contentLocale TH
console Starts Firefox with a debugging console. /Applications/Firefox.app/Contents/MacOS/firefox -console
jsconsole Starts with Javascript Console. /Applications/Firefox.app/Contents/MacOS/firefox -jsconsole
inspector <url> Starts with the DOM Inspector. /Applications/Firefox.app/Contents/MacOS/firefox -inspector http://www.google.com/
chrome <url> Loads the specified chrome. /Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://inspector/content/inspector.xul
new Loads a new browser window. /Applications/Firefox.app/Contents/MacOS/firefox -new
install-global-extension "<path>" Installs an extension globally. /Applications/Firefox.app/Contents/MacOS/firefox -install-global-extension "path/extension-file.xpi"

See also

External links