I'm working for a company who builds automats. In the application we
develop in France, the user's interface is a web Browser.
We choose to use mozilla, and I developped gecko, because we need to
control all the processes.
We are loading pages with javascript, and we need to know when there
is a Javascript error.
What I need to do is to trap the JS errors as mozilla do it qhen it
puts JS or CSS error into the JS console.
But I don't know when and how to do that.
I looked at nsiJSConsoleService , nsIConsoleMessage, nsIScriptError....
But I did'nt find any way to do what I want.
First what have I to do : have I to register a listener to a service
(maybe the JS engine), in oder to be informed for errors.
When have I to do that, on each page (during my progress listener's
functions as I do for JSFunctionsDefinition (int the chrome)), or just
once when I create the browser ?
What object do I listen to , what objects do I get.........
I've only questions and no response....
Thank's a lot
Philippe
Get the nsIConsoleService and call registerListener on it.
Which you could tell from the source code of the JS console, btw.... ;)
> First what have I to do : have I to register a listener to a service
> (maybe the JS engine), in oder to be informed for errors.
See above.
> When have I to do that
Depends on when you want to start listening. If you always want to listen, just
do it at startup.
-Boris
Thank's very much for your help
It was very usefull.
philippe