cannot open a prompt in MCD



8 years ago
3 years ago


(Reporter: raphael.ouazana, Unassigned)


Firefox Tracking Flags

(Not tracked)




8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv: Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110223 Thunderbird/3.1.8


Using MCD (aka autoconfig), it is not possible to create a prompt with the nsIPromptService. This is very useful to ask the user for its email and then get some specific parameters.
It works fine with TBird 2 but fails in TBird 3 with the following error message:
Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPromptService.prompt]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: <unknown filename> :: _displayPrompt :: line 201"  data: no

Reproducible: Always

Steps to Reproduce:
Reproductible in Windows too, so seems to be not related to #400810 

1. Configure MCD, see for example.
2. Try to open a prompt (or an other window anyway) in the autoconfig.js file:
const promptService = Components.classes[";1"].getService(Components.interfaces.nsIPromptService);
promptService.prompt(null, title, text, input, null, {});
Actual Results:  
The window is not opened and the following error can be caught:
Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPromptService.prompt]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: <unknown filename> :: _displayPrompt :: line 201"  data: no

Expected Results:  
The prompt should be opened.

After some debugging, it seems that it is the call to sm->GetSubjectPrincipal in nsWindowWatcher.cpp:591 that is failing, but I can't see why either this call is failing or it is needed.

Raphaël Ouazana.
GetSubjectPrincipal is needed to give the new window the right security context, in general.

I wouldn't expect it to fail if the window open comes from JavaScript.  But maybe something in the MCD code is messing with security contexts?
Component: General → LDAP Integration
Product: Core → MailNews Core
QA Contact: general → ldap-integration

Comment 2

8 years ago
Is there any way to explicitly define the principal in the script (eventually as anonymous)?
Not really, no.  If there's script on the stack, its principal should be used....
I just tested this with the latest Thunderbird (and Firefox) and it is working for me.

Can you try with the latest build?
Raphaël ?

Comment 6

7 years ago

I am not able to test this for the moment, but a colleague will do in some weeks.

Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.
This is working for me. I'm closing,
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.