Hacking Firefox : More Than 150 Hacks, Mods, and Customizations
Total Page:16
File Type:pdf, Size:1020Kb
01_596500 ffirs.qxd 6/30/05 2:34 PM Page iii Hacking Firefox™ More Than 150 Hacks, Mods, and Customizations Mel Reyes 01_596500 ffirs.qxd 6/30/05 2:34 PM Page ii 01_596500 ffirs.qxd 6/30/05 2:34 PM Page i Hacking Firefox™ 01_596500 ffirs.qxd 6/30/05 2:34 PM Page ii 01_596500 ffirs.qxd 6/30/05 2:34 PM Page iii Hacking Firefox™ More Than 150 Hacks, Mods, and Customizations Mel Reyes 01_596500 ffirs.qxd 6/30/05 2:34 PM Page iv Hacking Firefox™: More Than 150 Hacks, Mods, and Customizations Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2005 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN-13: 978-0-7645-9650-6 ISBN-10: 0-7645-9650-0 Manufactured in the United States of America 10987654321 1B/SR/QX/QV/IN No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services or to obtain technical support, please contact our Customer Care Department within the U.S. at (800) 762-2974, outside the U.S. at (317) 572-3993 or fax (317) 572-4002. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2005017558 Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks ofJohn Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. ExtremeTech and the ExtremeTech logo are trademarks of Ziff Davis Publishing Holdings, Inc. Used by license. All rights reserved. Firefox is a trademark of Mozilla Foundation. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. 01_596500 ffirs.qxd 6/30/05 2:34 PM Page v About the Author Mel Reyes, a veteran of technology and programming, is an avid fan and user of Firefox and all its predecessors. He programs in several languages, works with a variety of technologies, and runs MRTech.com, which provides free technology news, support, tips, and software. He works in several industries helping clients with web, desktop, and database application develop- ment. Mel can be reached by e-mail at [email protected]. 01_596500 ffirs.qxd 6/30/05 2:34 PM Page vi Credits Executive Editor Vice President and Publisher Chris Webb Joseph B. Wikert Contributing Writers Project Coordinator Phil Catelinet Erin Smith Alex Sirota Aaron Spuler Graphics and Production Specialists Terren Tong April Farling Jennifer Heleine Technical Editors Stephanie D. Jumper David Gegenheimer Erin Zeltner James Russell Quality Control Technicians Development Editor Amanda Briggs Marcia Ellett Jessica Kramer Carl William Pierce Copy Editor Charles Spencer Maarten Reilingh Proofreading and Indexing Production Manager TECHBOOKS Production Services Tim Tate Cover Design Editorial Manager Anthony Bunyan Mary Beth Wakefield Vice President and Executive Group Publisher Richard Swadley 01_596500 ffirs.qxd 6/30/05 2:34 PM Page vii To my loving and caring family—Wendi, Samantha, and Skylher 01_596500 ffirs.qxd 6/30/05 2:34 PM Page viii 01_596500 ffirs.qxd 6/30/05 2:34 PM Page ix Foreword If software is an art—and I think it is—then I must be the only artist in the world who advo- cates defacing his own work. But if ever there was a product designed for hacking, Firefox is it. Because Firefox is an open-source project, its lifeblood—its source code—is available to hack- ers the world over. And I do mean hackers. These guys ship software before they put on pants. What separates Firefox from other open-source projects is that it isn’t designed for a technical community. Products like Linux are generally regarded as being “by geeks, for geeks,” but with Firefox it’s more like “by geeks, for grandmas.” We focus obsessively on the user experience so that everything just works, right out of the box. Indeed, you may find that when you first start Firefox, you don’t need to hack it. This odd sensation will be accompanied by symptoms of hacker withdrawal, including, in severe cases, a sudden willingness to go outside. You’ll find yourself scoffing at certain parts of Firefox just to feel as if you have something to hack (“Pfft, I could hack a much cuter fox for their logo”). No worries: Shortly thereafter, your geeky sense will begin tingling again. Think back to The Matrix. Where most of the world saw a vibrant 3-D reality, Neo and his crew saw an endless stream of flashing green code. Okay, so real life (if this is real life) isn’t quite that cool, but you and I see technology through a different lens than Grandma. She isn’t going to notice—or care—if her toolbar buttons are five pixels apart instead of seven, but I am, and I want to fix it. Because we are empowered to change anything, we notice everything. Besides, hacking isn’t just about fixing what’s wrong. It’s also about making what already works work for you. Sure, traditional, rectangular context menus work well enough, but wouldn’t pie menus be better? And yeah, it’s easy enough to click that back button, but it’s ever so far. Why can’t I make a quick gesture with my mouse to go back, wherever it happens to be? Well enough, good enough—”enough” does not exist in the hacker vocabulary. There is only an esca- lating sense of “better.” I began work on Firefox two years ago, when I was 17, and I’m still hacking on it right now in another window. Firefox is not a business. It is a passion. It is the product of a global commu- nity of developers fueled by their own drive to create, and no matter how hard we try to polish it for Grandma, our roots shine through. We urge you to join us; our art is yours. Blake Ross Co-creator of Firefox www.blakeross.com 01_596500 ffirs.qxd 6/30/05 2:34 PM Page x 01_596500 ffirs.qxd 6/30/05 2:34 PM Page xi Acknowledgments First and foremost, I thank the most profoundly beautiful, incredibly understanding, rock and foundation, love of my life—my wife, Wendi. Without her superhuman efforts to manage day- to-day things, I don’t think this book would have been possible. To my loving daughter Sammi B., whose smiling pictures and letters gave me the energy on those extremely long and late nights to continue writing. To my younger and vibrant daughter, Skylher B., for making sure I didn’t miss any of those important moments in the first year of her life. And to the new addi- tion who adds a delightful finish to this whole process. To Can and Bry for being the best babysitters, in-laws, and friends a person could ever have. Thanks also to the rest of my family, friends, and coworkers for lending an ear and for the words of encouragement. Special thanks to the great efforts and massive contributions made to this book and for the expertise supplied by Phil Catelinet, Alex Sirota, Aaron Spuler, and Terren Tong. Thanks, guys! Finally, I thank Chris Webb and Marcia Ellett of Wiley for their patience, indulgence, and the opportunity they have afforded me with this endeavor. 01_596500 ffirs.qxd 6/30/05 2:34 PM Page xii 01_596500 ffirs.qxd 6/30/05 2:34 PM Page xiii Introduction “And so at last the beast fell and the unbelievers rejoiced. But all was not lost, for from the ash rose a great bird.