Why Web Developers Should Switch to Google Chrome

Why Web Developers Should Switch to Google Chrome

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)

A screenshot of the Profile Panel of the Chrome Developer Tools

Now let’s get into the nitty gritty! In Firefox, Firebug is a godsend for developers, providing a debugging console, HTML & CSS manipulation, JavaScript profiling, and a whole lot of other goodness. The WebKit folks took notice and over the last couple of years have been perfecting a set of tools called the Web Inspector, which offers a similar set of features to Firebug. Within Chrome 4, the Web Inspector is labeled “Developer Tools.”

Accessing the Web Inspector/Developer Tools

A demonstration of how to access the Developer Tools on Google Chrome for Mac

In addition to Chrome 4, the Web Inspector has been in action for a while from within previous versions of Chrome and Safari, although it’s a bit hidden. To access the Web Inspector in various browsers:

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

A screenshot of the Console Panel within the Chrome Developer Tools

If you haven’t worked with the Firebug or Web Inspector console, then you’re missing out on a great way to help debug JavaScript. The JavaScript console serves several important functions, such as capturing errors and presenting them in a useful format, testing short bits of JavaScript, and as a convenient place to log useful information like variable values and execution times. Practically speaking, I use this tool regularly to evaluate the performance of my programs and to ensure that certain variables are being calculated correctly.

Elements Panel

A screenshot of the ELements Panel within the Chrome Developer Tools

In addition to the JavaScript console, it’s always nice to have a tool that allows you to quickly view the HTML and style information of particular elements on the page. The Web Inspector Elements panel gives a tree-structure view of the Document Object Model (DOM), allowing you to drill down into the document to select an item of interest. You can also access the information of a certain object by right clicking on an item within the browser and selecting “Inspect Element.”

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 screenshot of the Resources Panel within the Chrome Developer Tools

The last feature I’d like to highlight within the Web Inspector/Developer Tools is the “Resources” tab. If you’ve worked with Firebug’s “Net” tab, then you’ll notice several similarities. Essentially, the Resources tab gives a breakdown of all the information that is exchanged between your browser and the server, from the images to the JavaScript to the document itself. It also shows a ton of handy information, such as:

  • 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

An elegant tool that allows for easy inspection of page speed, the Resources tab can aid you in identifying and squashing performance bottlenecks. Give it a try and see where your page is too fat, then slim down your chunky images and code to provide a better experience for your users!

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:

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

A screenshot of the Speed Tracer extension

A web developer can never really be obsessed enough with performance, and the more tools that identify sluggish performance the better. That’s just where Speed Tracer, a Chrome extension developed by Google, comes into play. Speed Tracer takes the “Resources” panel to the next level by providing a visualization of the time it takes to execute low-level tasks, such as rendering CSS or parsing HTML and JavaScript. I’d highly recommend taking a look at a video demonstration of Speed Tracer put together by the folks at Google to get a better idea of how it can help you improve the performance of your applications.

Pendule

A screenshot of the Pendule extension

Moving from Firefox to Chrome, one extension everyone is going to look for is a replacement of the fantastic Web Developer Toolbar. For those who don’t know, the Web Developer Toolbar deals with the tasks Firebug wasn’t meant to handle, such as quick validation of HTML and CSS, the ability to quickly disable JavaScript or images, and a tool for checking links. Those functions are all handled with style by Pendule, which offers much of the core functionality of the Web Developer Toolbar (not quite all), while offering a few goodies of it’s own, such as a color picker.

Resolution Test

A screenshot of the Resolution Test extension

Web Developers often need to ensure that their designs work at a variety of resolutions. Resolution Test allows developers to efficiently resize their browser window to a number of common resolutions for quick and easy testing. The latest version even allows you to open multiple windows at different resolutions with only a couple of clicks. Resolution Test is fantastic for making sure your target audience is seeing the page you want them to see.

Webpage ScreenShot

A screenshot of the Webpage ScreenShot extension

There are occasions when its necessary not only to grab a screenshot of the current visible portion of a website, but a screenshot of the whole page. For example, you may want to print a full page for peer critical review or to demonstrate in your portfolio. I formerly used a Desktop tool for this, but now Webpage ScreenShot does a nice job of capturing full-page screenshots in a few clicks.

Chrome Sniffer

A screenshot of the Chrome Sniffer extension

