Date: Mon, 30 Apr 2012 08:47:21 -0700 From: Evan Martin <evan@chromium.org> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: chromium@freebsd.org, hackers@freebsd.org Subject: Re: how to display C sources in Chromium (file:/// only) Message-ID: <CAFzwtj3TDpxHs93dc0PGM-JcxFPNL%2B2kUtsfcZDi-AhqZBS2hQ@mail.gmail.com> In-Reply-To: <20120428144745.GA40844@onelab2.iet.unipi.it> References: <20120428144745.GA40844@onelab2.iet.unipi.it>
index | next in thread | previous in thread | raw e-mail
On Sat, Apr 28, 2012 at 7:47 AM, Luigi Rizzo <rizzo@iet.unipi.it> wrote:
> (hoping this is of interest for hackers- too)
>
> One of the most annoying features of chromium is that it downloads
> instead of displaying various types of files (.c, .h and so on).
This has long annoyed me too!
> it seems that a partial fix can be achieved by arring the list of
> types we want to display to the array
>
> static const char* const supported_non_image_types[] = {
> ...
> + "text/x-csrc",
> + "text/x-chdr",
> ...
> }
There's a comment at the end of the block:
// Note: ADDING a new type here will probably render it AS HTML. This can
// result in cross site scripting.
I wonder how to tell?
If you follow the references back from the definition of this variable
it appears to end up used here:
http://code.google.com/searchframe#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/loader/FrameLoader.cpp&exact_package=chromium&ct=rc&cd=10&q=IsSupportedNonImageMimeType&l=859
which just indicates it's used when WebKit is deciding whether to
inline the content or not.
It seems to me like you could adjust the code in
MimeUtil::IsSupportedNonImageMimeType to always return true for any
text/* mime type.
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFzwtj3TDpxHs93dc0PGM-JcxFPNL%2B2kUtsfcZDi-AhqZBS2hQ>
