44
ClientSide Debugging Tools Fiddler Firebug Internet Explorer 8 Visual Studio 2008 Web Developer Toolbar Other Browsers

ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

  • Upload
    dokhue

  • View
    217

  • Download
    2

Embed Size (px)

Citation preview

Page 1: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

ClientSide Debugging Tools

FiddlerFirebugInternet Explorer 8Visual Studio 2008Web Developer ToolbarOther Browsers

Page 2: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Browser Wars19911992199319941995

1996

19971998199920002001200220032004

2005

2006

200720082009

WorldWideWebViolaWWW, Erwise, MidasWWW, MacWWWMosaic, Cello, Lynx 2.0, Arena, AMosaic 1.0IBM Web Explorer, Netscape Navigator, SlipKnot 1.0, MacWeb, IBrowse, Argo, MinuetInternet Explorer, Netscape Navigator 2.0, OmniWeb, WebRouser[2], Internet Explorer 2, GrailArachne 1.0, Internet Explorer 3.0, Netscape Navigator 3.0, Opera 2.0,PowerBrowser 1.5[3], Cyberdog, Amaya 0.9[4], AWeb, VoyagerInternet Explorer 4.0, Netscape Navigator 4.0, Netscape Communicator 4.0, Opera 3.0[5], Amaya 1.0[4]Internet Explorer 5.0 Beta 1, iCab, MozillaAmaya 2.0[4], Mozilla M3, Internet Explorer 5.0Konqueror, Netscape 6, Opera 4[6], Opera 5[7], K-Meleon 0.2, Amaya 3.0[4], Amaya 4.0[4]Internet Explorer 6, Galeon 1.0, Opera 6[8], Amaya 5.0[4]Netscape 7, Mozilla 1.0, Phoenix 0.1, Links 2.0, Amaya 6.0[4], Amaya 7.0[4]Opera 7[9], Safari 1.0, Epiphany 1.0, Amaya 8.0[4]Firefox 1.0, Netscape Browser, OmniWeb 5.0Safari 2.0, Netscape Browser 8.0, Opera 8.[10], Epiphany1.8, Amaya 9.0[4], AOL Explorer1.0, Maxthon 1.0, Shiira 1.0SeaMonkey 1.0, K-Meleon 1.0, Galeon 2.0, Camino 1.0, Firefox 2.0, Avant 11, iCab 3, Opera 9[11], Internet Explorer 7, SputnikMaxthon 2.0, Netscape Navigator 9, NetSurf 1.0, Flock 1.0, Safari 3.0, ConkerorKonqueror 4, Safari 3.1, Opera 9.5[12], Firefox 3, Amaya 10.0[4], Flock 2, Google Chrome 1, Amaya 11.0[4]Internet Explorer 8, Chrome 2, Safari 4, Opera 10, Flock 2.5, Google Chrome 3, SeaMonkey 2

http://en.wikipedia.org/wiki/List_of_web_browsers

Page 3: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Debugging ClientSide Issues Can Be Frightening

Page 4: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Main Browsers

● IE 6, 7, 8● Firefox 2+ ● Opera 9+● Safari 2+● Chrome● Mobile Browsers

Page 5: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

ClientSide Debugging Tools

FiddlerFirebugInternet Explorer 8Visual Studio 2008Web Developer ToolbarOther Browsers

Page 6: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Web Developer Toolbar

● Used with IE6 & 7*● Limited HTML and CSS Debugging● No JavaScript Debugging● Download from MS: http://tinyurl.com/eric-wdt

Page 7: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Web Developer Toolbar

Open Toolbar

Page 8: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Web Developer Toolbar

Page 9: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Web Developer Toolbar

The Browser Window

DOM Tree Style/Attribute Properties

Page 10: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Web Developer Toolbar

Select Element By ClickAdd/Remove Attributes to Element

Click to UnpinRefresh Tree/CSS Views

Page 11: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enough with the slides!

Page 12: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Debugging JavaScript in IE6+

● Classic JavaScript alerts● Through address bar

– javascript:alert("hi");void(0);

