Stylesheets for different browsers (was:RE: [thelist] RE: Mozilla 0.9.9 is out)

Liorean Liorean at
Tue Mar 12 15:09:01 CST 2002

At 12:14 2002-03-12 -0800, .jeff wrote:
> > From: Mark Howells
> > I'd also think about changing your logic so that you use
> > one global stylesheet for everything except NN4. You'll
> > run into a lot of problems if you check the User Agent
> > name, as Opera often identifies itself as IE and other
> > browsers, such as AOL, may identify themselves as
> > something totally different than a standard browser.
>masquerading as another browser or not, the substring "opera" is *always*
>in opera's user_agent string.  so, searching for that first and then
>searching for msie, gecko, etc. next will give you the results you want.

Only in the HTTP string. You can remove it from the JavaScript
representation. Also, you can edit the HTTP flow to leave it out, but that
requires more work.

I suggest using an object check for opera object instead. It's there as
long as JavaScript is turned on. (I don't think it can be hidden or removed
short of turning JavaScript off entirely)

Also, I think OmniWeb (among others?) also identifies as other browsers. In
Mozilla you can install the UAString toolbar to change what it identifies
as, or add a line in prefs.js doing the same. Download handlers and search
spiders also in general identify as some browser, typically NN3.0, IE 4.0
or IE5.5.

No, the only way to make sure about the right stylesheet being thrown at
the right browser is using their bugs against them.

   File hiding:
Hide link for NN4: Add attribute media="all" or id=""
Hide included stylesheet from version 4 altogether: Include the stylesheet
using @import "<URL>" in an embedded or linked stylesheet
Hide link for IE5 Mac: Add attribute rel="stylesheet" (note the lowercase,
IE5 is case sensitive) *unconfirmed*
Hide link for Moz: Set HTTP header Content-Type to anything but text/xml,
text/html or text/css
Hide link from IE: Add attribute disabled
Hide from NN4, IE<6 Win, IE<5 Mac, Op<5:

   Rule hiding:
Hide from browser with incompliant box model:
Hide from NN4, IE Win: Use child selector html>body before selector

NN4 special: <>

CSS Testsuite: <>

// Liorean

More information about the thelist mailing list