Michel Gutierrez wrote:
This works just fine. Many thanks Christian !

You're welcome!

In fact, I realized that I mixed up interface (nsIPromptService) and service (@mozilla.org/embedcomp/prompt-service;1) CIDs. How did you get the service CID (A2112D6A-0E28-421f-B46A-25C0B308CBD0) from ?

Ah. Interface IDs are usually called IIDs (or the more generic UUID of course), not CID which stands for class ID.

The way I did it was search Mozilla's source code for NS_PROMPTSERVICE_CID defines, and then I picked the right one... but another way to do it is to look in compreg.dat in a build w/o your extension's override registered and check the CID for the contract ID you are looking for. You can also do this programmatically (http://lxr.mozilla.org/seamonkey/source/xpcom/components/nsIComponentRegistrar.idl#223); again, do it in a build where your override isn't registered.

Component viewer (cview) is a third possibility, and maybe the easiest one. Seems to be available from addons.mozilla.org.

Even if the JS prompt() function does not invoke my code, I get it called when for instance I add a new config entry from about:config

That one probably calls the prompt service directly, JavaScript's prompt doesn't, although it should end up calling it in the end.

Do you have an idea where I can get in the source the implementation for the javascript prompt function ?

The code is here:
http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#3268
which calls:
http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsGlobalWindow.cpp#3225

I hope that helps...
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to