I'm writing extension for FF/Mozilla, which communicate with some service with XML-RPC like protocol.
Service can be setted up in different ways (it is whole class of intranet/internet services, not one specific, like gmail): with or without HTTP authorization, with different realms, and different auth mechanisms.
I'm using nsIXMLHttpRequest.
If authentication is configured, standard "Username/Password" dialog is popping out. But at this point (browser starts and extension ask for configuration from service) it is rather surprise for user: she doesn't go any URL and browser asks for Username/Password with generic dialog (and, very often, realm is nott to helpful too, because many admins forget to set meaningful realm name)!
Is it possible to replace this dialog for my request? I want to create custom dialog, which explain WHY exactly these username/password are asked at this time.
--
Best regards,
Lev mailto:l...@serebryakov.spb.ru
Saturday, March 24, 2007, 11:26:51 AM, you wrote:
LS> Is it possible to replace this dialog for my request? I want to
LS> create custom dialog, which explain WHY exactly these username/password
LS> are asked at this time.
I'm found answer: I need to set channel.callbacks and answer to request for nsIAuthPrompter. It works.
Thanks.
Alex
An example getInterface implementation creating the default authprompt is here:
http://lxr.mozilla.org/mozilla/source/toolkit/mozapps/update/src/nsUpdateService.js.in#2563
You need to return your own implementation of nsIAuthPrompt from your
getInterface instead.
Nickolay
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
> Not an example, but Lev probably meant to set xmlhttprequest's
> |notificationCallbacks| property to an object implementing
> nsIInterfaceRequestor.
>
> An example getInterface implementation creating the default authprompt is here:
> http://lxr.mozilla.org/mozilla/source/toolkit/mozapps/update/src/nsUpdateService.js.in#2563
>
> You need to return your own implementation of nsIAuthPrompt from your
> getInterface instead.
Exactly.
--
// Lev Serebryakov
Thanks,
Alex.
--
// Lev Serebryakov
Thanks,
I will try.