Jump to content
xisto Community
Sign in to follow this  
Jeune

What Is Opera's App Name?

Recommended Posts

My dad has a Nokia communicator, that phone which looks like a small laptop, and so I tried to look at my My Webpagewith it.

The communicator uses the Opera browser and as it turned out, my javascript, a counter that counts how many days before my birthday and christmas didn't display the number of days correctly.

So while I am trying to discover how it will wok in Opera, I would barr people using Opera browsers from my site. Problem is I don't know Opera's appname.

Can anybody tell my what it is?

My code will looke like this

if (navigator.appName="Whatever Opera's app name is") {     my code etc etc; }

I know internet explorer's appName is Microsoft Internet Explorer and
Firefox's is Netscape.

Is Opera's appName Opera?

Share this post


Link to post
Share on other sites

My code will looke like this

 

if (navigator.appName="Whatever Opera's app name is") {     my code etc etc; }

I know internet explorer's appName is Microsoft Internet Explorer and

Firefox's is Netscape.

 

Is Opera's appName Opera?

204420[/snapback]


No, Opera's appName is Netscape! It might seem weird, but it has been chosen for compatibility reasons....

 

You need to check the User Agent String to detect whether a Opera browser is used. The User Agent String will include the name "Opera", so your code could be written like this:

 

if ((navigator.userAgent).indexOf("Opera") != -1) {     your code etc etc;}

If you really want to go in to the gory details of browser detection check out the Browser Capabilities Project.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.