Actually you don need to do it. if shockwave is not installed then the browser will automatically ask the user to download the plugin.
Here is a piece of javascript code detecting several commonly used plugins:
<script language=javascript>
//This script detects the following:
//Flash
//Windows Media Player
//Java
//Shockwave
//RealPlayer
//QuickTime
//Acrobat Reader
//SVG Viewer
var agt=navigator.userAgent.toLowerCase();
var ie = (agt.indexOf("msie") != -1);
var ns = (navigator.appName.indexOf("Netscape") != -1);
var win = ((agt.indexOf("win")!=-1) || (agt.indexOf("32bit")!=-1));
var mac = (agt.indexOf("mac")!=-1);
if (ie && win) {
pluginlist = detectIE("Adobe.SVGCtl","SVG Viewer") + detectIE("SWCtl.SWCtl.1","Shockwave Director") + detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + detectIE("PDF.PdfCtrl.5","<b style="color:black;background-color:#99ff99">Acrobat</b> <b style="color:black;background-color:#ff9999">Reader</b>"); }
if (ns || !win) {
nse = "";
for (var i=0;i<navigator.mimeTypes.length;i++)
nse += navigator.mimeTypes.type.toLowerCase();
pluginlist = detectNS("image/svg-xml","SVG Viewer") + detectNS("application/x-director","Shockwave Director") + detectNS("application/x-shockwave-flash","Shockwave Flash") + detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + detectNS("video/quicktime","QuickTime") + detectNS("application/x-mplayer2","Windows Media Player") + detectNS("application/pdf","<b style="color:black;background-color:#99ff99">Acrobat</b> <b style="color:black;background-color:#ff9999">Reader</b>");
}
function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>
on error resume next
result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>
'); if (result) return name+','; else return ''; }
function detectNS(ClassID,name) { n = ""; if (nse.indexOf(ClassID) != -1) if (navigator.mimeTypes[ClassID].enabledPlugin != null) n = name+","; return n; }
pluginlist += navigator.javaEnabled() ? "Java," : "";
if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
if (pluginlist.indexOf("Flash")!=-1)
document.write("You have Flash installed")
if (pluginlist.indexOf("Windows Media Player")!=-1)
document.write("You have Windows Media Player installed")
if (pluginlist.indexOf("Java")!=-1)
document.write("You have Java installed")
if (pluginlist.indexOf("Shockwave")!=-1)
document.write("You have Shockwave installed")
if (pluginlist.indexOf("RealPlayer")!=-1)
document.write("You have Realplayer installed")
if (pluginlist.indexOf("QuickTime")!=-1)
document.write("You have QuickTime installed")
if (pluginlist.indexOf("<b style="color:black;background-color:#99ff99">Acrobat</b> <b style="color:black;background-color:#ff9999">Reader</b>")!=-1)
document.write("You have <b style="color:black;background-color:#99ff99">Acrobat</b> <b style="color:black;background-color:#ff9999">Reader</b> installed")
if (pluginlist.indexOf("SVG Viewer")!=-1)
document.write("You have SVG Viewer installed")
</script> Regardsgewiz
While browsing a page you can press 'j' for enabling JavaScript. On the other hand you can keep your browser enabled for JavaScript all the time by following the below steps -
581 views
Usually answered in minutes!
×