Community
Participate
Working Groups
This method always returns null. Having it return the correct Browser is needed for proper parenting of JS-triggered dialogs, and also for proper handling of encountered invalid certificates. It's not obvious how to do this since this handle is not passed to the methods in Prompter the way it is for PromptService2. My guess is that perhaps there's a service that can be queried for the current active/focused Mozilla instance.
Used nsIFocusManager.GetActiveWindow() to get the nsIDOMWindow. Pushed to xulrunner-work branch --> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=xulrunner-work&id=65dd96247b1f002653bbf60044c8687bff1299c2
Lakshmi can you amend a change to your patch? Since you're using getActiveWindow() you don't have to getTop() on it because it is always the top-level window (I've verified this with a case involving frames). So the two places where you invoke Mozilla.getBrowser() can be simplified to: if (rc == XPCOM.NS_OK && result[0] != 0) { Browser returnValue = Mozilla.getBrowser (result[0]); new nsISupports (result[0]).Release (); return returnValue; }
Hi Grant, I have made a different fix for this. nsIFocusManager.GetActiveWindow() returns null sometimes (eg, when using prompt auth dialog). I noticed that nsIPromptFactory.GetPrompt() has the parent handle. This fix uses the handle directly. Can you please see if it looks fine? --> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=xulrunner-work&id=b61ae33ff2ea5e11534c3f3d7248268dd89fc4e5
Yes, looks good, thanks!