Check out Chrome 4's great new features for developers, such as cross-platform support, awesome web inspector integration, and handy new extensions. It's becoming more and more difficult to deny Chrome the title as the new browser for web developers. If it's not quite there yet, it will be soon!
Introduction
With quick load times, a snappy JavaScript engine, solid WebKit foundation, and big-name backing, Google Chrome has been gaining a respectable market share, even surpassing Safari to become the 3rd most popular browser in December. For developers, however, Firefox has been the sweetheart of many due to its ability to run on any operating system and because of its rich offering of web development add-ons, such as Firebug and the Web Developer Toolbar. But it’s important to test JavaScript in all browsers, and having a robust set of tools in each (including Internet Explorer), is precisely what developers need to make the most of their code.Lucky for us, the Google folks have been working hard to make Chrome cross-platform, integrate WebKit’s fantastic Web Inspector, and add extensions, making Chrome 4 an amazingly useful tool for web development. In this tutorial, I’ll demonstrate some of the features that make Chrome 4 a great addition to the web developer utility belt.
Downloading Chrome 4
As of January 25, Chrome 4 has been officially released as stable for Windows. Mac and Linux users, however, we have to be a bit more brave in order to experience all that Chrome 4 has to offer. Mac users need to download the "dev" version, and Linux users the "beta" version, and it's highly worth it! Check out the following links to get a copy of Chrome for your operating system that supports everything we'll discuss in this article:Web Inspector (aka Developer Tools)
Accessing the Web Inspector/Developer Tools
Safari 4
- Select “Edit > Preferences” (Windows) or “Safari > Preferences” (Mac)
- Select the “Advanced” tab
- Check “Show Develop Menu in menu bar”
- A new menu item, “Develop,” will appear
- Select “Develop > Show Web Inspector”
Chrome 3 (Windows only)
- Select the Wrench
- Select Developer
- Select JavaScript Console (the whole range of tools are hidden under this name)
Chrome 4
- Windows / Linux: Select the Page Icon > Developer > Developer Tools
- Mac: Select View > Developer > Developer Tools
JavaScript Console
Elements Panel
Finally, I should note that the Elements panel allows for much more than simple inspection. You can modify and add styles, edit html, and in the latest versions, view event listeners attached to a selected DOM element. These features can all come in very handy when you’re dealing with little quirks that you can’t quite figure out.
Resources
- A graph of the time it takes to download each component
- A graph showing the size of the various components
- A way to sort the requests by type, e.g. Documents, Stylesheets, Images, etc.
- Image previews with dimensions, file size, and MIME type displayed below
- Request and Response Headers
- XML HTTP Request (XHR) information
Further Reading
A complete overview of the Web Inspector/Developer Tools could easily be a tutorial on it’s own, but we have more ground to cover! I highly recommend checking out the following resources to learn more:- Video demos of the Developer Tools from the Google folks themselves hosted at the Chromium Projects Wiki!
- A step by step walk through of the Developer Tools, also available from the Chromium Wiki
- A rundown of the latest Web Inspector Features from the Surfin Safari blog (thanks goes out to Timothy Hatcher, one of the Web Inspector developers, for the link!)
Extensions
Now, while I’ve always been blown away by the speed of Safari 4 and Chrome as compared to Firefox, they’ve both lacked a critical feature: add-ons. In Chrome 4, that all changes with the addition of “extensions.” You can add functionality to Chrome by downloading and installing extensions or by using the standard tools of the trade: HTML, CSS, and JavaScript, to write your own. Extensions can be downloaded from the Chrome Extensions Repository, and should be fairly simple to install. Already, a number of very compelling extensions have been created which aid web development, from quick validation to resolution testing. Let’s take a look at a few.Speed Tracer
Pendule
Resolution Test
Webpage ScreenShot
Chrome Sniffer
Conclusion
The future of web development continues to look brighter and brighter! While only a few years ago we had a limited set of tools for debugging JavaScript, tinkering with CSS, and viewing HTML, today we have a variety of powerful options. Now that Google Chrome has become cross platform, fully integrated the WebKit Web Inspector, and added extensions, it is a versatile tool for helping developers improve their own pages. I encourage all of you to download a copy for yourself and give it a shot to see if it can help you improve your pages, then come on back here and share your favorite plugins and tools with the rest of us!Courtesy: Net Tuts+
Author: Brian Egan
0 comments:
Post a Comment