Team LiB
Previous Section Next Section

Hack 31. Take Firefox with You

Install a portable version of Firefox so that you can move from computer to computer.

This hack explains how to take Firefox with you wherever you go. You can install Firefox on a number of mobile devices. Whether it can run directly on the device, write data there, or merely be stored conveniently depends on the device. We'll consider these devices:

  • A laptop

  • A server-based virtual private network (VPN)

  • A roaming VPN

  • A mobile consumer device, such as a digital camera, mobile phone, or PDA

  • A USB drive

  • A RAM drive

It's the so-called removable media (USB and RAM drives) that are the interesting cases. Let's briefly dispose of the other possibilities first.

3.11.1. Laptop

If you install Firefox on a laptop, you can surf the Web using that laptop from anywhere that TCP/IP connectivity is in placea WiFi hotspot, for example. It's up to you to ensure that the laptop acts as its own firewall, or else that it correctly establishes a VPN with the organization that you're using as an Internet gateway. If that's done, Firefox typically just needs to be set up direct connect with no proxy.

3.11.2. Server-Based VPN

A server-based VPN runs Firefox on your computer after the install area is loaded from the server disk. All you need is file-sharing access and perhaps server login [Hack #14] .

3.11.3. Roaming VPN

A roaming VPN runs Firefox from a local or remote installation, but it also replicates your profile area from a central server to local disk. At the moment, this has to be set up using special network admin steps [Hack #28] . Automatic roaming is not supported in Firefox 1.0, but at the time of this writing, this functionality is close to being finished. Perhaps it will be available in Version 1.1.

3.11.4. Mobile Consumer Devices

Memory-rich consumer devices such as digital cameras can sometimes be recognized as USB or Bluetooth drives by a host computer. In this case, they operate just like a USB key drive and can perform the same way, as discussed in the following section.

The press has reported that a version of Mozilla is slated to run directly inside Nokia mobile phones, and possibly in another vendor's mobile phones as well. Such versions aren't strictly Firefox but do display pages using the same Gecko technology as Firefox.


3.11.5. USB Drive

Here's where things start to get interesting. If you can carry Firefox on a USB drive, you can plug it in and run it wherever you go.

There are several options for USB-based Firefox installs. The simplest is to put the standard Firefox installer on the key drive and install it everywhere you go, like Johnny Appleseed planting apples. That puts both the install area and the profile area on the local hard disk, and none of your profile files move with you.

3.11.5.1 Get PortableFirefox

John Haller has repackaged and reconfigured the official Firefox 1.0 install into PortableFirefox, which can run entirely from USB. This means the install area and the profile area are both retained on the USB drive while Firefox runs. See his work and get his package at http://portablefirefox.mozdev.org/

This package is too large to fit on a floppy disk, but it will fit on a Zip drive. Zip drives, however, are slow to access. PortableFirefox contains official Firefox software.

3.11.5.2 Use a USB launcher

If you don't want to be tied to a custom distribution, you can use the Firefox Launcher tools, available at http://people.emich.edu/mkinnunen/tblaunch/ (Windows only).

The Firefox Launcher is a small Windows program that starts up Firefox once you've installed the profile and install areas on the USB key. Install it on the USB key as well. A trivial launcher can also be made using a simple .bat file. It need only contain the following lines:

cd U:\
start \install\Firefox\Firefox.exe -profile \profiles\ProfileName

Here, the install and profile areas are preloaded to the equivalent directories on the USB drive.

3.11.5.3 Build a USB-aware Firefox

Finally, another alternative is to smarten Firefox up so that it scans for profiles on any USB drives that are plugged in. This leaves the install area on the local computer, and the profile data (your important data) follows you wherever you go. This link describes a customization that provides this feature, but at the time of writing, you have to be able to compile Firefox with these changes in place yourself:

http://www.cs.sjsu.edu/faculty/pollett/masters/Semesters/Spring04/Yun/index.shtml

The Mozilla Thunderbird email product has formally planned support for USB drives. The benefits of that work will probably also benefit Firefox, but most likely not until a minor version later than 1.0. Read the release notes for Firefox 1.1 and later versions to see if that feature has arrived yet.

3.11.6. RAM Drive

If you can make Firefox run from a RAM drive, you're one step closer to running it from any drive, anywhere. This URL describes how to put Portable Firefox on a RAM drive on Windows:

http://www.patik.com/guides/mozilla/ffram

RAM drives are somewhat overkill on Linux/Unix. To put Firefox in RAM on Unix, simply execute these commands, which load all Firefox files into the disk buffer cache, where they are subsequently accessed at RAM speed:

find 
/path/to/firefox/install
 ! -type d | xargs cat > /dev/null
find 
/path/to/firefox/profile
 ! -type d | xargs cat > /dev/null

This will not, however, remove the need for a disk drive, and neither will it keep Firefox in memory if the system has heavy disk access.

At the time of writing, there is not yet a Knoppix-like CD distribution of Firefox alone, although Knoppix distributions exist that include Firefox. For a real, memory-locked Firefox on Linux or Solaris, create a tmpfs filesystem and install, copy, or load standard Firefox there each time you need to use it. Knoppix distributions automate that process but allow bookmarks to be stored only until the PC is rebooted.

    Team LiB
    Previous Section Next Section