It seemed that I SHOULD be able to get an instance of nsICommandLine
(from @mozilla.org/toolkit/command-line;1) and be able to call its
findFlag("console", false) method. But this did not work (it returned -1).
I also tried a loop from 0 < nsICommandLine.length calling
nsiCommandLine.getArgument() and looking at the results. But the length
property returned 0 and so that was a non-starter as well.
I note that nsICommandLine also includes a removeArguments() method and
I wonder if that could have been called somewhere along the line
removing the -console that I KNOW I passed in (I can see the console
window on Windows).
Thanks for any pointers here.
Are you making a new instance of nsICommandLine (or rather,
@mozilla.org/toolkit/command-line;1)? It's not a service, and the only
valid command line (well, the command line that actually launched the
app) probably got dropped pretty early on. Making a new command line
would of course not give you the parameters you want...
As far as I'm aware the only way to get a useful nsICommandLine is to
implement a nsICommandLineHandler (which gets passed in a nsICommandLine
from... umm, whoever has the actual thing.)
HTH,
--
Mook
mook dot moz plus stuff at gmail dot commandline