mwd1001 – website production web browsers week 11

22
MWD1001 – Website Production Web Browsers Week 11

Post on 21-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Web Browsers

Week 11

Page 2: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Who cares about browsers?

Most people use Internet Explorer Tech savvy use Firefox A few people use Opera It doesn’t really matter any more!

Page 3: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Straw poll

IE6: IE7: Firefox: Opera: Other:

Page 4: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Main Browser Families

Page 5: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Microsoft Internet Explorer (IE)

Multiple versions in regular use– Currently transitioning from 6 to 7

Tight integration with Windows operating system

Dominant browser for corporate and home users

Trident rendering engine used by Outlook Express, winamp, AOL browser

Page 6: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Gecko

The rendering technology behind Firefox, Flock, Camino, Seamonkey, …

Open source technology Cross-platform, runs on Windows,

Mac, Linux/Unix

Page 7: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Opera

Innovative web browser Low market share compared to big

two on the desktop Very well represented in

smartphones and mobile apps Presto rendering engine

Page 8: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Safari/Konqueror

Safari is the browser Apple ship on all Macs, now on Windows and iPhone

Konqueror runs on Linux as part of the KDE environment

Both derived from Webkit engine Said to be very standards compliant

Page 9: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Brand New – Chrome

Google launched their own browser last month

Based on Webkit engine Optimised for JavaScript and web

apps PC only right now

Page 10: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

0%

20%

40%

60%

80%

100%

120%

Jan-02

May-02

Sep-02

Jan-03

May-03

Sep-03

Jan-04

May-04

Sep-04

Jan-05

May-05

Sep-05

Jan-06

May-06

Sep-06

Jan-07

May-07

Sep-07

Jan-08

May-08

Sep-08

AOL

Chrome

Opera

Safari

Firefox

Mozilla

IE7

IE6

IE5

Market Share

Source: w3schools.com Oct 2008

Page 11: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Why does it matter

Page 12: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

W3C Standards

World Wide Web Consortium sets standards for HTML, CSS

Can browsers pass the ACID Test? Internet Explorer used to be the de

facto standard when it had > 90% market share

No current browser fully conforms to all current standards

Cannot rely on features to be present– Always aim to degrade gracefully

Page 13: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

ActiveX

IE supports ActiveX controls on Windows– Can be used to implement Client-side code– Not cross-platform– Associated with security risks

Most browser support Flash as an alternative

Advanced JavaScript (AJAX) code can be implemented client-side

Page 14: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Authentication

Browsers and web servers support different authentication schemes

Apache offers Basic and Digest Authentication

IIS offers Basic, Cookie and NTLM NTLM only available in IE on Windows

/adamisherwood /authentication

Page 15: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

What is NTLM

NTLM passes the user’s Windows login credentials to the server

Using IE, users are not challenged for login at all if their acct is authorised

Useful in a corporate environment where browsers and user accounts are controlled

Page 16: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

JavaScript and DOM

Since its introduction JavaScript has had compatibility issues

Often through competition by features Events are not supported by all

browsers– E.g IE allows onClick on Image tags,

Netscape didn’t CSS Properties such as position: float;

not in IE6

Page 17: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

JavaScript and AJAX

Writing code is harder than it needs to be

Have to anticipate compatibility issues

Need to write more than one version of code

Page 18: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

How can you tell?

Page 19: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Server-side

User-agent string passed to server as HTTP environment variable

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

May be spoofed– Useful if you maintain different versions– Important to check for authentication

Page 20: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Client Side

Much more important for client-side programming

If you rely on a feature which turns out to be missing your app fails

JavaScript methods exist to check for IE or NS versions– May be spoofed

Better to use the black art of browser sniffing

Page 21: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Browser Sniffing

Don’t actually care which browser! Need to know whether function supported IE has a document.all array containing all

page elements if (document.all) {

//some IE specific code}

More advanced code relies on getElementById() function

/adamisherwood /sniffing

Page 22: MWD1001 – Website Production Web Browsers Week 11

MWD1001 – Website Production

Summary

Browser market fragmented Functionality and capability varies Cannot rely on standards Fail Gracefully