OK, let me try again.
[A little background:]
Our custom application is used to generate quick shot of certain pages.

[Q1:]
Generally, I use presShell->RenderDocument() render out the page in memory
and then get cairo_surface_t from gfxContext. By cario I write the
cairo_image_surface_t.data into a ppm file.
Unfortunately, I can't write a flash into file with cario. Is this correct?
Is there any solution for this situation?

[Q2]
Regarding flash, I intend to do screen capture by Gtk. Firstly bind a Gtk
window to the baseWindow and then dump the pixels in the window.
Thus, I need to know whether the page contains a flash block.
By detecting mimeType is not a reliable way to do this. the reason?
My way to detect the mimeType:
1) In BindToTree, get the first presShell from nsIDocument (GetOwnerDoc),
and GetTypeAttrValue(type);
set the type in this presShell.
2) when the load process come back to WebBrowserlistener, in
OnStateChange(), I get the type from the presShell (<= docShell <=
aProgress).

Most of the pages with flash can be detected with mimeType =
"application/x-shockwave-flash".
But there are still some exceptions, such as http://www.icebreaker.com and
http://www.rugby.com/.
It seems I can't get the aProgress (docShell) in OnStateChange() related
with the flash block (I'm not sure).
or even the flash block in some special format will not be binded to a dom
tree?

Any other suggestions?

Thanks very much!
- Havvy


Boris Zbarsky wrote:
> 
> Havvy wrote:
>> I mean I want to tell if there are flash or video in a page by detecting
>> the
>> mimeTypes of it's every document.
> 
> That's not really a reliable way to detect either flash or video...
> 
>> I get the Type by GetTypeAttrValue() in
>> nsHTMLSharedObjectElement::BindToTree() and set it in the related
>> PresShell.
> 
> There might not be a presshell specifically for the 
> nsHTMLSharedObjectElement (and in fact there is not in the flash/video 
> case).
> 
>> I'm not sure is it clear?
> 
> Not really.  :(
> 
>> It seems I can't catch the aProgress of the "<div> " in the call back
>> OnStateChange().
> 
> Especially this part...
> 
> -Boris
> _______________________________________________
> dev-embedding mailing list
> dev-embedding@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-embedding
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-Mimetype-from-firefox-tp24369333p24393181.html
Sent from the Mozilla - Embedding mailing list archive at Nabble.com.

_______________________________________________
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to