Michel Gutierrez wrote:
Anyway, I have something that almost works. I created a component with nsIPromptService CID

Don't do that. Use an own CID.

To get the previous one by CID:
var realService = Components.classesByID["{A2112D6A-0E28-421f-B46A-25C0B308CBD0}"]

.getService(Components.interfaces.nsIPromptService);


and "@mozilla.org/embedcomp/prompt-service;1" ID.
Just before registering this component, I get the former prompt service and store it. If I do so after registration, I get into a stack overflow.

Of course, since if you get it after registration, you get yourself...

It is working just fine for alert, confirm, promptUsernameAndPassword functions, but strangely enough, it doesn't work for prompt(). If a javascript code invokes the function prompt("Enter your name"), none of my code is called and nothing happens.

Hmm, I'm not sure why this isn't working...

I suspected the JS prompt() function to use nsIPrompt on "@mozilla.org/network/default-prompt;1" instead of nsIPromptService, so I wrote another component to override this, but I still don't get anything.

That's only used for proxy authentication, IIRC.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to