Friday, May 12, 2006

Tired of "Getting Lucky" with FireFox?

I've been trying to switch to FireFox for quite a while . . . it's great, don't get me wrong -- but Mozilla/SeaMonkey still do a few things better than FF.

TabMixPlus does handle *most* of what MultiZilla does; a few more session-management features and it'll be just fine.

And of course AdBlock works in both FF and Moz.

One of the last things that really bugs me is how FF uses Google's "I'm Feeling Lucky" search, showing the top-rated hit rather than a list of hits. Sure, the search bar is right there . . . but I just can't get used to using it.

So I finally peeked around and found the answer: Just change the keyword.URL config setting:

http://about.config gets the main config editor; filter for keyword.URL, and change the &btnI=I'm%20Feeling%20Lucky to &btnI=Google%20Search.

A Taste of XUL

Somehow, I managed to write CSS before the FireFox plugin CSSViewer . . . but now that it exists, I'll never do without it again!

There is one extremely minor usability issue with it: It has no hot-key -- and for a tool as useful as this one, that means way too much mousing around. Luckily, XUL makes it easy to tweak this -- we just need to add an AccessKey attribute to both the menu item and toolbar button.

Here's a step-by-step guide to doing that (with FF 1.05.03 and WinXP):

Navigate to the CSSViewer plugin location. In my case, that was:

C:\Documents and Settings\me\Application Data\Mozilla\Firefox\Profiles\salt1234.default\extensions\{8be51513-0433-45c1-9203-7b45019df871}

Within that folder is the plugin's chrome/ folder, containing the zip file CSSViewer.jar. Make a copy of that file, then rename the original to CSSViewer.zip (JAR files have the same format as ZIP's, so this is just an easy way to get "inside" it). Note that you'll need to shut down FireFox to rename the file.

In the ZIP file are assorted folders and files; we're interested in just two of the files:

content/CSSViewer.xul

locale/en-US/CSSViewer.dtd

We'll follow the author's intended use of XML entities to allow an easy path towards future localization, and add our two AccessKey entryies to the DTD file as XML entities. Open those two files in your favorite text editor, and make these changes:

================CSSViewer.dtd==============================
<!--ENTITY cssviewer.name "CSSViewer"-->
<!-- here are our two added entity definitions -->
<!--ENTITY cssviewer.accesskey-menu "V"-->
<!--ENTITY cssviewer.accesskey-toolbar "C"-->
===============/CSSViewer.dtd==============================

Next, we'll reference those entities in the XUL file, adding them as AccessKey attributes to two existing elements:

==================CSSViewer.xul============================
<toolbarpalette ...>
<toolbarbutton ... accesskey="&cssviewer.accesskey-toolbar;">
</toolbarbutton>

<menupopup ...>
<menuitem ... accesskey="&cssviewer.accesskey-menu;">
</menuitem>
=================/CSSViewer.xul============================

Note that we have a different key defined for the menu item than for the toolbar; this is to avoid hot-key conflicts.

The last step is to save those files, then rename the file back to .jar -- start FireFox, and you should see the V underlined in the menu, and find that ALT-C will turn the toolbar CSSViewer on or off.

Wednesday, January 11, 2006

FP

Just testing . . . .