avoid Javascript browser check

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sebastian Schöps

    avoid Javascript browser check

    Hello all,

    I have to access a website which does a stupid browser check and only
    accepts Netscape 4.7. The problem is that I have to access the website with
    Mozilla or Internet Explorer.

    Query:
    if ((browserType.i ndexOf("etscape ") != -1) && (browserVersion .indexOf("4.7")
    != -1))

    I have no succes when I change the useragent object (Mozilla:
    generals.userag ent.override; IE via registry):

    Mozilla Mozilla/4.7 [en] (Windows NT 5.0; U) => appName = Netscape,
    appVersion = 5.0
    IE Mozilla/4.7 (Windows NT 5.0, U) => appName = Internet
    Explorer, appVersion = 4.7

    I suppose that javascript doesn't get the information from useragent, but
    from somewhere different...

    Anyone an idea how to avoid this annoying browser check?

    Thanks in advance, any idea appreciated!

    Regards Seb



  • Michael Winter

    #2
    Re: avoid Javascript browser check

    Sebastian Schöps wrote on 13 Dec 2003 at Sat, 13 Dec 2003 17:54:09
    GMT:
    [color=blue]
    > The problem is that I have to access the website with Mozilla or
    > Internet Explorer.[/color]

    I hope you're planning to support more than those two. There are /so/
    many more browsers on the market now, and I'm not just talking about
    Opera and Mozilla. Don't alienate your potential users.
    [color=blue]
    > I suppose that javascript doesn't get the information from
    > useragent, but from somewhere different...
    >
    > Anyone an idea how to avoid this annoying browser check?[/color]

    It would be better to know what you need the checks for. I don't
    think anyone will be able to give totally accurate advice without
    knowing that.

    If it's to choose what properties or methods to use in order to
    accomplish an action, then you should use feature detection. I
    can't think of a particularly poignant example (I don't touch
    DHTML), however I know that document.all is non-standard
    collection, primarily used by Internet Explorer (though I've heard
    Opera supports it, too). You could test for it's availability like
    so:

    if (document.all) {
    // document.all supported (IE and Opera)
    } else {
    // not supported (NS and Mozilla)
    //
    // can use document.getEle mentById instead (should be tested as
    // well)
    }

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk")

    Comment

    • Sebastian Schöps

      #3
      Re: avoid Javascript browser check

      Sorry, litte misunderstandin g.

      This website is already running and I want to access it with IE or Mozilla,
      but you must have Netscape 4.7 to access it. I would never create a website
      that does such an annoying browser check...

      "Michael Winter" <M.Winter@bluey onder.co.invali d> schrieb im Newsbeitrag
      news:Xns9450CC5 BF5AEDMWinterBl ueyonder@193.38 .113.46...[color=blue]
      > Sebastian Schöps wrote on 13 Dec 2003 at Sat, 13 Dec 2003 17:54:09
      > GMT:
      >[color=green]
      > > The problem is that I have to access the website with Mozilla or
      > > Internet Explorer.[/color]
      >
      > I hope you're planning to support more than those two. There are /so/
      > many more browsers on the market now, and I'm not just talking about
      > Opera and Mozilla. Don't alienate your potential users.
      >[color=green]
      > > I suppose that javascript doesn't get the information from
      > > useragent, but from somewhere different...
      > >
      > > Anyone an idea how to avoid this annoying browser check?[/color]
      >
      > It would be better to know what you need the checks for. I don't
      > think anyone will be able to give totally accurate advice without
      > knowing that.
      >
      > If it's to choose what properties or methods to use in order to
      > accomplish an action, then you should use feature detection. I
      > can't think of a particularly poignant example (I don't touch
      > DHTML), however I know that document.all is non-standard
      > collection, primarily used by Internet Explorer (though I've heard
      > Opera supports it, too). You could test for it's availability like
      > so:
      >
      > if (document.all) {
      > // document.all supported (IE and Opera)
      > } else {
      > // not supported (NS and Mozilla)
      > //
      > // can use document.getEle mentById instead (should be tested as
      > // well)
      > }
      >
      > Mike
      >
      > --
      > Michael Winter
      > M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk")[/color]


      Comment

      • @SM

        #4
        Re: avoid Javascript browser check

        "Sebastian Schöps" a ecrit :
        [color=blue]
        > Sorry, litte misunderstandin g.
        >
        > This website is already running and I want to access it with IE or Mozilla,
        > but you must have Netscape 4.7 to access it. I would never create a website
        > that does such an annoying browser check...[/color]

        may we have url of this site ?
        to try .

        its querry about browser
        was exactly what you gave ?

        to turn preferences in IE or Mozilla for it appears as NC4.7
        I dont know ..

        --
        *************** *************** *************** *************** **
        Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr
        Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

        *************** *************** *************** *************** **


        Comment

        • Michael Winter

          #5
          [OT] Re: avoid Javascript browser check

          Sebastian Schöps wrote on 13 Dec 2003 at Sat, 13 Dec 2003 21:25:53
          GMT:
          [color=blue]
          > Sorry, litte misunderstandin g.
          >
          > This website is already running and I want to access it with IE
          > or Mozilla, but you must have Netscape 4.7 to access it. I would
          > never create a website that does such an annoying browser
          > check...[/color]

          My apologies. Unfortunately, there's not much we can do about that. I
          would try to contact the webmaster and tell him or her what an idiot
          they are for restricting entry to the site with such an out-dated,
          badly-written script.

          One way into the site would be to disable JavaScript in your browser
          preferences, but I've never been able to do that in IE. I would
          imagine that it's fairly trivial in Mozilla. To me though, that is
          far too much trouble anyway: a user should never have to do anything
          like that just to use a website.

          Mike

          --
          Michael Winter
          M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk")

          Comment

          • Sebastian Schöps

            #6
            Re: avoid Javascript browser check

            Sorry, site is in intranet, but this is the source that is affected:

            <HTML>
            <script language="Javas cript">
            var browserType;
            var browserVersion;
            browserType = navigator.appNa me;
            browserVersion = navigator.appVe rsion;

            if( (browserType.in dexOf("etscape" ) != -1) && (browserVersion .indexOf("4.7") != -1) )
            alert("Access")
            else
            alert("No access")
            </script>
            </HTML>

            Just copy and paste it in a html file. Pretty easy query, but I can't trick it... grrrrr...


            "@SM" <stephane_moria ux@wanadoo.fr> schrieb im Newsbeitrag news:3FDB9AB1.3 6C95@wanadoo.fr ...[color=blue]
            > "Sebastian Schöps" a ecrit :
            > [color=green]
            > > Sorry, litte misunderstandin g.
            > >
            > > This website is already running and I want to access it with IE or Mozilla,
            > > but you must have Netscape 4.7 to access it. I would never create a website
            > > that does such an annoying browser check...[/color]
            >
            > may we have url of this site ?
            > to try .
            >
            > its querry about browser
            > was exactly what you gave ?
            >
            > to turn preferences in IE or Mozilla for it appears as NC4.7
            > I dont know ..
            >
            > --
            > *************** *************** *************** *************** **
            > Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr
            > Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
            > http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
            > *************** *************** *************** *************** **
            >
            >[/color]

            Comment

            • Thomas 'PointedEars' Lahn

              #7
              Re: avoid Javascript browser check

              Sebastian Schöps wrote:
              [color=blue]
              > I have to access a website which does a stupid browser check and only
              > accepts Netscape 4.7. The problem is that I have to access the website with
              > Mozilla or Internet Explorer.[/color]

              With Mozilla/5.0 install http://prefbar.mozdev.org/ which
              includes a GUI (exactly: a configurable dropdown box) for
              the pref `general.userag ent.override'. Although quite old,
              it is compatible with recent builds.

              I am afraid there is no way to access that page with IE
              other than disabling script support.
              [color=blue]
              > Query:
              > if ((browserType.i ndexOf("etscape ") != -1) && (browserVersion .indexOf("4.7")
              > != -1))[/color]

              Oh my! Send the crackpot^W author who did this
              to http://pointedears.de.vu/scripts/test/whatami


              PointedEars

              Comment

              • Thomas 'PointedEars' Lahn

                #8
                Re: [OT] Re: avoid Javascript browser check

                Michael Winter wrote:[color=blue]
                > One way into the site would be to disable JavaScript in your browser
                > preferences, but I've never been able to do that in IE. [...][/color]

                Internet Options, Security, $Zone (here: Internet Zone),
                Active Scripting, (x) Disabled (or like that, I only have
                German IEs here.)
                [color=blue]
                > I would imagine that it's fairly trivial in Mozilla.[/color]

                Install and use the Prefbar (see other followup) or uncheck Edit,
                Preferences, Advanced, Script & Plug-ins, Enable JavaScript for: Navigator.


                PointedEars
                --
                Never give up! Never surrender!
                -- Cmdr. Peter Quincy Taggart in "Galaxy Quest"

                Comment

                • Dauber!

                  #9
                  Re: [OT] Re: avoid Javascript browser check

                  Waaaaay back on 13-Dec-03 18:57:42, Michael Winter said this about [OT] Re: avoid Javascript browser check:
                  [color=blue]
                  >My apologies. Unfortunately, there's not much we can do about that. I
                  >would try to contact the webmaster and tell him or her what an idiot
                  >they are for restricting entry to the site with such an out-dated,
                  >badly-written script.[/color]

                  That's one of the many cool things about Amiga's IBrowse browser...you can
                  spoof it to fool the page into thinking it's a certain version of another
                  browser...and you can actually edit the source code locally and make the
                  browser act based on your modified version of the source code. :)

                  --
                  dauber@banana-and-louie.amiga.roo lz.org * dauber.50megs.c om
                  * ICQ: 28677921 * YIM: dau_ber * AIM: ddaauubbeerr

                  Comment

                  • @SM

                    #10
                    Re: avoid Javascript browser check


                    Thomas 'PointedEars' Lahn a *crit :
                    [color=blue]
                    > With Mozilla/5.0[/color]

                    What is this Mozilla/5.0
                    Mine is Mozilla 1.2 (French for Mac PPC system 8 & 9 )


                    --
                    *************** *************** *************** *************** **
                    Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr

                    Comment

                    • @SM

                      #11
                      Re: [OT] Re: avoid Javascript browser check

                      Thomas 'PointedEars' Lahn a ecrit :
                      [color=blue]
                      > Michael Winter wrote:[color=green]
                      > > One way into the site would be to disable JavaScript in your browser
                      > > preferences, but I've never been able to do that in IE. [...][/color]
                      >
                      > Internet Options,[/color]

                      On Mac : menu Editions / Preferences / and then have a look (search a fiew) ;-)
                      [color=blue][color=green]
                      > > I would imagine that it's fairly trivial in Mozilla.[/color][/color]

                      Same as IE : Edition / Preferences / and so one


                      --
                      *************** *************** *************** *************** **
                      Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr

                      Comment

                      • Thomas 'PointedEars' Lahn

                        #12
                        Re: avoid Javascript browser check

                        @SM wrote:
                        [color=blue]
                        > Thomas 'PointedEars' Lahn a *crit :[color=green]
                        >> With Mozilla/5.0[/color]
                        >
                        > What is this Mozilla/5.0[/color]

                        The simplest definition is that Mozilla/5.0 include
                        all user agents that use the Gecko layout engine.
                        See <http://mozilla.org/> for details.
                        [color=blue]
                        > Mine is Mozilla 1.2 (French for Mac PPC system 8 & 9 )[/color]

                        Non sequitur. Yours is Mozilla/5.0, release version (rv) 1.2.
                        Type javascript:navi gator.userAgent in the Location Bar or
                        select Help, About (or whatever it is captioned in French).


                        PointedEars

                        Comment

                        Working...