Book Review of “Firefox Hacks”
Originally published at Unix Review
Like most web developers I’m familiar with O’Reilly Media and have a number of their books in my library. “Firefox Hacks” by Nigel McFarlane, published in March of this year, is the latest in the Hacks series from this publisher. A hack is meant to be understood as a useful tool or shortcut. The subjects covered in this series range from the Linux desktop to digital photography. Never having read any book in the series I wasn’t sure what to expect. On the other hand, like many people in the business, I know Firefox (FF) and enjoy using it because it is standards-compliant and very user friendly.
At well over 300 pages this is a hefty book and briefly – very briefly - I wondered why there were so many pages. Be warned and be happy that this is not a book covering topics such as, “How to set your home page using menu options”. This is a book for the power user, the web developer and designer, and the network specialist. Beginners are welcome too but be prepared to reinstall FF when you mess things up. And, when that happens, remember hack number one for Internet Explorer (IE) – Use it to download Firefox.
Why hack the browser? It’s often the little things that annoy or please us most about a software application. For instance, the “Find” utility in FF has pretty much the same functionality as it does in IE but I personally don’t like IE’s version because it opens in a pop-up window and thus, often obscures the search results. On the other hand, FF opens a toolbar across the bottom of the browser giving you a clear view of the web page. Because FF is open-source software you don’t have to live with any of its default behavior that you find objectionable. You can often change what you don’t like and this is exactly what this book will help you do.
Each hack has a thermometer image beside it – the higher the temperature the more difficult the hack. While the contents of this book are arranged thematically, you need not read it chapter by chapter or one hack after the other. Associated hacks are grouped together but basically you can open the book anywhere, find the beginning of a hack, and start reading. Like a kid in a candy shop, I didn’t know where to start. Looking through the table of contents, as soon as one hack caught my attention I’d see another equally interesting one. Unfortunately, this is not the approach that a reviewer can take. For the sake of thoroughness I’ll review the chapters more or less in order.
Chapter one, “Firefox Basics”, is exactly what you’d expect but, even if you are an experienced FF user, you can expect to discover things you didn’t know. For instance, you can drag and drop an URL into the address bar, download themes for an entirely different look and feel and also learn about the options available when starting FF from the command line. The experienced user need not spend a lot of time on this chapter but I’ll bet you don’t know how to open FF in kiosk mode or how to overclock FF.
Take Your Medicine
Before we get to the candy though we have to take our medicine. Don’t get me wrong - the material in the second chapter, “Security”, is very useful but it’s more in the nature of Buckley’s Cough Mixture than candy. You take it because it’s good for you, not because it tastes good. If you are in a corporate environment behind a proxy server or if you need to fine-tune the security settings then this chapter will be indispensable.
Anyone who uses Firefox has their own favorite features. I like the fact that you can add search engines to the search box at the top right corner of the browser and that you can open multiple windows and tab between them. I also like the fact that Firefox is much better at retaining site icons than IE. Site icons are those little images that appear next to an URL in the address bar and in your list of bookmarks. With IE it seems that if you clear your history you lose these icons and can’t easily get them back again. I have an extensive number of sites bookmarked, and find it easier to spot the site I want by its icon rather than by reading its title, so the loss of icons is very annoying. But one man’s candy is another’s medicine and that’s the whole point of a book like this. If you don’t like those site icons you can read this chapter and find out how to turn them off (hack #13).
I found the final hack in this chapter, “Make Yourself Anonymous”, particularly appealing. Here’s a hack with strong cultural resonances, “a cloak of invisibility”, something dreamt of from Plato to Harry Potter. In this hack we learn how to configure FF so that it can impersonate another browser. There are still sites out there that require the use of IE and enforce this requirement through the use of scripts. Well, here’s the workaround. Even better, impersonate IE if your operating system is Linux. Imagine what the pundits will think when they examine their web log files and discover IE running on Linux. Already it doesn’t taste like medicine anymore.
Before leaving this chapter I’d like to suggest a rather obvious security hack, one already promoted by a number of sources but worth repeating – Use Firefox to surf the web. If you do this your web surfing will automatically be more secure. Whether you agree or not that FF is innately more secure than IE, it is unquestionably less often the target of attack and for this reason alone more secure.
The discussion of security is followed by a chapter on installation that explains the directory structure of the files associated with FF, how to install plug-ins and the technique used in many of the hacks – namely, how to change the config file. This is done by typing “about:config” into the browser address bar. Go ahead, try it. Some of you will immediately see settings that you want to change – How about making the default column for HTML wrap 80 instead of 72? The more prudent amongst you might want to read up a bit before jumping right in.
Web Surfing Enhancements
This is the chapter that will be most accessible to the greatest number of people. Here I found out about the “Adblock” extension and installed it immediately. It is so much easier to read a web page without images flashing in your peripheral vision.
FF comes with a number of search tools already built in but this chapter not only brings additional ones to your attention but shows how to build your own. If you have a content-rich site with search capabilities, then, with minimal effort, you can provide a search plug-in that will integrate with FF. Building a search plug-in is an exceptionally good promotional tool for the right kind of site.
This chapter also provides an excellent discussion of how to integrate a variety of different email programmes with FF. Many equally enticing topics are covered but, like the conscientious movie reviewer, I don’t want to tell you too much and give away the plot.
‘Scuse Me While I Kiss the Sky
As a web developer, “Power Tools for Developers” is the chapter I approached with the most anticipation and, given the quality of material to this point, I had sky high expectations. As the subheading indicates, I wasn’t disappointed.
The technologies that a web developer must master are numerous and there is no one tool that can be used exclusively to speed up development and debugging. For this reason any web developer should find the tools and suggestions provided in this chapter very useful. The two extensions, “EditCSS” and “Web Developer”, are aptly described as “must-have”. The discussion of how to use the Web Developer to locate style rules, hack #44, is one of the best debugging techniques for CSS that I’ve come across.
This chapter presents an excellent and detailed discussion of these tools – enough to fill an entire article - so I will just encourage you to install these extensions and explore their capabilities yourself.
One small quibble though. The Dom Inspector is required for hack #44 but is not installed by default under Windows, at least for version 1.0.2. If you try the above hack and find that the “View Style Information” menu option is disabled this means the Dom Inspector is not installed. If this is the case, all you need do is upgrade to version 1.0.3, do a custom install, and make sure that the “Developer’s Tools” checkbox is checked.
Many of the tools discussed here will be familiar to web developers – the HTML and CSS validation pages provided by the Worldwide Web Consortium, for example. However, the convenience of having these tools available on a toolbar within a browser that supports tabbed pages makes for exceptional ease of use. Using IE to validate the CSS in a web page means navigating to the W3C site, typing in the URL to be validated and awaiting the result. With FF you click a toolbar option and the validator opens a separate tabbed window that displays the validation results. You can easily compare the results to the original page because both can be open simultaneously in one browser.
Chapter 6, “Power XML for Web Pages”, is geared towards the hard-core web developer. Power users might well read and enjoy chapter 5 but I suspect they’ll find too much “alphabet soup” in chapter 6 for their liking. That said, hacks 63 and 64 are an excellent introduction to XML and XSL. This chapter also touches on XUL, the topic of the next chapter and accessible to all levels of readers.
Hacking the Chrome
Chrome refers to the menus, toolbars and dialogue boxes of FF. These may be changed in appearance or content. Extensions that we have already seen, such as the Web Developer, typically change the content of FF, in this case by adding a toolbar.
Hacking the chrome is made up of two chapters, one “ugly” and one “clean”, one a quick fix and the other aimed at creating a well-developed and deployed FF enhancement.
The hacks presented here are geared more towards aesthetics than towards additional functionality. You will learn how to rebadge FF and to match it thematically to the desktop. Ugly hacks can be attempted by most everyone but the clean hacks are typically advanced. The advanced hacks take you through all the stages required to create a complete package or extension right through to bundling that extension using Mozilla’s Cross Platform Install (XPI) technology.
Surfers of the World Unite
The final hack, #100, “Help with the future of Firefox”, is something to which this book contributes significantly. This book highlights the advantages of the open-source development model and makes it easier for any and everyone to contribute to the improvement of FF. With FF we have an application that is infinitely more configurable than its proprietary competitor but also superior straight out of the box using the default settings. This is a product that, if it doesn’t give both users and developers exactly what they want, allows them to create what they want. I’m not one given to evangelism – in fact quite the opposite - but in case you suspect otherwise, let me explain my self-interested motives in supporting FF. A browser like FF that closely conforms to standards, makes the web developer’s life much simpler by making page display entirely predictable - with no need to worry about accommodating this or that quirk. The popularity of FF means that we are one step closer to web developer Nirvana, a world where all browsers are standards-compliant.
If your favorite site doesn’t show up properly in Firefox you can be sure that the problem lies with the website and not the browser. Send the webmaster an email and complain. If you have installed the “Web Developer” extension all you have to do is press “Ctrl+Shift+H” to discover what the errors are. Forward this error list and ask why the site doesn’t comply with the standards set forth by the Worldwide Web Consortium. Shame them into compliance.
Let’s hope that FF continues to increase in popularity. The more popular it becomes the more pressure it puts on Microsoft to make future versions of IE standards-compliant. The popularity of FF is the motivating factor behind Microsoft’s intention to introduce version 7 of IE. Let’s hope IE 7 more closely adheres to the CSS and HTML standards and is not some monstrosity born solely of the desire to recoup market share. In any case, the ascendance of FF has certainly redefined the nature of web browsers. We can now describe IE 6 as, “an adequate tool, best used for downloading Firefox”.
About the Author
Peter Lavin runs a Web Design/Development firm in Toronto, Canada. He has been published in a number of magazines and online sites, including UnixReview.com, php|architect and International PHP Magazine. He is a contributor to the recently published O'Reilly book, PHP Hacks and is also the author of Object Oriented PHP, published by No Starch Press.
Please do not reproduce this article in whole or part, in any form, without obtaining written permission.
Copyright © 2017 softcoded -
the Toronto web design & development company