tips-computer-firefox

Firefox tips and tweaks

I'm currently transitioning from firefox 2 to firefox 3, so there are some minor inconsistencies in this page.

Tips

Preferences

add-ons

Check out https://addons.mozilla.org/firefox/recommended/ and addons sorted by popularity and addons sorted by rating.

See https://addons.mozilla.org/collections/bayle-shanks/bshanks/ for a list of add-ons that i like.

Other comments about some addons:

Addons that let you post stuff to identi.ca/twitter:

Tab clicking options

extensions i'd like to see but that i can't find

about:config

A list of about:config settings is at http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries.

keyconfig

gBrowser.mTabContainer.advanceSelectedTab(-1);F21 (joystick)
gBrowser.mTabContainer.advanceSelectedTab(1);F22 (joystick)
BrowserBack?();F19 (keyboard special key, joystick)
BrowserForward?();F20 (keyboard special key, joystick)
BrowserOpenTab?();F24 (joystick)
BrowserCloseTabOrWindow?()F23 (joystick)

bookmarklets

Compiling Firefox 3 on Debian

Here's what I did to compile Firefox 3 on my Debian system. I don't really know what I'm doing here (e.g. not sure if I really needed xulrunner, not sure if a static build was a good idea) but it seemed to work:

aptitude install libxp-dev liborbit2-dev libidl-dev libgnome2-dev libgconf2-dev libgnomevfs2-dev libgnomeui-dev librsvg2-bin libhunspell-dev libnss3-dev

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk

cd mozilla/

./configure --with-system-jpeg=/usr --with-system-zlib=/usr --disable-composer --disable-elf-dynstr-gc --disable-gtktest --disable-install-strip --disable-installer --disable-ldap --disable-mailnews --disable-profilesharing --disable-strip --disable-strip-libs --disable-tests --disable-mochitest --disable-updater --disable-xprint --enable-application=browser --enable-canvas --enable-default-toolkit=cairo-gtk2 --enable-gnomevfs --enable-optimize --enable-pango --enable-postscript --enable-svg --enable-mathml --enable-xft --enable-xinerama --enable-extensions=default --enable-single-profile --enable-system-myspell --enable-static --disable-shared --disable-libxul

make -f client.mk checkout MOZ_CO_PROJECT=browser,xulrunner

make install

Changing the "Bookmark this page" default to "unsorted bookmarks"

By default, clicking the star places a bookmark in "unsorted bookmarks", while using the "Bookmark this page" menu item places defaults to the "bookmarks menu" folder.

I haven't made an add-on, but here is how to change the "Bookmark this page" default to "unsorted bookmarks" in case anyone is interested. This provides a quick way to tag links without adding them to the bookmarks menu.

In chrome/browser.jar/content/browser/browser.xul (note that .jar files are archives), replace:

<command id="Browser:AddBookmarkAs?" oncommand="PlacesCommandHook?.bookmarkCurrentPage(true, PlacesUtils?.bookmarksMenuFolderId);"/>

with:

<command id="Browser:AddBookmarkAs?" oncommand="PlacesCommandHook?.bookmarkCurrentPage(true, PlacesUtils?.unfiledBookmarkFolderId);"/>

In more detail.

1) cd <firefox-directory>/chrome 2) unzip browser.jar 3) Edit content/browser/browser.xul, making the replacement described above 4) zip -rD0 browser.jar content/browser/ 5) Restart Firefox

Preventing Firefox from stealing focus

A really annoying thing that Firefox sometimes does is hop between virtual desktops/workspaces when it starts up, or when you open a new tab from an external program.

This is because Firefox tells the window manager that it wants to grab focus when these things happen, and some window managers move applications between desktops/workspaces when they grab focus.

There are two ways to deal with this. The best solution is to tell your window manager never to move a window to a new workspace just because it wants focus. In XFCE this is done by creating a file at ~/.config/xfce4/xfwm4/xfwm4rc and putting the line

activate_action=switch

in it (switch means to switch to that application's desktop/workspace when it grabs focus; instead of switch, you could put none, which means to do nothing when an application in another desktop grabs focus).

A quick way to add that line to that file is:

echo activate_action=none >> ~/.config/xfce4/xfwm4/xfwm4rc

Another solution that you could use if your window manager can't be reconfigured is to create a script to be used in place of firefox. On Debian:

cat /dev/tty > /usr/local/bin/iceweasel-open
#!/bin/sh

/usr/bin/iceweasel $@
wmctrl -r Iceweasel -t 0; wmctrl -a Iceweasel
^D
chmod a+x /usr/local/bin/iceweasel-open
ln -sf /usr/local/bin/iceweasel-open /etc/alternatives/x-www-browser 

mutt uses urlviewer, which uses x-www-browser, so this method will prevent mutt at least from bringing firefox to your desktop.