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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.