Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Oct 2003
    Location
    San Sebastian
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    plug in detection and netscape

    Hello, I´m using this code to detect plug ins and install them, but when trying it on netscape, it does not work. What should I do? how can I make alert, or window.confirm work on netscape?



    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","Acrobat Reader")
    + detectIE("ADView.Adviewer.1","Autodesk Express Viewer Control"); }



    if (ns || !win) {
    nse = ""; for (var i=0;i<navigator.mimeTypes.length;i++) nse += navigator.mimeTypes[i].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","Acrobat Reader")
    + detectcNS("application/dwf","Autodesk Express Viewer");
    }

    function detectIE(ClassID,name) { result = false; document.write('<SCRIPT LANGUAGE=VBScript>\n on error resume next \n result = IsObject(CreateObject("' + ClassID + '"))</SCRIPT>\n'); 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);

    function fullwin(targeturl){
    window.open(targeturl,"","fullscreen,scrollbars")
    }


    self.moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);

    function displayWindowInfo() {
    alert("plug in Flash instalado");
    }

    if (pluginlist.indexOf("Acrobat Reader")!=-1){
    alert("Comprobación de plug-in Acrobar Reader correcta.")
    }else{
    window.confirm("Para la correcta visualizacion de algunas partes del cd, es necesario que instale en su equipo la siguiente aplicación: AcroReader51_ESP.exe")
    open("controles/AcroReader51_ESP.exe")
    //window.reload
    }
    if (pluginlist.indexOf("Windows Media Player")!=-1){
    alert("Comprobación de plug-in Windows Media Player correcta.")
    }else{
    window.confirm("Para la correcta visualizacion de algunas partes del cd, es necesario que instale en su equipo la siguiente aplicación: MPSetup.exe")
    open("cotroles/MPSetup.exe")
    }
    if (pluginlist.indexOf("Shockwave Flash")!=-1){
    alert("Comprobación de plug-in Shockwave Flash correcta.")
    }else{
    window.confirm("Para la correcta visualizacion de algunas partes del cd, es necesario que instale en su equipo la siguiente aplicación: Install Flash Player 6.exe")
    open("controles/Install Flash Player 6.exe")
    }
    if (pluginlist.indexOf("Autodesk Express Viewer")!=-1){
    alert("Comprobación de plug-in Autodesk Express Viewer correcta.")
    }else{
    window.confirm("Para la correcta visualizacion de algunas partes del cd, es necesario que instale en su equipo la siguiente aplicación: ExpressViewerSetup.exe")
    open("controles/ExpressViewerSetup.exe")
    }
    if((pluginlist.indexOf("Acrobat Reader")!=-1)&&(pluginlist.indexOf("Windows Media Player")!=-1)&&(pluginlist.indexOf("Shockwave Flash")!=-1)&&(pluginlist.indexOf("Autodesk Express Viewer")!=-1)){
    window.close('detector de plugins.htm')
    fullwin ('presentacion.htm','scroll:no')
    }else{
    window.open("detector de plugins.htm","self")

    }

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Go back to the source where you got this script and get the REST of the script. You're missing the detectNS function. Also correct the typo where you mis-spelled it for the AutoDesk Express plugin.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    New to the CF scene
    Join Date
    Oct 2003
    Location
    San Sebastian
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    and how do I detect netscape?

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by medi78
    and how do I detect netscape?
    Which version(s) of Netscape? There were two entirely different browsers that have been called Netscape and both have been discontinued (though the latter one is still being developed under the Mozilla name and is pretty much the best browser out there IMO).

    Beyond that, here's a huge list of ways to do what you want:

    http://www.google.com/search?hl=en&i...browser+detect
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #5
    New to the CF scene
    Join Date
    Oct 2003
    Location
    San Sebastian
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course I´ve been searching (do u really think I have not?), no knowledge comes automatically, but I still do need some help, I´m not such a good programmer yet. The version I referred was from 4x to above. I´d like my applications to be the most compatible with the highest number of computers. If u want to help me, I´ll thank you. If u do not, don´t waste your time. Have a nice day there in Wichita. Here in San Sebastian it´s raining.


    The monkey speaks his mind.

  • #6
    New to the CF scene
    Join Date
    Oct 2003
    Location
    San Sebastian
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah, one more thing, I didn´t know that mozilla and netscape worked in similar ways. I knew javascript was developed by netscape, but I actually don´t understand why coding for IE is much easier.... microsoft ate the world wide marketing.

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Coding for IE is a lot easier because MS created a lot of shortcuts to objects that you don't find in Netscape. While those shortcuts made programming only for IE easier since Netscape never adopted them they've muddied the waters and made cross browser coding more difficult because those shortcuts cause people to think that Netscape is broken when the truth is they're using an IE only construct.

    Netscape version 4 is the last browser written by Netscape. When Netscape 6 was released it was really just a beta version of the Mozilla browser packed with all the other garbage that Netscape had always packed around the Netscape 4 browser. There is no more Netscape browser (no new releases) these days but the Mozilla project still produces the Mozilla browser and it's still a most exellent browser.

    It would really help if you could say where you got this code from in the first place. The problem is that you didn't get all of the code and while we could eventually figure out what that missing code might be there shouldn't be a need to do that if the code is still available somewhere else.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #8
    New to the CF scene
    Join Date
    Oct 2003
    Location
    San Sebastian
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello. I took the code from:

    http://www.javascriptkit.com/script/...indetect.shtml

    As you can see I almost did cut and paste. Maybe I should work harder and try to detect NS myself.

  • #9
    New to the CF scene
    Join Date
    Oct 2003
    Location
    San Sebastian
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I thougt the var 'ns' was enough to work itself.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •