16.2. General-Purpose Scripting

This topic explains how to solve generic programming tasks using Mozilla.

16.2.1. Command-Line Arguments

When the Mozilla Platform is started up via the command line, it remembers the command-line arguments passed in. On Microsoft Windows, the platform does not remember the command-line arguments used to start up further windows that are managed by the same running instance.

To access the command-line arguments, use this component and interface:

@mozilla.org/appShell/commandLineService;1 nsICmdLineService

The nsICmdLineService exposes argc, the count of arguments, but not argv, the list of strings making up the arguments. The argc count is the number of argument-value pairs, not the number of whitespace-separated ...

Get Rapid Application Development with Mozilla™ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.