Hi, I implement and provide a nsIURIContentListener via nsIWebBrowser.SetParentURIContentListener(...).
Works as expected, at least on the surface: If I navigate directly to a url that is a pdf (I have the Acrobat reader plug-in installed) then after calling my nsIURIContentListener.OnStartURIOpen(...) implementation it opens the acrobat reader and document in-place, which seems good. Does not work as expected: Instead, if I click on a link that points at this same url then after calling my OnStartURIOpen(...) implementation it then calls my IsPreferred(...), and then fails to open. The IsPreferred(...) implementation sets aDesiredContentType to null and returns true, but none of my other nsIURIContentListener methods subsequently get invoked. As an experiment I stopped providing a nsIURIContentListener implementation, and this made the second scenario open in-place like the first. So the presence of my nsIURIContentListener implementation is changing the behaviour of the second scenario. However this listener is needed. So my questions are: - Is it expected that nsIURIContentListener.IsPreferred(...) gets called when clicking on a link but not when navigating directly to a url? - Is nsIWebBrowser.SetParentURIContentListener(...) the correct way to provide a nsIURIContentListener implementation? I also tried adding it as a parent content listener to the nsIWebBrowser's nsIDocShell but this did not seem to help. - Is my IsPreferred(...) implementation doing something wrong? (sets aDesiredContentType to null and returns true) Thanks in advance, Grant _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
