Hacking Firefox at my library: instructions & stuff

I think I’ve done enough tinkering and tweaking with the Firefox hacking that I think I can share the instructions with the world. This post is on the long side, because I tried to make the instructions as clear as possible without too much tech speak, and without drowning you in too much minutia, while actually giving you proper instructions. Enjoy!

Now, you will need more than basic computer poking skills to make this work, and I must say, these instructions may not be *perfect* (for sooth, I’m basically trying to clean up my notes without having to rewrite everything). There are files to download and copy into places (userChrome.css and mozilla.cfg), and there are links to those files in the instructions. Make sure you get this working exactly how you want it before you try it on any other machines. Trust me, you don’t want to get to machine 4 and realize that you need to correct something big (I’ve *totally* been there ;D). If you have questions, post comments here, and I’ll do what I can. :)

Quick computer configuration context notes:

  • We have 4 “kiosk” machines right in front of the Information Desk, meant for catalog and quick internet stuff. Patrons only have access to a browser, readers for Adobe, Word, Excel, and Powerpoint, My Documents, Recycle Bin, basic Accessories, and Windows XP Accessibility tools.
  • The Reference room has 4 computers, and the Computer Lab has 6 computers. These computers are more “normal,” with the full Office Pro suite, FTP and web editing freeware, IM clients (Yahoo!, MSN, and AIM), Picasa, browsers and more.
  • All public computers have Deep Freeze Enterprise (which requires unfreezeing/refreezing the computer for the changes to take), Firefox installed.

Now, for the actual instructions…

Step 1: Install basic plug-ins
Go to: https://addons.mozilla.org/en-US/firefox/browse/type:7

Install basic plug-ins for:

  • Acrobat Reader (WITHOUT Adobe Photoshop® Album Starter Edition): This one takes the longest, and requires that Firefox is open when it starts, so do this one first.
  • Flash & Shockwave: both of these require Firefox to be closed, but are fairly quick, so do them second. This will insure that all the crazy web games for kids will work. Do a check by going to the test page on the Adobe site and making sure that the little animations actually work. If the Flash animation isn’t going, click on the puzzle piece to install it. If the Shockwave animation isn’t working, click on the puzzle piece to get to the download of the manual install.

All our machines have Java, Quicktime Alternative, and Real Alternative installed, so we don’t need those plug-ins, but you may need them if you opt for the originals (the latter two are just as well at the real ones, without all the nagware madness and update/app mail notice freakishness).

And, well, Windows XP comes with Windows Media Player.

Step 2: Install & Configure Add-ons
ALL MACHINES:
CuteMenus2
: Iconifies your menus, making them very visual.

REFERENCE KIOSKS ONLY:
Auto Reset Browser: Closes all the windows and open a new browser window after a specified time of inactivity. To change settings go to the Extension Manager (after you restart the browser), click Options (I set the refresh to 600 sec = 10mins).

Step 3: Other Firefox bits to configure

  1. Type about:config into the Firefox address bar (where you would normally type a URL). Type browser.sessionstore.enabled in the bar at the top of the page (not the address bar, but a blank field in the page), and double-click on it to set it to false. Do the same with browser.sessionstore.resume_from_crash. This should keep the browser from spewing a session restore dialog when the machine is restarted (I think this is why Auto Reset Browser tells you to disable Session Restore on the addon page). You can read more about what you can do with about:config file by checking out the knowledge base page on mozillaZine.
  2. Go to View >> Toolbars and uncheck Bookmarks Toolbar to turn that off.
  3. Tools >> Options menu fun (the caps indicate the tab within the options dialog box):
    • MAIN: Save files to My Documents.
    • TABS: New pages should be opened in a new window, to help people who might be confused by opening pages in new tabs.
    • TABS: Uncheck Warn me when closing multiple tabs.
    • CONTENT: Uncheck Block pop-up windows (because some sites require pop-ups, and it’s easier to leave them on than to confuse the user).
    • CONTENT: Click on the Manage… button under File Types. Search Adobe Acrobat, click on Change Action… to set to Open them with the default application (no more .pdf printing confusion from opening within the browser).
    • PRIVACY: Uncheck everything in the History section.
    • PRIVACY: Check everything in the Private Data section and in the Settings button window.
    • SECURITY: Uncheck Remember passwords for sites.

