devxlogo

Detecting Browser Plug-Ins

Browser plug-ins, such as RealPlayer, Shockwave/Flash, Quicktime, and others, can add multimedia functionality to a Web site and help attract and retain visitors. If a particular visitor doesn’t have a particular plug-in, however, the savvy Web designer will want to provide a different experience–an animated GIF, a Netscape sound, or something along those lines. It’s possible to detect the presence or absence of any known plug-in with a JavaScript function, and then deliver content appropriately:

     function detect_plugin(name)  {             if (navigator.plugins[name]) return true;             else return false;         }

Just use a simple if statement with the name of the plug-in to put the function to work:

          if (detect_plugin("Beatnik") == true)              document.write("Beatnik code goes here");         else document.write("No Beatnik - do something else");

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.