Skip Ribbon Commands
Skip to main content

Quick Launch

From The Field > Posts > Saved By Google Chrome Frame: SharePoint 2010 and IE6 Story
May 04
Saved By Google Chrome Frame: SharePoint 2010 and IE6 Story

​You wouldn't expect anyone on this blog to advocate a competitor's technology... but this case is special.

To cut a long story short, a customer found themselves in a situation where a SharePoint 2010 implementation plan collided with the presence of thousands of desktops across the estate still running IE6. Now, for those who may not know – these two products have severe compatibility issues, where SharePoint 2010 pages effectively cannot be viewed in IE6 – or at any rate this is not acceptable user experience.

Upgrading the browser across a massive user base, also having to test a bunch of internal LOB applications is a task the complexity of which I hopefully do not need to explain – which is why the customer resorted to using Google Chrome Frame as an interim solution. GCF is a plug-in to IE that can be fairly easily deployed, and which does a half-decent job rendering SharePoint pages. So, on the surface the solution seemed quite straightforward: deploy the plug-in to all affected workstations, enforce the rendering of the SharePoint 2010 site pages by setting the value of the appropriate registry key with a GPO – job done! However in reality, the following issues made it much easier said than done:

1) For some reasons that we won't mention here, Chrome Frame was also to be deployed to workstations that have IE8 on them – however the requirement was that only IE6 users should have SharePoint pages rendered by Chrome Frame. IE8 users should have them rendered natively – meaning that setting the appropriate registry value would require much more complex Group Policy configuration. A good alternative would be controlling the rendering from the server side using the appropriate HTML metatag or equivalent HTTP header (‘X-UA-Compatible’), the problem being that SharePoint sets the value of it itself – to ‘IE8’, of course.

2) Most SharePoint pages using the default master page (V4.master) have a control embedded in them that causes a warning message to pop up if IE6 is detected:

<SharePoint:WarnOnUnsupportedBrowsers runat="server"/>

This happens every time – irrespective of whether ChromeFrame is present or not, as the latter only adds its signature to the end of the User-Agent string, the browser still identifying itself as IE6:

Unsupported Browser Warning Message

The solution, after some serious head-scratching, came from the side of SharePoint 2010's wonderful infrastructure of delegate controls. If we look at our default master page again, we may notice a particularly useful little piece in the <head> section:

<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>

Now, the AllowMultipleControls property here means that this delegate control can have multiple child candidate controls that will all be added to the page at runtime - which presents us with a really powerful customisation engine indeed! To solve the little problem described above, all I had to do was:

1) Create a custom candidate control and solution as per 'How to: Customize a Delegate Control' (obviously with my own names, etc.);

2) Override the OnInit method as follows:

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            SPWeb contextWeb = SPControl.GetContextWeb(this.Context);
            if ((contextWeb != null) && (contextWeb.UIVersion >= 4))
            {
                HttpBrowserCapabilities browser =  
                  HttpContext.Current.Request.Browser;
                
                //Check if browser is unsupported
                if ((browser != null) && (((browser.Browser == "IE") && 
                 (browser.MajorVersion < 7)) || ((browser.Browser == "Firefox"
                 && (browser.MajorVersion < 3))))
                {
                    //Check if Chrome Frame is present
                    if (HttpContext.Current.Request.UserAgent.Contains
                    ("chromeframe"))
                    {
                        foreach (Control c in this.Page.Master.Controls)
                        {
                            //Iterate through the collection of controls to 
                            identify the target ones;

                            foreach (Control childc in c.Controls)
                            {
                                //Hide (i.e. disable) the OOB warning control
                                if (childc is 
                     Microsoft.SharePoint.WebControls.WarnOnUnsupportedBrowsers)
                                {
                                    childc.Visible = false;
                                }
                                //Iterate through the collection of metatags
                                else if (childc is 
                                 System.Web.UI.HtmlControls.HtmlHead)
                                {
                                    foreach (Control meta in childc.Controls)
                                    {
                                        try
                                        {
                                            //Overwrite the value of the X-UA-
                                            Compatible tag, forcing user's 
                                            browser to engage GCF for rendering

                                            if (((HtmlMeta)meta).HttpEquiv == 
                                            "X-UA-Compatible")
                                            {
                                                ((HtmlMeta)meta).Content = 
                                                "chrome=1";
                                            }
                                        }
                                        catch { }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

Once this solution is deployed, any user hitting any SharePoint page with IE6 with GCF plug-in installed will have that page rendered by GCF and will not see the warning pop-up message. IE8 will render SharePoint pages natively, and IE6 users that do not have Google Chrome Frame will still see the warning...
 
Simples!

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title (required) *


Body (required) *

Name (required) *


Are you a bot? *


Anti-Spam Filter 1

What's 10+4? *


Anti-Spam Filter 2

CommentUrl


Attachments