addWebBrowserListener should be the common listener registration location. nsIWebProgressListener, nsIURIContentListener, etc.
per email with Jud, changing nsbeta3+ to nsbeta3- on all "embed" keyword bugs since embedding changes will not be made in the mn6 branch. If you feel this bug fix needs to go into mn6 branch, please list the reasons/user impact/risk and nominate for rtm. Thanks.
Updating QA Contact
I've pulled out the old, unused registration impl, and added the new one (as discussed in npm.embedding -> "nsIWebBrowser" in the subject). nsWebBrowser no longer supports nsIWebProgress. My only concern here is that people are using nsWebBrowser's GetDOMWindow() method (which is part of nsIWebProgress). I see two potential use problems. 1. nsWebBrowser, as a nsIWebProgress, is being passed around in nsIWebProgressListener callbacks. Those callbacks then use GetDOMWindow(). 2. People are QI'ing nsWebBrowser for nsIWebProgress and directly using GetDOMWindow(). I think #2 is easy to fix, as you can get a nsIDOMWindow off of nsIWebBrowser itself. #1 seems hard, but is only an issue if nsWebBrowser is ever registered as a nsIWebProgress (which it currently is not). attatching patch.
after poking around a bit more, nsWebBrowser doesn't register itself as a progress listener, so I suspect I'm in the clear (unless someone's using it internally as a listener :-/); thoughts? All the current GetDOMWindow() calls are done inside a webprogresslistener callback for usage case #2 isn't an issue.
This patch looks great... (r=rpotts) or (sr=rpotts) - whichever you want :-) -- rick
fix is in.
Verified fixed -- source changed
reopening. change of direction here. the singleton listeners should still register using the Add|Remove listener methods on nsIWebBrowser. The multi listener semantics can be mainted by maintaining a list of registered listeners in the nsWebBrowser impl. The nsWebBrowser would make itself a singleton listener when necessary, and fan out the listener callbacks to multiple listeners if necessary.
closing, again. see http://www.mozilla.org/projects/embedding/listeners.html for usage info.
Correction: Changing QA contact for the Embed API bugs to David Epstein.
nsIWebBrowser::addWebBrowserListener() is the definitive way to register listeners. I tried other add listener methods (e.g. addProgressListener()) and they didn't work in MFCEmbed. (I've since found out they're private methods).