Customizing Firefox (without sputtering with rage)

Posted on Wed, 13 Aug 2008 in Technology
Last edited Wed, 13 Aug 2008

If you have ever tried to figure out how to add a custom keybind to Firefox, you know it is a frustrating, infuriating, and futile task. There is no reasonable way to do it. There's a way that seems to have worked six years ago, and requires you to edit the firefox installation instead of your profile. There's extensions that might add the keybinds you want, but they all suck in one way or another. There's an extension that lets you add keybinds with the GUI, but it stores them in your user prefs so there's no way to sync them between machines. You could make your own extension, but then you have to figure out all the stupid boilerplate that extensions require and reinstall it every time you make a change.

All I really want is a text file somewhere I can edit. When I add a binding to emacs, I add a single line to a single text file. The file is in a git repository, so syncing changes is easy. This blissful state of affairs actually can be achieved in firefox; and here's how you do it:

Firefox can load an extension from a path outside the profile directory. So you just create an extension with your personal customizations, and just edit it directly. After you make a change you just restart firefox. There's no need to make a XPI and install it. I keep mine in ~/config/dot-firefox. Aside from the boilerplate, there's just two files.

overlay.js for your javascript:

// from mozless
function tabRelativeSelect(delta)
{
  var oldTab = gBrowser.selectedTab;
  var newTab = null;
  var length = gBrowser.tabContainer.childNodes.length;
  var index;
  for (index=0; index<length; index++) {
    if (gBrowser.tabContainer.childNodes[index] == oldTab) {
      var new_index = index + delta;
      if (new_index < 0) new_index += length;
      else if (new_index >= length) new_index -= length;
      newTab = gBrowser.tabContainer.childNodes[new_index];
      break;
    }
  }
  if (newTab && newTab != oldTab)
    gBrowser.selectedTab = newTab;
}

and overlay.xul for your XUL:

<?xml version="1.0"?>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <script src="overlay.js"/>
  <keyset id="mainKeyset">
    <key key="k" oncommand="goDoCommand('cmd_scrollLineUp')" />
    <key key="h" oncommand="goDoCommand('cmd_scrollLeft')" />
    <key key="j" oncommand="goDoCommand('cmd_scrollLineDown')" />
    <key key="l" oncommand="goDoCommand('cmd_scrollRight')" />
    <key key="d" oncommand="goDoCommand('cmd_scrollPageDown')" />
    <key key="u" oncommand="goDoCommand('cmd_scrollPageUp')" />
    <key modifiers="shift" key="B" oncommand="BrowserBack()" />
    <key modifiers="shift" key="F" oncommand="BrowserForward()" />
    <key key="." oncommand="tabRelativeSelect(1)" />
    <key key="," oncommand="tabRelativeSelect(-1)" />
  </keyset>
</overlay>

To get firefox to load it:

$ echo ~/config/dot-firefox > $firefox_profile_dir/extensions/dot-firefox@elder-gods.org

If you wanna see/copy the boilerplate, it's all in this git repo.

feedshow.com

Posted on Wed, 26 Mar 2008 in Random
If you know anything about this website please send me an email and tell me about it. Thanks.

Tuber Indicum

Posted on Sun, 16 Mar 2008 in Random

I gave some canned Chinese truffles the same treatment as the Oregon blacks. Don't bother with these. They have almost no smell and no taste at all.

Kototbuki again

Posted on Sun, 16 Mar 2008 in Random

Kotobuki is tiny. It's a converted townhouse that maybe seats 25 people. There's a stairway from the entrance up to the restaurant. This stairway is filled with people waiting to get in. If you don't want to wait, or if you have a big group, don't go here; but believe me the food there is worth waiting for. Once you get in the service is quick. There were four sushi chefs behind the counter and they were constantly busy, because there's also a constant stream of people picking up takeout orders. Except for a few appetizers (which are great), all kotobuki serves is sushi and sashimi. You can order a combo plate with some pre-chosen selection of sushi, but I really suggest you just get everything a la carte. They give you a little menu and you just mark down what you want on that. Most nigiri here are only one dollar. The uni and toro are $2.50. It's all super-fresh and delicious. The only thing I really didn't like was the crab, which was "krab". My favorites were the eel, the toro, the scallop and the monkfish liver. But really it was all great (except the krab). Like I said, the best sushi I've had. Also the cheapest; which is kinda strange.

Truffles

Posted on Sun, 16 Mar 2008 in Random
Last edited Sun, 16 Mar 2008

I went to Whole Foods and bought an ounce of Oregon black truffles

I sliced 'em as thin as I could and tossed them with some linguine, butter, olive oil and Parmesan.

The were, ..., nice. I wouldn't say they knocked my socks off with truffleiciousness. They had a very strong smell when you held the whole ones up to your nose. Once they were in the pasta they had a very subtle effect. Mostly in smell and not taste. It was hard to describe, and nothing at all like truffle oil. It was kind of musky, maybe mushroomy, i can't really describe it. Truffly i guess. Meghan thinks they smell like bad button mushrooms. All in all, I can't say I was really impressed. I've had more delicious things in my time. For something that costs $30 an ounce, and whose exalted cousins cost ten times as much or more, I can't say I see the point. Perhaps it wasn't truffles in general, but these truffles. I don't imagine the best truffles in Oregon wind up in the mushroom case at whole foods next to the criminis. Perhaps next winter I'll mail order some and try them again.

kotobuki

Posted on Fri, 14 Mar 2008 in Random
There may be better sushi places than kotobuki, but I wouldn't know because I've never been to one. Seriously. This place is awesome. Go there. It rocks.

Great Moments in Trolling Presents:

Posted on Tue, 11 Mar 2008 in Random
Last edited Tue, 11 Mar 2008

where can obtain I fresh white truffle?

It's the username that made me laugh out loud.

Redneck Extension Cord

Posted on Mon, 3 Mar 2008 in Random
Last edited Mon, 3 Mar 2008

leg of lamb

Posted on Wed, 6 Feb 2008 in Random
awesome

Bread

Posted on Tue, 5 Feb 2008 in Random
This is a great book. It tells you how to make bread.
(let ((x (quote (quasiquote (let ((x (quote (unquote x)))) (unquote x))))))
  (quasiquote (let ((x (quote (unquote x)))) (unquote x))))