Do you ever stumble upon a fantastic page and wonder, “what are they using to build this?” I do, and often find myself digging through the source code trying to figure out who the man behind the curtain is. While it is a useful training exercise, and a necessary one if you really want to know what’s going on, Chrome Sniffer can usually give you a snapshot of which JavaScript and PHP frameworks are in use for a particular page. For example, navigate to NetTuts and Chrome Sniffer informs us that it’s run on WordPress using Google Analytics and jQuery.

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!

Write a Plus Tutorial

Did you know that you can earn up to $600 for writing a PLUS tutorial and/or screencast for us? We’re looking for in depth and well-written tutorials on HTML, CSS, PHP, and JavaScript. If you’re of the ability, please contact Jeffrey at nettuts@tutsplus.com.

Please note that actual compensation will be dependent upon the quality of the final tutorial and screencast.

Write a PLUS tutorial

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://twitter.com/KGTheNerd Karthik

    Awesome and Informative tutorial thanks

  • http://www.cgfaulkner.com Chris

    As a web developer using Firefox, this article was convincing enough to at least try using Chrome. Wasn’t aware of some of those tools. However, if Firebug becomes as full-featured as its Firefox counterpart, no question, I’m switching.

    • Khalid

      Same with me here

      • http://www.steveottenad.com Steve O

        I wholeheartedly agree. The dom inspector in chrome is not robust, or as easy to use as firebug. That is the key factor for me.

    • Mark

      if they can get firebug lite to stay open when moving to another page. I could move. Also a short key for clearing cache.

      • Bob

        Cmd+Shift+R clears the cache and reloads the page.

  • http://www.freshclickmedia.com Shane

    When I’m browsing ‘for fun’ on my PC, I use Chrome (as I’m doing now) – I certainly prefer it to Firefox.

    Looks like I might start using Chrome when I’m developing sites too, but not just yet – I’ll stick with Firefox.

    We should all welcome advancements in browsers. I wonder how long it is before somebody comments that IE is crap. :)

    • http://www.aqibmushtaq.co.uk Aqib Mushtaq

      IE is CRAP :)

      • http://www.websiteperks.com John

        Crapping feels good! Your giving IE to much credit!

    • viaria

      i do the same, i use chrome now, but for development i will stick with firefox, it has lots of future for me, if i add stuff to chrome like firebug, it will be slow like firefox,
      but it is annoying when i like a site i open firefox and save it to my speed-dial ads-on..
      i just need something to do this..

    • Justin St. Germain

      got to agree with John, crapping does feel great. haha

  • http://jcsdevelopment.com John Swaringen

    I love Chrome for the speed and development tools but there are some JavaScript issues with various sites that drive me nuts. Like Magento’s control panel for instance. So I don’t use it as much as I’d like to. But it’s coming along.

  • http://gilbert.im/ Gilberto Ramos

    I still use Firefox but just for the addons as Firebug … this is a great post!

  • http://www.appsheriff.com/ App Sheriff

    I am a student developer and i have had no problems with Chrome..Simply love it.
    http://tinyurl.com/yfy5yr7

  • Renan Hagiwara

    I Think you’re LoL!

  • kewalter

    I didn’t realize how extensive Chrome’s web dev tools are. Right now I use Chrome for most of my browsing and Firefox for dev, but I think I may force myself to use Chrome for awhile.

    • http://tutsvalley.com Slobodan Kustrimovic

      Same here. Chrome for browsing, Firefox for dev. :) I love firebug so much it’s gonna be hard to switch :)

  • http://dseerden.com Durgé

    I’ve switched a month ago! It’s a great browser, it’s very fast with javascript, minimal UI, so allot more space for the actual website. I totally agree everybody should switch.

    @Gilberto Firebug is already available as Chrome Extension: https://chrome.google.com/extensions/detail/bnbbfjbeaefgipfjpdabmpadaacmafkj

    • http://www.alfystudio.com Ahmad Alfy

      It’s much limited … frankly It didn’t help me much!

  • http://www.quizzpot.com Crysfel

    I usually work and everything with chrome! i love it!

  • http://www.novainteractive.at Torbjoern Karlevid

    Did Google just started a war (also) at Adobe? “The following plug-in has crashed: Flash Player” Google Chrome

  • http://www.codesquid.co.uk Grant

    The one thing that would tempt me to switch from developing in firefox to Chrome is not the developer tools, but the webkit engine. It’s better than Gecko, in fact I don’t know why Firefox don’t just switch to it. With Firefox’s addons and tools, and the webkit engine, it would be one hell of a browser.

    • http://www.wdonline.com Jeremy McPeak

      That wasn’t always the case. I remember when Gecko was better than WebKit, and it wasn’t that long ago.

      Competition is always good.

  • Steven W

    Although I like Chrome quite a bit, it has yet to be able to replace Firefox in my life and in development. There are just so many great extensions for Firefox, I can’t switch without missing something.

  • Danijel

    I like Chrome and I use it when I’m just browsing the web, but when it comes to development I use Firefox.

    Think that this will change soon. :)

  • Ramon

    Great article.
    Pendule was THE Extension I was looking for!!!!
    Thanks.

  • http://www.devlabs.it Dev

    Good idea the Sniffer extension but it doesn’t work properly for me. It always recognizes just analytics but sometimes it doesn’t see jquery or mootools or others web analytics like Clicky

  • http://www.alfystudio.com Ahmad Alfy

    Chrome is awesome, but to be fair …
    Firebug CSS inspector is much better than any other tool for any browser. You can add new rules or modify existing ones and see the results on the fly…
    on Chrome it’s only possible to modify existing rules :( or there might be a way I’m still not aware of :D

    • http://brianegan.com Brian Egan
      Author

      Hey there Ahmad,

      You actually can add rules (although it’s a bit weird to find at first, I’ll also say). Check out this post for a screenshot and explanation of how to do it:

      http://webkit.org/blog/829/web-inspector-updates/#css_selectors

      Take care!
      Brian

      • http://www.alfystudio.com Ahmad Alfy

        WOW!!! Man you convinced me!
        This saves me TONS of time :D

    • Fez

      Hey Ahmad, I’m replying to both this comment and the previous comment of yours about firebug. Don’t use firebug light, just right click on any element while in Google chrome and click on inspect element.

      Also, the CSS inspector is superior IMO than the one in firebug because it makes editing really easy as it displays things side by side.

      Here is a screenshot of your comment, I added a class and added a new style property making the font go white.

      http://i45.tinypic.com/25jxcfd.png

      so thats your way :)

      • http://www.alfystudio.com Ahmad Alfy

        Thanks for clearing that up :)

  • Stoian Kirov

    All true, but nothing is better than Firefox :)

    • http://www.marnen.org Marnen Laibow-Koser

      I use Safari for development. Firebug was the main reason to stick with Firefox for me, but that reason mostly went away when the WebKit inspector panel came along.

      • http://www.marnen.org Marnen Laibow-Koser

        Update: I now use Chrome almost exclusively. It’s faster than Safari, more pleasant than Firefox, and has that wonderful WebKit inspector.

  • http://felixb.se/ Felix

    nice !=) I will give chrome a fair try.

  • http://jayphen.com Jayphen

    I use Chrome for regular browsing as it is – the only thing stopping me from using it full time is the lack of full Firebug support (well really, Firebug’s lack of Chrome support). The webkit developer tools aren’t bad, but Firebug is much better.

  • http://www.aboubaker.info/ Aboubaker Nour

    Oh, yeah… Chrome is good but I prefer to use Mozilla and it also can give us all the ways to get source code and every things that help the developers.

    Thank’s …

  • http://www.stevendavisphoto.com Steven Davis

    Didn’t know about all these tools, but I’ll stick to Firefox. I don’t like Chrome’s UI and “kiddy” feel. I use Opera for every day browsing and Firefox for development.

  • http://rolandboon.com boontje

    Love the speed of Chrome, but as a developer it is a hell to get Chrome to reload cached stylesheets. Ctrl+F5 is not doing the trick, the only solution I found till today is using Clear Browser Data.

  • Huckleberry

    Eh, Safari does the job for me. For more in-depth development, I use firefox.
    Plus Chrome for Mac is not a robust as the PC version. Both Safari and Chrome use the webkit engine.
    I believe Google’s got some serious issues that are going to surface soon, namely their cannibalistic mobile practices. The seem to be moving away from their motto of “Don’t be Evil”, b/c they are certainly doing some evil things these days.
    While I appreciate Google taking Microsoft Head on, I think Google’s getting too big for it’s breeches, so I’m boycotting them.

  • Patrick

    oh, am i a bad dev if i never ever will use chrome? If yes – eat my shorts.

    Chrome, google toolbar and so on will never find a way on my PC. Never.

    • http://brianegan.com Brian Egan
      Author

      I wouldn’t label you something so harsh, but I do hope that you give products a fair shake before concluding their utility.

      If you’ve tried Chrome and determined you don’t like it, that’s fair. If you haven’t, then maybe you should. And if your users start picking it up in greater numbers (like they have at my workplace), then I would say neglecting those users would probably be a poor decision.

      Live a little! Give things a shot! Get outside your box! I’m wrong all the time, dont be afraid to be terrifically wrong! =)

      • Patrick

        I pricipally will never user this browser. I use google.de for searching and analytics for webstatistic, but this is all. Google collect enough data from me, i really don’t see any reasons to give them much more data about me as neccessary. No browser needs a unique id, there’s no reason for this.

        Yes, i know, i can deactivate googles browser id. But for me its a matter of priciple. No google products on my PC. Never. No google mail, no chrome, no desctop search, no picasa, no docs, no calender. Nothing. All this functions could (!) be used to identify your personal advantages, hobbies, interrests and so on.

        Using Analytics and Google Search is way enough compromise.

  • http://www.thatdeadpixel.com Mike

    I switched to Chrome a while back on my Mac because Firefox was getting really slow. I’m using the mac version of Chrome so I can’t try out these plugins.

    For you people using Windows, are plugins affecting the speed of Chrome?

    • http://brianegan.com Brian Egan
      Author

      Hey Mike,

      If you get the Dev version of Chrome you can run all the plugins you want on your Mac! In fact, the screenshots from this article are all taken off my Mac.

      I’ve used Dev Chrome for the last month or two and it’s been pretty much stable and way faster than Firefox — plugins don’t seem to slow it down much at all, even when I abused the number I installed while writing this article.

      Hope that helps!
      Brian

    • Mark Osborne

      Some of the plugins I tried on the Mac Dev version (Xmarks mainly) brought Chrome to a grinding halt while they were doing things (like Xmarks syncing). Of course both the Chrome version and Xmarks were beta pieces of sofware but it was pretty much unusable at times. One can only hope it gets better.

  • http://twitter.com/arbitraryword B. Santos

    Thanks for the great list of cool gadgets and extensions on Chrome. Sometimes it’s hard to figure out what extensions to use if you’re not sure what to look for. But I now that you listed it, I’m going to try Chrome Sniffer.

  • http://spotdex.com/ David Moreen

    To be honest with you all, if Google would allow me to add and lock items on the home page like Safari I would be all in.

    • Huckleberry

      Hey David,
      I’m not familiar w/ adding & locking items in Safari. What do you use if for? and how do you lock?

    • http://brianegan.com Brian Egan
      Author

      Yeah you’re right about adding items, but I’m pretty sure you can “lock” items on the home page using the “Pin” icon that appears above a site when you hover over it. To add stuff, I think you would just have to visit that site like 10 times in a row so that Chrome thinks it’s one of your popular pages (not a cool method, I agree, but might temporarily work)

  • http://www.onlytext.net John

    I love chrome, but the downloading system is too obscure for me to use it all the time.

  • nanochrome

    I’m sorry but all the dev tools (built in to google chrome) are webkit dev tools which are available in safari: http://cld.ly/541cen, but the Extensions look cool, but right (but safari also does have some extra things than chrome like: http://cld.ly/241cer) now I still prefer Safari

  • http://flickr.com/photos/lorenzhs nuk

    Chrome – no, thanks. I prefer Chromium.

  • Yesuah Iniguez

    I currently use Chrome whenever I have to look something up, but that’s about it. Most of the websites or projects that I’ve gotten have been fixups of old sites that were built mostly using tables for layouts(I end up replacing a lot of this), but these sites never render correctly on chrome if at all. The clients for the most part only care about being able to view it in IE, which blows… but that doesn’t mean that the new(not fixups) projects that I build works just in IE, I test mostly with Chrome and Firefox.

  • Seth

    Does anyone know how to lock the Inspector to the bottom of the window like Firebug? That is the only reason I can’t switch. It is always getting in the way.

    • http://brianegan.com Brian Egan
      Author

      Hey Seth,

      I totally had this problem too! In the bottom-left corner of the panel, there are four icons. Click the left-most one that looks like a window, and it should dock the inspector inside the frame.

      Cheers!

      • Jose

        nice..had the same issue..thx

  • http://webitect.net/ Nick Parsons

    Awesome post – and I agree, because I like Chrome better and have been using it for some time! Thanks for the great details, I realized I was missing out on a couple things.

  • Ferron

    The one thing that makes me still stick to Firefox is the lack of the full-fledged HTML and CSS editor in Web Inspector. I hate having to double-click, write a line of CSS, and click off. You can’t even add a new element either. Hopefully Chrome 5 will have this.

  • r_jake

    I’d like to see a comparison article – pros and cons of FF vs. Chrome for developers. A follow-up perhaps?

  • NeoNeuro

    I usually prefer Firefox and Firebug but after this tutorial, i’m gonna give chance to Chrome.. Thanks

  • Mark Osborne

    Chrome is looking promising but still has a long way to go IMO. From a dev perspective even simple things have been left out, like a Hard Refresh function. And things in the UI just aren’t right yet. There should be an option to remove the “more bookmarks” folder from the bookmark bar and having icons appear in the tool bar for every plugin you install is a pain in the butt.

    • http://brianegan.com Brian Egan
      Author

      I mostly agree… as you mention above, beta software and it looks like they’re working pretty quickly to fill in the gaps.

      http://googlechromereleases.blogspot.com/

      I was just getting fed up with how slow Firefox was for me personally, and have found that Chrome does 95% of what I need it to. I do still occasionally open up Firefox, but I was happily surprised at how good Chrome was so far, and how much promise it has when version 5 comes out as stable for all platforms.

      Thanks for the good comments!
      Brian

  • Jimmie Lin

    Chrome + Pendule + Speedtracer is enough for me. I use Chrome daily for web browsing and development, and it’s fast and easy. It is still missing some features, and there are annoying things (like when you install lots of extensions your top toolbar is too cluttered), but it’s fine.

  • Nykeri

    i gave chrome a chance but didnt like it as it didnt do anything for me but i like the direction google’s headed in though. I use FF for everything im not one of those who complain about the speed im taking the good with the bad you can say

  • Dave

    I needed a really excellent browser to consider deviating from Firefox with all my fave plugins. But Chrome is driving a hard bargain. The first thing I noticed was the much lower memory usage, although the difference wasn’t as drastic as I thought when I realized that multiple instances of Chrome are running. It’s also possible that my using so many plugins is making Firefox a memory pig.

    With the developer tools, and some other Chrome versions of plugins I like, I’m very impressed. I might be able to switch at some point.

  • the_borg

    google wants to provide gigabit internet connections to a small sum of folks as beta, they’ll use chrome as a thin client, and the network as their computer, to provide all of google’s apps including storage and all related services with the end-user requiring nothing more than a computer monitor and some electricity

    they eat babies too

  • http://prop-14.com Randy

    I have been using chrome for a while and love it.

    One kind of strange quirk that I have noticed is that I have some wordpress sites that I test on my localhost(xaamp) and when I view the source in chrome, many of the echoed variables are not there. They get printed on the screen, but not in the source code? (Yes they are there in every other browsers source code)

    Anyway, it is a great browser.

  • block

    Just use Webkit if you’re on OSX. More stable than Chrome with the same dev features. Has auto update to nightlies so you’re always on the latest rev

  • http://bit.ly/jaal_webdev pthesis

    For those of us who don’t want to sign even more of our lives over to Google, there’s SRWare Iron to try.

    I’ll be trying it tonight, but supposedly it takes Google’s intrusive data-collection elements out of Chrome.

  • Paul

    check boxes still don’t appear!!!

  • Eric

    Installing v.4 now thanks for the update

  • Saturnine

    I have a soft spot for Firefox. As a web developer Firefox set the standard for, well, web standards. That said, I have recently switched to Chrome for both browsing and web development.

  • K-on88

    Honestly, i dont think this article is too useful. why nettuts accept this article?

  • Moprit Tran

    Yeah… Using Google Chrome is good idea. But I still love Firefox with addons store as Firebug, Valid W3c… The developer tool of Chrome is not flexible at this time…