Step 4: Icons
Startup folder: Copy & paste Firefox icon, rename it Internet, delete the Public Web Browser icon. That way, Firefox will open on startup. The home page for the browsers is a web-based “button” interface to help people get around from within the library, because they like the button thing (but it’s not as crazy restrictive as, say, WinU or something like that).

Step 5: Hiding menu stuff
If you want more details on the stuff you can edit using the userChrome.css file, check out the Chrome element names and IDs page on on mozillaZine, as well as this discussion thread on Addons Mirror.

  • Copy userChrome.css (right-click/Ctrl-click to Save as… or drag and drop somewhere) to C:\Documents and Settings\public\Application Data\Mozilla\Firefox\Profiles\xxx.default\chrome (this will only make the change to the “public” user, in this case. You would need to copy this file to each user that you want to affect).
  • The userChrome.css file has code in it to hide specific whole menus and specific menu options, including Option and Add-ons. This is why all that other stuff needs to be done first. However, if you ever need to see these menus, the quick and easy way is to:
    1. Open the userChrome.css file
    2. Comment out (/* at the beginning of the line, */ at the end of the line) the
      • menuitem[label="Options..."], and/or the
      • menuitem[label="Add-ons"],

      lines (respectively, including the comma at the end).

    3. Save the file.
    4. Restart Firefox, and the menus will appear, so you can make your changes. When you’re done, uncomment the lines (delete the /* at the beginning of the line and */ at the end of the line), and save the file. You will need to restart Firefox logged in as the “public” user, in this case, to see the changes.

Here’s a composite image of all the menus in Firefox (click on the image for a larger view). CuteMenus2 makes them nice and visual, which actually helps people a lot.

Hacking Firefox: menu customizations

This is what the full window looks like, with our library start page loaded up.

Hacking Firefox: Full window view

Step 6: Locking down Firefox
Many, many thanks to silentk::cbx3 for his awesome posts — “Security Firefox for schools usage” part 1 and part 2 — for helping me figure this part out! For details on how this works, check out those posts.

The mozilla.cfg file contains stuff you really, really want to lock down. But why do we need this if we did all that other stuff with the options and hiding the menus and whatever? Using the mozilla.cfg file will make it so that even if they figure out how to unhide the menus from Step 5, they can’t actually change anything.

Let’s look at a quick example. You could prevent users from installing more plugins by editing the about:config file (see Step 3, above). However, if you do it that way, the next time the user tries to install a plugin, the browser will show a super-helpful message explaining that the option is disabled, and it will give the user a friendly button to press to re-enable the setting. That’s suboptimal, at best. So, consider this step insurance, especially against those super-industrious nosey users.

There are three parts to this step. Part one is to create a text file which contains the code that locks down specific items. Part two is to do something called byteshifting, so that Firefox can actually read the instructions you set in the text file. While “Security Firefox for schools usage – Part II” notes that byteshifting is unnecessary, the file didn’t work for me on Windows XP without that step. Part three is to tell the browser where to look for the instructions, so it’ll actually do what you tell it to.

Now, in an effort not to give away all of our hacky secrets to, say, the super-industrious Reading patrons ;D, you can download a modified version of our mozilla.cgf file (right click/Ctrl-click the link and Save as…, or drag the link somewhere to save), already byteshifted. Opening the file will just read as garbeldy gook, because it’s all in Mozilla’s crazy moon language. This mozilla.cfg file locks the following settings:

  • Start Page is whatever you set it as in the Firefox Options
  • Browser cache limited at 50mb
  • Disables automatic updates to the browser (So that it won’t harass the user with constant update notices. The Windows permissions on our computers don’t allow for users to install new programs, and with Deep Freeze installed, the updates wouldn’t take, anyway.)
  • Javascript and Java enabled
  • Downloads go to the last folder chosen to save downloads (will default to the folder set in the Options)
  • Keeps users from installing plugins, for serious.

