Mats Bryntse's Blog

IE6 Frame to battle Chrome Frame?

Posted in Misc by Mats Bryntse on November 13, 2009

So another day at work was destroyed by IE6, what else is new.

Google announced a while back that Wave won’t be supported on IE without the use of “Chrome frame”. This is basically the chrome browser injected into IE. So at Microsoft, they’re probably working hard on an IE6-frame to get some market shares back. This hypothetical addin would allow you to get the nice IE6 unexpectable rendering we all love so much in any non IE-browser. But why wait, I’ve just created a beta version of the IE6-frame. Sounds too good to be true? It’s not.

Here’s the code:

$(function() {
	$('body *').each(function(i, el) {
       ie6ize(el);
    });
    
    /*
        Emulate IE-6 rendering
        @param node, the poor node to get "the treatment"
    */ 
    function ie6ize(node){
        switch (Math.floor(Math.random()*11)) {
            case 0:
                $(node).css('float', 'left');
            break;
            
            case 1:
                $(node).css('margin-left', '10px');
            break;
            
            case 2:
                $(node).css('width', '102%');
            break;
            
            case 3:
                $(node).css('height', '110%');
            break;
            
            case 4:
                $(node).css('position', 'absolute');
            break;
            
            case 5:
                $(node).css('display', 'inline');
            break;
            
            case 6:
                $(node).css('color', '#fff');
            break;
        }
    }
});

So what does this do for me you ask? See the before and after images below.

Ajaxian before:
Ajaxian before

Ajaxian IE6-ized:
IE6-ized

Twitter before:
Twitter before, boring expected look

Twitter IE6-ized:
Twitter ie6-ized

If you want to use this in a commercial application, please contact me at ……. no not really :)

15 Responses

Subscribe to comments with RSS.

  1. uberVU - social comments said, on November 13, 2009 at 8:43 pm

    Social comments and analytics for this post…

    This post was mentioned on Twitter by dalmaer: Move over Alex Russell. IE6 frame is here! :) http://bit.ly/1BfESn

  2. Alex M. (Viper007Bond) said, on November 13, 2009 at 9:16 pm

    Haha, that’s awesome! :)

    BTW, you should add language="javascript" onto that sourcecode tag.

  3. Lior Cohen said, on November 13, 2009 at 10:21 pm

    Haha. Good stuff. :D

    Too bad it’s not entirely over, yet.

  4. John Fox said, on November 13, 2009 at 10:27 pm

    As someone who used to suffer mightily trying to make things work in IE6, I got a serious laugh out of this, so many thanks. Now that I’m older and wiser, I simply refuse to support IE6, and I feel terribly sorry for anyone who has to.

  5. Mats Bryntse said, on November 13, 2009 at 10:43 pm

    Glad to make you laugh, topics including “IE6″ doesn’t tend to make developers laugh – rather the opposite :)

  6. phiggins said, on November 13, 2009 at 10:43 pm

    This code could be greatly simplified.

    http://gist.github.com/234226

    the switch/case could use a serious DRY pass to reduce size, and it is unfortunate jQuery passes the element as the second argument to each, otherwise you could pass a function reference rather than instantiating 2 new jQ objects in this simple code, one which is created for every element in the document ( $(node).css(..) )

  7. Mats Bryntse said, on November 13, 2009 at 10:56 pm

    I dare anyone to use this in a commercial application, only being enabled for browsers != IE6

  8. Ben Alman said, on November 13, 2009 at 11:35 pm

    Mats, I’ve simplified your excellent code and made it into a proper jQuery plugin:

    http://gist.github.com/234256

    - Ben

  9. Mats Bryntse said, on November 13, 2009 at 11:42 pm

    Excellent! Now if someone could send it over to mr Resig and get it published on the official jQuery plugins page, I’d be very impressed :)

  10. Ben Alman said, on November 13, 2009 at 11:44 pm

    And here’s a link to a Bookmarklet version of the plugin:

    http://bit.ly/ie6ize

    - Ben

  11. [...] IE6 Frame to battle Chrome Frame? « Mankz’s Blog a few seconds ago from identichat [...]

  12. Top Posts « WordPress.com said, on November 15, 2009 at 12:38 am

    [...] IE6 Frame to battle Chrome Frame? So another day at work was destroyed by IE6, what else is new. Google announced a while back that Wave won’t be [...] [...]

  13. Cmdr Clint said, on November 17, 2009 at 11:48 am

    I LoLed :P

  14. Allen Liu said, on December 9, 2009 at 10:39 pm

    Mats, this is too funny.

  15. Joshua Issac said, on February 8, 2010 at 9:10 pm

    Can I use it in newer versions of IE? (I.E., IE8)

    I would like to use DirectAnimation and Gopher in IE8.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.