On 4/13/10 9:30 AM, Babele Dunnit wrote:
I am implementing a simple redirection mechanism: I want to redirect
and load PDFs on Google Docs. So I redefined
nsIURIContentListener::IsPreferred so that, when I detect an
"application/pdf" MIME type, I just mangle the URI to point on google
docs and re-issue a nsIWebNavigation::LoadURI on the mangled address.

Redefined that on which nsIURIContentListener implementation?

It works, BUT when clicking on an A node of the form

<a target="_blank" href="../pdf/srlabs_corporate-it.pdf">SR Labs
brochure aziendale 2008</a>

the IsPreferred method is not called

It sure should be called, if I read the code right. Depending on your answer to the above question, of course.

Any clue about how to implement the thing in a more robust way?

Implement an nsIContentHandler or generic nsIURIContentListener registered for the PDF type? That would catch all PDF loads too, not just ones triggered via links...

-Boris
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to