Detecting Information Card Support (CardSpace!) in a browser

I hacked out this a few weeks back, and never got around to publishing it.  I've not decided that this is the 'official' way to detect Information Card support in a browser, but it'll do until I can think of something better.


I'd say something like, "see how it detects support in other browsers too?" except that I'm not thinking many people have a CardSpace plugin for another browser yet. But you can trust me--It works!



   <SCRIPT LANGUAGE="Javascript">

  function AreCardsSupported()


     var IEVer = -1;

     if (navigator.appName == 'Microsoft Internet Explorer')

       if (new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})")

.exec(navigator.userAgent) != null)

         IEVer = parseFloat( RegExp.$1 );


     if( IEVer >= 6 )


       var embed = document.createElement("object");

       embed.setAttribute("type", "application/x-informationcard");


       if(  ""+embed.issuerPolicy != "undefined" )

         return true;

       return false;        


     if( IEVer < 0 && navigator.mimeTypes && navigator.mimeTypes.length)


       x = navigator.mimeTypes['application/x-informationcard'];

       if (x && x.enabledPlugin)

         return true;


     return false;



   function ShowDetection()


     if( AreCardsSupported() )

       alert( "Information Cards are supported by this browser :D" );


       alert( "Information Cards are NOT supported by this browser :(" );




   <body onload="ShowDetection()">






Garrett Serack | Program Manager | Connected Identity and Directory| Microsoft Corporation

Comments (1)
  1. Vibro.NET says:

    Garrett shares some of his JS-flavoured wizardry: with that snippet you can&amp;nbsp;find out&amp;nbsp;on the…

Comments are closed.

Skip to main content