WSS3 and MOSS 2007 issue “The Web site wants to run the following add-on: 'Name ActiveX Control'” and how this affected the page load time

During the pre-production version of a public WCM site we were experiencing some strange delay problems with the loading of the first page visited on the site. The MOSS site is configured with dual authentication providers and anonymous access.
When viewing the first request in a session we sometimes had a wait of 20 to 30 seconds (!), the page would load until the body tag, begin loading the CSS and the background would show. After that we had to wait until the rest of the page loaded.
It was really the page loading until background color appeared, then the 20 second wait until the rest of the page was loaded.
My first though was there was something wrong with connectivity to the server but then we were having the same speed problem when requesting the page on the server locally.
We also did some stress testing to see page response times and the results were rather good as well. No server load problem either then.

Some of the test users were also mentioning a problem with an ActiveX control message “The Web site wants to run the following add-on: 'Name ActiveX Control”.

We decided to apply the workaround/solution proposed by the Microsoft KB article 931509: Message in the Information bar in Internet Explorer 7 when you browse to a Windows SharePoint Services 3.0 site or to a SharePoint Server 2007 site: "The Web site wants to run the following add-on: 'Name ActiveX Control'"

Cause of the problem is the Name ActiveX control (Name.dll) that is called by a SharePoint JavaScript file named “init.js”, has not been added to the list of preapproved controls in Internet Explorer 7. The Name ActiveX control is included in the 2007 Microsoft Office system.

There are two workarounds that require changes on the client computer: not a solution for an internet public site.
The third workaround is to adapt a JavaScript file so that the ActivX contol does not get loaded or called anymore. This is the only acceptable workaround for me.

Implementing the workaround

Even if you are using a custom master page chances are you kept the call to the init.js file as this:

<SharePoint:ScriptLink language="javascript" name="init.js" runat="server"/>

This server call generates a <script> tag on the page that fetches the init.js from the locale folder. The ini.js file can be found on the 12 hive, normally “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033” for a US English version. If you installed a different language or use language packs then replace the 1033 by your locale. Also remember to apply the change to all language packs.

The change that we need to do in this init.js file is simply put the line that makes the ActiveX call in comment. Open up the init.js file (make sure to keep a backup both of the original and your version), locate the following section (it’s the last function in the file):

function ProcessDefaultOnLoad(onLoadFunctionNames)
{
 ProcessPNGImages();
 UpdateAccessibilityUI();
 ProcessImn();
 for (var i=0; i < onLoadFunctionNames.length; i++)
 {
  var expr="if(typeof("+onLoadFunctionNames[i]+")=='function'){"+onLoadFunctionNames[i]+"();}";
  eval(expr);
 }
 if (typeof(_spUseDefaultFocus)!="undefined")
  DefaultFocus();
}

Put the ProcessImn() function call in comment:

function ProcessDefaultOnLoad(onLoadFunctionNames)
{
 ProcessPNGImages();
 UpdateAccessibilityUI();
 //ProcessImn();
//rest of function

This is not exactly the proposed workaround by the KB article but I don’t really get their approach of just putting the function declaration in comment. I don’t even think that will work correctly since the function call still exists and will probably give a JavaScript error (or maybe I’m just missing something there). Anyway, IMHO putting the function call itself in comment is more effective.
I should mention also that creating the new initNoPresence.js file and using that instead of the ini.js in the master page did not have effect. I did not look further into that and just applied the change to the init.js itself.

What’s the result?

In our case applying this change to the init.js file has eliminated the page loading speed problem in IE7. And even with IE6 we see a big difference in loading time of the page.
So be sure to apply this change if you have a public internet site, a small change that can make a difference.

 

Technorati tags: , , ,

 

 

Feedback

Posted on 30 October 2007 @ 22:28

For a similar, but very simple alternative, see:
http://blogs.ascentium.com/Lists/Posts/Post.aspx?ID=90

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Copyright © 2007 Katrien De Graeve.