[webkit-qt] Intercept calls to unkown mime types
Felipe Crochik
felipe at crochik.com
Fri May 7 16:30:01 PDT 2010
Richard,
Thank you. I had tried this first without success. After reviewing your
email I decided to try again to make sure I did not miss anything. I found
out that the issue is really that the web site I used for my tests, it does
identify mp4 files as mime type "text/plain". Because I had tested on
firefox and had worked I assumed the problem was with my implementation and
not that the mime type could be wrong.
It seems that firefox (at least the windows version) does not trust, at
least only, the mime/type provided by the server. It is either checking the
file contents for known types or is, most probably, checking the file
extension on the URL.
In other words exactly what I was trying to avoid (relying on the file
extension on the URL) is the solution used.
Felipe
-----Original Message-----
From: Richard Moore [mailto:richmoore44 at gmail.com]
Sent: Friday, May 07, 2010 5:27 PM
To: Felipe Crochik
Cc: webkit-qt at lists.webkit.org
Subject: Re: [webkit-qt] Intercept calls to unkown mime types
On Fri, May 7, 2010 at 8:44 PM, Felipe Crochik <felipe at crochik.com> wrote:
> My goal is to use external applications to deal with urls (like mp4, pdf)
> that the webkit can't by default.
>
> Webkit "handles" mainly html and images but does not know what to do with
> other file formats like pdf, mp3, mp4,... I found out where you can allow
or
> stop on Url from being loaded but all the information I have to decide is
> the url itself.... I would like to inquiry the server about it so I can
use
> the mime type on the header to decide instead.
>
> My obvious idea is to just request the head on the acceptNavigationRequest
> but it seems somewhat redundant (or worst) because in most cases I will
find
> out that it is a type that I actually will want to allow webkit to handle
> and webkit will have to request the same url again. Is there another way
> out? Some other slot on webframe, webframeloader?
Look at:
http://doc.trolltech.com/4.7-snapshot/qwebpage.html#unsupportedContent
and
http://doc.trolltech.com/4.7-snapshot/qwebpage.html#forwardUnsupportedConten
t-prop
and you should find just what you want.
Cheers
Rich.
More information about the webkit-qt
mailing list