473,395 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.indexOf("etscape") != -1) && (browserVersion.indexOf("4.7")
!= -1))

I have no succes when I change the useragent object (Mozilla:
generals.useragent.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

Jul 20 '05 #1
11 2134
Sebastian Schöps wrote on 13 Dec 2003 at Sat, 13 Dec 2003 17:54:09
GMT:
The problem is that I have to access the website with Mozilla or
Internet Explorer.
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.
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?


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.getElementById instead (should be tested as
// well)
}

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #2
Sorry, litte misunderstanding.

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.******@blueyonder.co.invalid> schrieb im Newsbeitrag
news:Xn*******************************@193.38.113. 46...
Sebastian Schöps wrote on 13 Dec 2003 at Sat, 13 Dec 2003 17:54:09
GMT:
The problem is that I have to access the website with Mozilla or
Internet Explorer.


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.
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?


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.getElementById instead (should be tested as
// well)
}

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")

Jul 20 '05 #3
@SM
"Sebastian Schöps" a ecrit :
Sorry, litte misunderstanding.

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...


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:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
************************************************** ************
Jul 20 '05 #4
Sebastian Schöps wrote on 13 Dec 2003 at Sat, 13 Dec 2003 21:25:53
GMT:
Sorry, litte misunderstanding.

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...


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.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #5
Sorry, site is in intranet, but this is the source that is affected:

<HTML>
<script language="Javascript">
var browserType;
var browserVersion;
browserType = navigator.appName;
browserVersion = navigator.appVersion;

if( (browserType.indexOf("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" <st**************@wanadoo.fr> schrieb im Newsbeitrag news:3F************@wanadoo.fr...
"Sebastian Schöps" a ecrit :
Sorry, litte misunderstanding.

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...


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:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephanePOINTmoriaux/internet/
************************************************** ************

Jul 20 '05 #6
Sebastian Schöps wrote:
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.
With Mozilla/5.0 install http://prefbar.mozdev.org/ which
includes a GUI (exactly: a configurable dropdown box) for
the pref `general.useragent.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.
Query:
if ((browserType.indexOf("etscape") != -1) && (browserVersion.indexOf("4.7")
!= -1))


Oh my! Send the crackpot^W author who did this
to http://pointedears.de.vu/scripts/test/whatami
PointedEars
Jul 20 '05 #7
Michael Winter wrote:
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. [...]
Internet Options, Security, $Zone (here: Internet Zone),
Active Scripting, (x) Disabled (or like that, I only have
German IEs here.)
I would imagine that it's fairly trivial in Mozilla.


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"
Jul 20 '05 #8
Waaaaay back on 13-Dec-03 18:57:42, Michael Winter said this about [OT] Re: avoid Javascript browser check:
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.


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. :)

--
da****@banana-and-louie.amiga.roolz.org * dauber.50megs.com
* ICQ: 28677921 * YIM: dau_ber * AIM: ddaauubbeerr

Jul 20 '05 #9
@SM

Thomas 'PointedEars' Lahn a *crit :
With Mozilla/5.0


What is this Mozilla/5.0
Mine is Mozilla 1.2 (French for Mac PPC system 8 & 9 )
--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr

Jul 20 '05 #10
@SM
Thomas 'PointedEars' Lahn a ecrit :
Michael Winter wrote:
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. [...]


Internet Options,


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


Same as IE : Edition / Preferences / and so one
--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr

Jul 20 '05 #11
@SM wrote:
Thomas 'PointedEars' Lahn a *crit :
With Mozilla/5.0
What is this Mozilla/5.0


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


Non sequitur. Yours is Mozilla/5.0, release version (rv) 1.2.
Type javascript:navigator.userAgent in the Location Bar or
select Help, About (or whatever it is captioned in French).
PointedEars
Jul 20 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: willl69 | last post by:
Hi, I was wondering if anyone knows of a way to test if javascript is on with PHP or any other language. I need to test if it is enabled and if it isnt, redirect to another page. Any help...
2
by: Lawrence San | last post by:
I'm trying to test some simple JavaScript meant to speed up the display of my Web pages for readers using modems, but I have a fast DSL connection and I'm having trouble visualizing how effective...
9
by: CW | last post by:
I wrote an HTML based chat application. The front end is built entirely on HTML + javascript. Essentially, I have a hidden frame that's refreshed frequently and any new messages are displayed in...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
1
by: oreng | last post by:
Hey all, I have some problems detecting whether the client's browser javascript is enabled at the server side. While Request.Browser.JavaScript only check if the browser enable java script (and...
9
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
0
by: talal | last post by:
How to check whether javascript is enable or disable in client browser. Remeber i can check wheter browser client support javascript with BrowserCapability class. But what if the client has disable...
6
by: RobGMiller | last post by:
Using ASP.NET 2.0 Need to simply process incoming postback information without sending back a reponse. Client sends HTML from application other than a browser to a page on a web site. Web...
5
by: Nike1984 | last post by:
I'm fairly new to Javascript and it's more of a guessing game for me... I'm trying to build an app for Google Maps and just had some issues recently. First off I just wanted to say that everything...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.