If this satisfies all your wants and desires, then you can skip the next two paragraphs and follow the all.js file instructions that follow.Alternately, if you want to get all sorts of custom with yo bad self, you can check out the very detailed notes in the “Security Firefox for schools usage – Part II” post to make your very own file. If you’ve already gone through all the steps listed here, the bits you’ll need will depend on your library’s configuration. If you want help figuring it out, take a look at that post first and give it a shot, then post questions here as a comment (I can’t make custom files for people, but I can help you figure it out).

Once you have your mozilla.txt file all set, save it in a safe place, just in case you want to change it later. Now, you need to byteshift the file to convert it to a mozilla.cfg file, so that Firefox can actually read and execute your instructions. You can do this by going to the Upload mozilla.txt to get mozilla.cfg (byteshift 13) section of the Automatic Mozilla Configurator home page (about midway down). You will now have a nifty new mozilla.cfg file, which you should copy into the C:\Program Files\Mozilla Firefox\ folder.

Now you need to tell your browser how to find your new instructions.

  1. Make sure that Firefox is CLOSED.
  2. Open the C:\Program Files\Mozilla Firefox\greprefs\all.js in Notepad (double-clicking on this file will likely give you a Javascript error, so be sure to open it from Notepad, and have Notepad show you all file formats instead of just .txt files, then you’ll see it).
  3. Comment out thepref(”general.config.obscure_value”, 13); // for MCD .cfg filesline, so that it ends up looking like//pref(”general.config.obscure_value”, 13); // for MCD .cfg files
  4. Copy this line just below the line from step 2 above pref(”general.config.filename”, “mozilla.cfg”);so that the resulting code looks like this//pref(”general.config.obscure_value”, 13); // for MCD .cfg files
    pref(”general.config.filename”, “mozilla.cfg”);
  5. Save the all.js file and close it.