● MS Script Debugger: http://tinyurl.com/eric-msd– Very hard to get running correctly

● Visual Studio or Visual Web Developer Express

Page 13: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Configure IE

● Tools● Internet Options● Advanced● Browsing● uncheck Disable

script debugging (IE)● Apply

Page 14: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Force debugging

● Add debugger; into the script file where you want it to break

● You can have multiple debugger statements in the file

Page 15: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

What can we do in VS?

● Stepping through your code● Watching variables● Inspecting variables

Page 16: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enough with the slides!

Page 17: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Magic of F12 in IE8!

Page 18: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

The Wonderful World of IE8

● IE8 Gives us the ability to debug HTML, JavaScript, and CSS without a plug-in!

● Developer Toolbar is built in!● Allows us to run as IE7, means one browser

install = 2 browsers...or does it?

Page 19: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

The Wonderful World of IE8

● IE8 introduced compatibility mode where pages can run with a quirks mode so web pages will not break.

● IE8 removed a lot of legacy support with HTML, CSS, and JavaScript! Yippee!

● Pages can be run in compatibility mode through a list, developer tools, forced by developers, or menu/icon choice.

Page 20: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Compatibility Mode WTF

Page 21: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Compatibility Mode WTF

Page 22: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Compatibility Mode WTF

Page 23: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Forced Compatibility Mode WTF

Page 24: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

MSN's HTML

Page 25: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

How to force?

● Add meta tag to your HTML's head

<meta http-equiv="X-UA-Compatible" content="IE=7" />

● Note: You can not add after the page load with JavaScript, has to be there when you render the page!

Page 26: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Compatibility Mode Info

● Introducing Compatibility View– http://tinyurl.com/eric-icv

● Understanding Differences– http://tinyurl.com/eric-ucm

Page 27: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enough with the slides!

Page 28: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Debugging in Firefox

● There are tons of web development extensions for Firefox

● #1 extension is Firebug– http://www.getFirebug.com– Has many plug-ins to add more features– Allows debugging of HTML, CSS, JavaScript– Downfalls: It can be buggy and slow

Page 29: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enough with the slides!

Page 30: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

What about debugging Production Code?

Page 31: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Fiddler

● Fiddler is a Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

● Fiddler is freeware and can debug traffic from virtually any application, including Internet Explorer, Mozilla Firefox, Opera, and thousands more.

Page 32: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Where to get it?

● http://www.fiddler2.com● It is Free!● Requires Windows with .NET framework

● Mac – use Charles [not free]

Page 33: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

What does Fiddler do?

Page 34: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enabling/Disabling Capturing

Page 35: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Setting up Internet Explorer

● There is nothing you need to do if IE is set up to automatically detect proxies

● [Chrome same way]

Page 36: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Firefox

Page 37: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enough with the slides!

Page 38: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

We see the calls, now what?

Page 39: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Auto Responders

● Auto Responders intercept HTTP calls● They can server up a different file ● Possible to block files

Page 40: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

What does Fiddler do?

Page 41: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Auto Responder Steps

(1) Select HTTP Call

(2) Click Auto Responder Tab in Response Section

(3) Click Enable automatic responses checkbox [may be done]

(4) Make sure “permit passthrough” is checked

(5) Click “Add” button

(6) Send select list pick “Find a file”

(7) Choose the file and Click Save Button

(8) Make sure checkbox is check and re-run page.

Page 42: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Enough with the slides!

Page 43: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Other Tools

● IE Memory Leak Detection– Sieve: http://tinyurl.com/eric-sieve

● Chrome Debugger– http://tinyurl.com/eric-chrome

● Aptana – JS Editor with debugger– http://www.aptana.com/

Page 44: ClientSide Debugging Tools - Eric · PDF fileBrowser Wars 1991 1992 1993 1994 1995 1996 1997 1998 1999 ... Netscape Browser 8.0, Opera 8.[10], ... ClientSide Debugging Tools Fiddler

Questions?

Thanks to my personal photographer Eddie “Monkey” Welker