Browser Enforcing?

supersam33's picture

He has: 32 posts

Joined: Aug 2007

What code would I use to make my website only visible with a ceratin broswer type (IE7 and Firefox), and if the person doesn't meet the required settings, redirect to a page that tells them they need that certain browser?

The statement below is true.
The statement above is false.

He has: 629 posts

Joined: May 2007

Well, you could use conditional comments for IE7. Don't know how to filter for Firefox, though.

Not sure why you would do this, though. Many (most) use a computer at school, library, or office, so do not have a choice. I think this would be self-defeating. Do you really want a large percent of your visitors turned away?

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

You'd have to use javascript to detect the browser and redirect them to another page.

As an Opera user, I find this sort of thing really, really annoying. Just because someone hasn't bothered to test in my browser they just don't let me in. That would be fine if things actually didn't work to the point where things were completely unusable. And if there was a good reason for developing things like that. Normally that's not the case though. I can easily mask my browser as IE or FF and get in, only to find that everything works just fine.

So, back to webwiz's question - what's your reason for doing this?

supersam33's picture

He has: 32 posts

Joined: Aug 2007

I was hired to make a website and he wanted to put in the browser enforcing. I will mention to him some of the things you said here and see if he changes his mind. I didn't really want to argue with him, because he is paying me to do it, but I will mention it.

The statement below is true.
The statement above is false.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

Yeah, or at least try to find out why he wants to do this.

Keeping out IE 6 is actually a big problem because there are quite a lot of people using that browser still - one of my sites has almost 40% and some sites probably show more than that.

They have: 36 posts

Joined: Nov 2006

i absolutely hate! Browser Enforcing its basically fascism, well it is fascism. i know of i site that will not let you in unless you are using mozilla FireFox. Well I'm sorry, i have a choose in what browser i use and if a site forces me to get a different browser i am not going to use that site no matter how good they say there supposed software is.
for me i want a browser that's FAST to open does not take up much system resource does not bog me down with unwanted features that i hate/don't need (tabs) that's why i use IE6 ( with googlebar version 3.0v no more no less)
and I'm sure there are other users like me.
in fact i think people should not stick to browsers, i myself have IE6 and Netscape installed (tabs disabled) i thought this would not limited my browzing as netscape is able to render a page as tho it was firefox, but no this one site did not even let me use that.

OHH dear i have ranted a bit here sorry everyone Roll eyes Sticking out tongue

basically try to convince your client that its a bad idea because you restrict people Wink

VISTA = Virus Infected System Totally Assed

demonhale's picture

He has: 3,278 posts

Joined: May 2005

my solution to this is actually simple, code the site to be cross-browser compatible, now you don't have to worry about browser enforcement.

They have: 36 posts

Joined: Nov 2006

well quite:)

Roo's picture

She has: 840 posts

Joined: Apr 1999

Agree! Not a good idea! If you code to standards and things are valid there shouldn't be a problem anyway. (Well, except for IE's issues with CSS)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.