

Rack::ChromeFrame, easy Google Chrome Frame integration for Ruby apps - luigi
http://github.com/sunlightlabs/rack-chromeframe/

======
simonw
This should check the Content-Type header and only modify text/html -
otherwise it might mangle outgoing JavaScript / XML / etc files.

~~~
luigi
Thanks, fix just pushed up.

------
judofyr
Shouldn't this _first_ check if Chrome Frame is actually used (by using the
User-Agent header) before it injects the code? And why not just place the four
lines straight into your layout?

~~~
evdawg
I feel like a complete jerk for saying this (partly because Sunlight Labs is a
non-profit), but it suffers from what I like to call the snippet marketing
syndrome: 4 - 5 lines of code being fancied up into a 10 - 30 line "plugin"
with heavy references to the consulting studio that 'coded' it.

~~~
judofyr
But, but, it's _Rack_! Everything related to Rack is awesome.

~~~
evdawg
I wonder what the overhead of doing this as Rack Middleware is versus just
putting it into your layout.

This is markup, it belongs in your layout files. You're really just
disorganizing your app by putting this into middleware.

~~~
bts
I think the biggest disadvantage of putting something like this in middleware,
is that it's completely incompatible with stuff like memcache. The injection
of this meta-tag is done after a memcache SET would have been done in the web
app, and so if you have a reverse proxy in front of your webserver, for any
cached page that's served, it won't include the injection. Also, the user-
agent check that's being done in this plugin yields incorrect results in the
presence of caching for similar reasons.

------
tamersalama
nice - but looks like it doesn't take into consideration the user agent.
[http://github.com/sunlightlabs/rack-
chromeframe/blob/master/...](http://github.com/sunlightlabs/rack-
chromeframe/blob/master/chrome_frame.rb)

~~~
luigi
You're right, a check for User-Agent needs to be put in there.

------
petercooper
Didn't use the plugin but used the code snippets on a site just to test it out
and.. I think Google need to slicken it up a bit first. The installation
overlay blocks out most of the site on IE6 and doesn't seem to be closable.
I'm guessing this is really meant for sites that _demand_ it be installed
rather than an optional thing - but if that's true, why not just redirect?

~~~
luigi
Peter, see the developer's comment here:

[http://groups.google.com/group/google-chrome-
frame/browse_th...](http://groups.google.com/group/google-chrome-
frame/browse_thread/thread/80f9488134473c9d/a27315d0c7085106)

~~~
petercooper
Useful info - thanks.

