FASTER>>FASTER>>
Boost browsing and page rendering speeds
Mel Reyes
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 development.
Mel can be reached by e-mail at mel@mrtech.com.
Foreword
If software is an art—and I think it is—then I must be the only artist in the world who advocates
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 hackers
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 escalating
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 community
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
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. The bird gazed down upon the unbelievers and cast fire and thunder upon
them. For the beast had been reborn with its strength renewed, and the followers of Mammon
cowered in horror.”
from The Book of Mozilla, 7:15
Assumptions
To use this book and reap its benefits, you should have a solid foundation in using Windows/
Linux and Mozilla Firefox. This book covers basic to advanced hacks, the majority of which are
compatible with any platform that the Firefox 1.0 official release currently runs on.
Using This Book and What You Will Find Here
To use this book, all you need to do is have a basic understanding of how Firefox works, how to
install it, and how to find files on your computer. As you read, you will begin to unravel the
marvels of coding for Firefox using the basics of Cascading Style Sheets (CSS) and JavaScript
and then later diving into XML User Interface Language (XUL) and the Cross Platform
Component Object Model (XPCOM). The final goal is being able to create extensions that
will allow you to customize Firefox to your heart’s content.
This book starts by giving you a brief overview of how to hack manually, how to hack with
extensions, and then a quick glance at what you will need to do to back up critical files so that
you can practice safe hacking.
Then it breaks down each of the individual components of Firefox from interface to rendering
to privacy and walks you through hacking and modifying key files to apply tons of possible
interface and functionality changes. It also includes a great list of proven extensions with which
you can modify core features of Firefox, as well as the look and feel of the interface.
In addition, this book covers the grassroots efforts that Mozilla and Firefox have become
known for among developers—the ability to use the highly extendable Mozilla programming
language and interface to modify any aspect of the browser by creating extensions, and also
how you can change the appearance of the browser by creating themes.
Product details
Price
|
|
---|---|
File Size
| 13,933 KB |
Pages
|
459 p |
File Type
|
PDF format |
ISBN-13
ISBN-10 | 978-0-7645-9650-6 0-7645-9650-0 |
Copyright
| 2005 by Wiley Publishing, Inc |
Contents at a Glance
Foreword
Acknowledgments
Introduction
Part I: Basic Hacking
Chapter 1: Hacking Firefox Boot Camp
Chapter 2: Hacking Around Manually
Chapter 3: Hacking Extensions
Chapter 4: Hacking Themes and Icons
Part II: Hacking Performance, Security, and Banner Ads
Chapter 5: Performance Tweaks and Hacks
Chapter 6: Hacking Security and Privacy
Chapter 7: Hacking Banner Ads, Content, Images, and Cookies
Part III: Hacking Menus, Toolbars, and the Status Bar
Chapter 8: Hacking Menus
Chapter 9: Hacking Toolbars and the Status Bar
Part IV: Hacking Navigation, Downloads, and Searching
Chapter 10: Hacking Navigation and Tab Browsing
Chapter 11: Download and Plugin Hacks
Chapter 12: Search Hacks
Part V: Installation, Automation, Tools, and Tricks
Chapter 13: Hacking Installation and Deployment
Chapter 14: Backing Up and Managing Your Profile/Settings
Chapter 15: Hacking Tools for Web Programmers
Part VI: Creating Extensions and Themes
Chapter 16: Understanding Mozilla Programming
Chapter 17: Creating Extensions
Chapter 18: Creating Themes
Index
Table of Contents
Foreword . . . . . . . . . ix
Acknowledgments . .. . . . . . . . . . xi
Introduction . . . . . . . . xiii
Assumptions . . . . . . . . . . . . . xiii
Using This Book and What You Will Find Here . . . . . . . . xiii
Conventions Used in This Book . . . . . . . . . . . xiv
Being a Part of the Community . . . . . . . . . xiv
Searching and Submitting Firefox Bugs . . . . . . . xv
Part I: Basic Hacking
Chapter 1: Hacking Firefox Boot Camp
Installing the Document Inspector Gadget . . . . . . . . . . . . . . . . . . . . . . 3
Editing and Programming Text Tools . . . . . . . . . . . . . . . . . . . . . . . . . 7
Using the JavaScript Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
What and Where Is My Profile? . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Finding Your User Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Express Pass to Your Profile Path . . . . . . . . . . . . . . . . . . . . . . . 12
Backing It Up Before Hacking It Up . . . . . . . . . . . . . . . . . . . . . . . . . 13
Saving the Installer, Extensions, and Theme Files . . . . . . . . . . . . . . . 13
Backing Up Critical Files . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2: Hacking Around Manually
Using Hidden about:config to Hack . . . . . . . . . . . . . . . . . . . . . . . . . 17
Hacking Your Profile Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Hacking the prefs.js File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Hacking the user.js File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Hacking Browser and Web Page Content . . . . . . . . . . . . . . . . . . . . . . 23
Hacking the userChrome.css File . . . . . . . . . . . . . . . . . . . . . . . 23
Hacking the userContent.css File . . . . . . . . . . . . . . . . . . . . . . . 25
Basic Hacking with Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Hacking with the chromEdit Extension . . . . . . . . . . . . . . . . . . . . 27
Hacking with the Configuration Mania Extension . . . . . . . . . . . . . . 28
Hacking with the Preferential Extension . . . . . . . . . . . . . . . . . . . . 29
Hacking an Extension’s Options . . . . . . . . . . . . . . . . . . . . . . . . 30
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Chapter 3: Hacking Extensions
Understanding Older versus Newer Extensions . . . . . . . . . . . . . . . . . . . 34
Recovering from Disabled Older Extensions . . . . . . . . . . . . . . . . . 34
Removing Older Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Starting Over without Losing All Your Settings . . . . . . . . . . . . . . . . 37
Why Won’t Some Extensions Install? . . . . . . . . . . . . . . . . . . . . . . . . . 39
Installing Remotely versus Locally . . . . . . . . . . . . . . . . . . . . . . . 39
Using MR Tech’s Local Install Extension . . . . . . . . . . . . . . . . . . . 40
Where Did It Get Installed? . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Hacking Older Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Changing Supported Version Number . . . . . . . . . . . . . . . . . . . . . 43
Modifying Code within an Extension . . . . . . . . . . . . . . . . . . . . . 44
Hacking the Extension Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Listing Your Extensions and Themes . . . . . . . . . . . . . . . . . . . . . 48
Hacking with the Slim Extension List Extension . . . . . . . . . . . . . . . 51
Hacking with the EMbuttons Extension . . . . . . . . . . . . . . . . . . . 51
Recommended Extensions by Category . . . . . . . . . . . . . . . . . . . . . . . 53
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 4: Hacking Themes and Icons
Changing the Window’s Background Color . . . . . . . . . . . . . . . . . . . . . 58
Using a Tiled Image for the Window’s Background . . . . . . . . . . . . . . 62
Reducing Space around Toolbar Icons . . . . . . . . . . . . . . . . . . . . . 65
Hacking Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Reenabling Dynamic Theme Switching . . . . . . . . . . . . . . . . . . . . 67
Hacking Older Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Recovering from Disabled Older Themes . . . . . . . . . . . . . . . . . . . 69
Why Won’t Some Themes Install? . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Installing Remotely versus Locally . . . . . . . . . . . . . . . . . . . . . . . 70
Using the Local Install Extension . . . . . . . . . . . . . . . . . . . . . . . 71
Hacking via userChrome.css . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Hacking Website Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Enabling Icons for Bookmarks and Websites . . . . . . . . . . . . . . . . . 77
Removing Favicons Manually . . . . . . . . . . . . . . . . . . . . . . . . . 77
Removing Icons with the Delete Icons Extension . . . . . . . . . . . . . . . 79
Recommended Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Part II: Hacking Performance, Security, and Banner Ads
Chapter 5: Performance Tweaks and Hacks
Deviating from RFC Specs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Hacking Simultaneous Connections . . . . . . . . . . . . . . . . . . . . . . 84
Pipelining Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Other Hacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Optimizing Page Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Hacking Page Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Unblocking Error Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Disabling Smooth Scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Bandwidth and Processor-Specific Optimizations . . . . . . . . . . . . . . . . . . 88
Optimizing Disk and Memory Cache . . . . . . . . . . . . . . . . . . . . . . . . 91
Changing Disk Cache Location . . . . . . . . . . . . . . . . . . . . . . . . 91
Viewing, Changing Size, and Cleaning Your Disk Cache . . . . . . . . . . . 92
Increasing Memory Cache Size . . . . . . . . . . . . . . . . . . . . . . . . 93
Windows Memory Optimization Hack . . . . . . . . . . . . . . . . . . . . . . . 94
Venturing into Optimized Third-Party Builds . . . . . . . . . . . . . . . . . . . . 96
Spring Cleaning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Refreshing Your XUL Cache File . . . . . . . . . . . . . . . . . . . . . . . 99
Cleaning Up after Uninstalling or Upgrading . . . . . . . . . . . . . . . . . 99
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Chapter 6: Hacking Security and Privacy
Concerns with Saving Form or Login Data . . . . . . . . . . . . . . . . . . . . . 101
Creating a Master Password . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Covering Your Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Cleaning Up Browsing History . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Download Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Blocking Unwanted Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Reviewing Stored Cookies and Removing Them . . . . . . . . . . . . . . . 110
Preemptively Blocking Known Undesirable Cookies . . . . . . . . . . . . . 110
Using the Mozilla Update Service . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Disabling Extension Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Disabling Suspicious JavaScript Features . . . . . . . . . . . . . . . . . . . . . . 114
Disabling Windows shell: Protocol . . . . . . . . . . . . . . . . . . . . . . . . . 115
Anti-Phishing Measures and Tools . . . . . . . . . . . . . . . . . . . . . . . . . 116
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Chapter 7: Hacking Banner Ads, Content, Images, and Cookies
Using the Block Image Function . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Using Built-in Content Handling to Block Ads . . . . . . . . . . . . . . . . . . 123
Blocking Rules with the Adblock Extension . . . . . . . . . . . . . . . . . . . . 127
Blocking Nuisance Images . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Using Simple Blocking Rules . . . . . . . . . . . . . . . . . . . . . . . . . 129
Understanding Regex Pattern Matching . . . . . . . . . . . . . . . . . . . 131
Starter Regex Samples Expression Rules . . . . . . . . . . . . . . . . . . . 132
Blocking JavaScript and DHTML Tricks . . . . . . . . . . . . . . . . . . 134
Blocking Cookies Options and Tools . . . . . . . . . . . . . . . . . . . . . . . . 134
Tools for Cleaning Unwanted Cookies . . . . . . . . . . . . . . . . . . . . . . . 136
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Part III: Hacking Menus, Toolbars, and the Status Bar
Chapter 8: Hacking Menus
Hacking Menus Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Hiding Menu Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Hack Menu Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Hack Menu Fonts and Style . . . . . . . . . . . . . . . . . . . . . . . . . 146
Hacking Menus with Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Hacking Menu Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Theme-Supported, Customized Menu Icons . . . . . . . . . . . . . . . . . 150
Hacking with the CuteMenus Extension . . . . . . . . . . . . . . . . . . . 153
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Chapter 9: Hacking Toolbars and the Status Bar
Removing and Changing Toolbar Buttons . . . . . . . . . . . . . . . . . . . . . 157
Showing System Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Show Mozilla Update Icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Adding Customized Toolbar Buttons . . . . . . . . . . . . . . . . . . . . . . . . 162
The EMButtons Extension . . . . . . . . . . . . . . . . . . . . . . . . . . 163
The Toolbar Enhancements Extension . . . . . . . . . . . . . . . . . . . . 164
Adding Useful Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Using the Googlebar Extension . . . . . . . . . . . . . . . . . . . . . . . . 166
Using the Yahoo! Toolbar Extension . . . . . . . . . . . . . . . . . . . . . 168
Using the Web Developer Extension . . . . . . . . . . . . . . . . . . . . . 169
Hacking the Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Current Date/Time with Statusbar Clock Extension . . . . . . . . . . . . . 170
Display the Weather with ForecastFox . . . . . . . . . . . . . . . . . . . . 171
Playing Music with the FoxyTunes Extension . . . . . . . . . . . . . . . . 173
On-the-Fly Proxy Switching with the SwitchProxy Extension . . . . . . . 173
The StockTicker Extension . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Part IV: Hacking Navigation, Downloads, and Searching
Chapter 10: Hacking Navigation and Tab Browsing
Setting Your Home Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Specifying a Single Home Page . . . . . . . . . . . . . . . . . . . . . . . . 179
Specifying Multiple Home Pages . . . . . . . . . . . . . . . . . . . . . . . 180
Opening New Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Tab Browsing Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Using userChrome.css to Hack Tabs . . . . . . . . . . . . . . . . . . . . . 185
Bring Back Those Lost Tabs . . . . . . . . . . . . . . . . . . . . . . . . . 186
Using Extensions to Hack Tab Browsing . . . . . . . . . . . . . . . . . . . 188
Better Browsing through Better Mousing . . . . . . . . . . . . . . . . . . . . . . 191
Using Configuration Mania to Adjust Your Mouse Scrolling . . . . . . . . 193
Show Your Artistic Side with Mouse Gestures . . . . . . . . . . . . . . . . 194
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
Chapter 11: Download and Plugin Hacks
Hacking Download Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Clearing Download History . . . . . . . . . . . . . . . . . . . . . . . . . 198
Other Useful Hacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Hacking Downloads with Extensions . . . . . . . . . . . . . . . . . . . . . . . . 202
Showing Downloads in the Status Bar Using the
Download Statusbar Extension . . . . . . . . . . . . . . . . . . . . . . 202
Showing Download Manager in the Sidebar or Tab
with Download Manager Tweak Extension . . . . . . . . . . . . . . . . 204
Disabling Blank Download Windows with the Disable Targets
for Downloads Extension . . . . . . . . . . . . . . . . . . . . . . . . . 206
Sorting Downloads to Directories with the Download Sort Extension . . . 208
Hacking MIME Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Understanding File MIME Types . . . . . . . . . . . . . . . . . . . . . . 209
Using the Mimetype Editor and LiveHTTPHeaders Extensions . . . . . . 210
Hacking External Download Managers . . . . . . . . . . . . . . . . . . . . . . . 213
Using Launchy to Handle External Programs . . . . . . . . . . . . . . . . 214
Using FlashGot to Handle External Programs . . . . . . . . . . . . . . . . 215
Seamless Download Integration . . . . . . . . . . . . . . . . . . . . . . . 215
Hacking Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Checking Installed Plugins with about:plugins . . . . . . . . . . . . . . . . 217
Using Available Plugins without Reinstalling . . . . . . . . . . . . . . . . 218
Disabling Plugin Support for Specific File Extensions . . . . . . . . . . . . 220
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Chapter 12: Search Hacks
Adjusting the Default Google Search . . . . . . . . . . . . . . . . . . . . . . . . 223
Using Quick Searches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Hacking the Search Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Searching from the Web Page Itself . . . . . . . . . . . . . . . . . . . . . . . . . 227
Web Searches Using the Context Menu . . . . . . . . . . . . . . . . . . . 227
Define Words in Web Pages . . . . . . . . . . . . . . . . . . . . . . . . . 227
Add Translation Tools to Your Menus . . . . . . . . . . . . . . . . . . . . 230
Put Your Search Results in a Sidebar . . . . . . . . . . . . . . . . . . . . . 230
Open Your Search Results Quickly with Linky . . . . . . . . . . . . . . . . 232
Turning Nonlinked Links into Linkable Links . . . . . . . . . . . . . . . . 234
Searching within the Web Page . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Recommended Search Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Googlebar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Ultrabar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Yahoo! Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Part V: Installation, Automation, Tools, and Tricks
Chapter 13: Hacking Installation and Deployment
Built-in Installer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Using Command-Line Options . . . . . . . . . . . . . . . . . . . . . . . 244
Extracting the Installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Command-Line Installer Extraction . . . . . . . . . . . . . . . . . . . . . 246
Hacking the Configuration INI File . . . . . . . . . . . . . . . . . . . . . 247
Installation and Profile Customization Options . . . . . . . . . . . . . . . . . . . 249
Automated Profile Creation . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Adding Global Extensions and Themes . . . . . . . . . . . . . . . . . . . 250
Deploying Plugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Create a Custom Windows Desktop Icon . . . . . . . . . . . . . . . . . . 253
Hacking the Desktop Icon with Nullsoft Installer Script . . . . . . . . . . 253
Other Notable Deploy Tools . . . . . . . . . . . . . . . . . . . . . . . . . 256
Creating a Custom Installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Custom Nullsoft Scriptable Install System Installer . . . . . . . . . . . . . 257
Other Notable NSIS Code . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Hacking Microsoft Windows Installers . . . . . . . . . . . . . . . . . . . . 260
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Chapter 14: Backing Up and Managing Your Profile/Settings
Before You Begin, Back Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Finding and Using the Hidden Profile Manager . . . . . . . . . . . . . . . . . . 268
Creating and Deleting Profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
What’s in a Profile? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Move Your Profiles Around . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Creating a Portable Profile . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Manually Backing Up Critical Data . . . . . . . . . . . . . . . . . . . . . 274
Automatic Backups of Critical Files . . . . . . . . . . . . . . . . . . . . . 275
Unofficial Mozilla Backup Tool . . . . . . . . . . . . . . . . . . . . . . . . 275
Backing Up Plugins and Other Components . . . . . . . . . . . . . . . . . 276
Recommended Extensions for Backups . . . . . . . . . . . . . . . . . . . . . . . 277
Bookmark Backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Bookmarks Synchronizer . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
fireFTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Chapter 15: Hacking Tools for Web Programmers
Configuration Hacking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
HTTP Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Organizing Web Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
The Godfather of Web Programming Extensions . . . . . . . . . . . . . . . . . . 284
Key Web Developer Features . . . . . . . . . . . . . . . . . . . . . . . . . 285
Hacking Tools of the Trade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
HTML Hacking Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Navigation and Link Hacking Tools . . . . . . . . . . . . . . . . . . . . . 291
JavaScript and XUL Hacking Tools . . . . . . . . . . . . . . . . . . . . . . 292
Page Validation Hacking Tools . . . . . . . . . . . . . . . . . . . . . . . . 294
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Part VI: Creating Extensions and Themes
Chapter 16: Understanding Mozilla Programming . . . . . . . . . . . . 299
Understanding Mozilla Technologies . . . . . . . . . . . . . . . . . . . . . . . . 299
XUL: XML User Interface Language . . . . . . . . . . . . . . . . . . . . 300
JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Cascading Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
The Document Object Model . . . . . . . . . . . . . . . . . . . . . . . . 309
XPCOM: Cross Platform Component Object Model . . . . . . . . . . . . 314
Introduction to Firefox Extension Programming . . . . . . . . . . . . . . . . . . 316
What Are Firefox Extensions? . . . . . . . . . . . . . . . . . . . . . . . . 316
The Extension Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
Chapter 17: Creating Extensions
Tools for Creating Extensions and Themes . . . . . . . . . . . . . . . . . . . . . 321
Text Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
ZIP Format Compression Tool . . . . . . . . . . . . . . . . . . . . . . . . 322
Graphics Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Building Your First Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Introduction to Chrome . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Creating the SiteLeds Extension . . . . . . . . . . . . . . . . . . . . . . . 326
Extension Programming Techniques . . . . . . . . . . . . . . . . . . . . . . . . 346
Understanding the Browser Chrome . . . . . . . . . . . . . . . . . . . . . 346
More XUL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Firefox Customization Options . . . . . . . . . . . . . . . . . . . . . . . . 366
Advanced Packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Chapter 18: Creating Themes
Tools for Creating Themes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Text Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Image/Graphics Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
ZIP-Format Compression Tool . . . . . . . . . . . . . . . . . . . . . . . . 382
Building Your First Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Define and Create Your Theme’s Core Files . . . . . . . . . . . . . . . . . 383
Generate a Custom GUID . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Customizing Chrome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Using the DOM Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Understanding CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Creating Needed Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Overlay Default Icons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Graphics Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Icon Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Supporting Popular Extension Buttons . . . . . . . . . . . . . . . . . . . . 396
Packaging the Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Creating an Update Definition File . . . . . . . . . . . . . . . . . . . . . . 399
Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Using the DOM Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Deploying Your Theme . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Creating JavaScript Installer Links . . . . . . . . . . . . . . . . . . . . . . 401
Making Your Theme Public . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Supporting Different Operating-System Platforms . . . . . . . . . . . . . 402
Hacking Existing Themes . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Index . .. . . . . . . . 405
●▬▬▬▬▬❂❂❂▬▬▬▬▬●
●▬▬❂❂▬▬●
●▬❂▬●
●❂●