Easy way to manipulate plug-ins after you install the mozilla.cfg: Comment out the pref(”general.config.filename”, “mozilla.cfg”); line (by adding the // at the beginning of the line), then save. When you’re done, uncomment the line (by deleting the // at the beginning of the line) and save.

If at any point you want to alter the instructions in the mozilla.cfg file, you must make the changes in the mozilla.txt file, then byteshift it, then paste it over the existing file. It’s a lot of steps, so make sure you have what you want before you make it final.

Step 7: Other housekeeping – to do when testing

  • Open Adobe Reader application once, and be sure to check the box that tells Adobe not to show that big screen when it opens.
  • Check Firefox to make sure it works.

So yeah, that’s the long and long of it. Remember that you can play with just parts of these instructions to, say, customize your copy of Firefox on your home computer, or make a snazzy custom browser at work.

Just a note, I’ll be out of town starting Sunday, back on the web officially Tuesday, and I’ll do what I can about answering questions in between. Happy Merry to you all!

8 Comments so far

  1. Karin Dalziel on December 20th, 2007

    Ow. My brain hurts. Thanks for writing all that up! :)

  2. heidi on December 20th, 2007

    Hi Andrea, I was thinking about configuring Firefox on our circ/ref computers at the desk. We have FF installed but we haven’t been using it. Have you done this at your library? Do you have any suggestions on toolbars or search plugins if you have?

    Good tips for public computers, thanks!

  3. Andrea Mercado on December 21st, 2007

    @Karin: Glad to do it! I know, it’s a lot of stuff, and I struggled with how to actually present it so that it wasn’t a crazy nightmare. My notes to myself are much sparser, but I know my readership is much skill-varied in the ways of hack fu. So I s’pose it’s better thorough than full of holes. Hopefully people will ask questions in the comments, and I can help clarify/simplify things that way.

  4. Andrea Mercado on December 21st, 2007

    @heidi: Most of our departments use Firefox by default, because it helps everyone avoid the potential problems that come with IE (I tweeted my nightmare with a staff machine that was all sorts of IE spyware infested), and because we have several people on staff who appreciate open source happiness. :)

    It wasn’t hard to do, really, since to staff it’s just another browser. Getting people used to tabs was fun (this was before IE7 and IE tabs), but for the most part if a specific segment of staff is having a problem, we just set the options to open new windows in windows instead of tabs.

    As for toolbars and plugins, that totally depends on your staff and what they do. If your staff uses del.icio.us, or some other bookmarking site, I’d say install the plugin for that.

    Install as many search widgets for the Firefox integrated search bar as your staff may use. I know we use the Google, Amazon, IMDB, Wikipedia searches all the time, and I personally use the searches for Urban Dictionary, A List Apart, and a few others. Feel free to customize this bit at will. I know that NOBLE developed a bunch of search widgets specific to our catalog which we use; creating those is really easy to do, just check out the documentation page for more info.

    I also very much like the CuteMenus2 plugin (mentioned in the post), since it makes the menus very visual, which can help the less-technical navigate around. I don’t really like using additional toolbars, since I think it clutters things up (and people tend to move them accidentally).

    Other than that, it really depends. Most people, unless they know that Firefox can do something fancy and particular for them, will just use it as a browser, and not many bells and whistles are necessary. But, if you have particular things in mind, lemme know, and we can brainstorm a few ideas.

    Alternately, you can just poke around and play with plugins. If you have a moment of “I wish Firefox could do ,” you should search the plugins directory for that keyword, you’ll be surprised what you’ll find (I always am).

  5. Sue Woodson on December 21st, 2007

    Wow. This is great. Many thanks for all the work you put in.

    We’re finally getting FF up on our public machines over intersession. As usual the technology wasn’t the problem :)

    FYI — We’ve added the LibX toolbar http://libx.org to FF on our public machines. It’s a fantastic tool. One of my favorite features is an autodiscovery element that will create links back to our catalog from other sites like Amazon and Barnes & Noble (once it sees the ISBN.) You have to configure it for your own library but it’s not all that hard.

    happy holidays

  6. Andrea Mercado on December 21st, 2007

    @Sue: Thanks for the kind words! If you use any of it, any feedback would be super. “As usual the technology wasn’t the problem.” :D ! Too often this is the case. Glad to hear that things are progressing, though. It’s also great to hear that you’ve been having such a good time pimping your browsers.

    Something I’ve noticed about our public library patrons: they like simplicity and consistency. I find that if we add too many things to the browsers here, when they go home and the browser doesn’t do just the same thing, it’s confusing. Most (but not all) patrons don’t want to install more widget at home.

    This might just be a difference between academic and public library users. Since academic users seem to love tools, it make sense, whereas most public library users, in my experience, are looking for basic browsing and fewer tools. Of course, this isn’t a defining observation; I’m sure there are public library patrons out there who love this stuff, I was one of them. :)

  7. heidi on December 21st, 2007

    Thanks Andrea! I’m the one that sets up the links on our desk IE Browser, most of the links are for things I know we can get search plugins for. I really just need to do it because I think I think using FF on the desk is so much easier with the right things installed. I’ve already created a search plugin for our catalog a long time ago too. Those things are actually darn easy to create!

    The CuteMenus2 plugin is new to me, so that’s a helpful one.

    Also as a side note, while I didn’t do this for a library, I set up Firefox on my mom’s computer by disguising it as IE. I found her a theme that looked like IE and even changed her FF desktop icon to look like IE’s because she was already used to clicking on it. Then when I showed her a few of the search plugins and other features that were different from IE she thought those were way cool.

  8. Andrea Mercado on December 22nd, 2007

    I *love* the idea of baiting people into Firefox by disguising it as IE! That’s so awesome! Especially since the Firefox skins make that so easy, and as long as you know how to redirect a desktop icon, it’s wonderfully deceptive.

    Is there anything interesting you want the browser to do that you haven’t made it do yet?

Leave a reply