Kevin Dente's Blog

The Blip in the Noise

April 2007 - Posts

Hacking a 100% zoom feature onto NoSquint with KeyConfig

I recently blogged about the NoSquint Firefox extension, for remembering per-site text zoom levels. I also recently blogged about the Keyconfig extension, which allows you to change hotkey bindings. I guess you could say that this post is the bastard child of those two posts.

The one feature I've been wanting from NoSquint is a keyboard hotkey that jumps the zoom level straight to 100%. I keep my default zoom level at 160%, but many sites just don't render well at that level. A few are downright unusable. I can hit Ctrl-dash a few times to dial down the zoom on those sites, but I really wanted a way to easily jump right to 100% (the standard Ctrl-0 Firefox hotkey jumps to the default zoom, not to 100%, when running NoSquint).  I submitted an enhancement request to the extensions author, but this morning I realized that I could probably just add the hotkey myself. I was browsing the NoSquint source when I struck on the idea to use Keyconfig to create the binding, rather than mess around with unpacking, changing, and repackaging the source JAR file. 

Here's how you do it. Bring up the Keyconfig configuration UI (Tools/KeyConfig). Click the "Add a new key" button. Give the hotkey a name (I used "Zoom to 100%"), and in the big textbox enter:

NoSquint.zoom(gBrowser.selectedBrowser, 100);
NoSquint.saveCurrentZoom();
NoSquint.updateStatus();

Save the hotkey definition, and bind it to the hotkey of your choice (I used Ctrl-Alt-0).

That's it. Now when I hit Ctrl-Alt-0, my zoom level jumps right to 100%. Perfecto.

 UPDATE -  the original version of the hotkey code didn't remember the 100% setting. I've updated it so it does.

Posted Monday, April 23, 2007 9:48 AM by kevindente | 4 comment(s)

Dealing with Conflicting Keyboard Hotkeys in Firefox

It's been a good week for new (to me) Firefox extensions.

Any serious Firefox user will tell you that it's all about the extensions. Unfortunately, if you install enough extensions, you'll eventually encounter a conflict between the hotkeys registered by different extensions. A few extensions are nice enough to allow you to redefine the hotkeys. Most do not. I've been struggling with this lately - the Focus Last Selected Tab and Image Zoom extensions register conflicting hotkeys - I've been wanting to use the FLST version, but Image Zoom was taking priority.

I just ran across the keyconfig extension, which solved my problem handily. It allowed me to suppress the Image Zoom hotkey (it can also reassign operations to a different hotkey). Problem solved.

Recommended.

Posted Thursday, April 05, 2007 9:15 PM by kevindente | 1 comment(s)

Dealing with Small Font Sizes in Firefox - NoSquint

Generally, I find that the font sizes used on many, if not most, web sites, are too damn small - especially on a 15" UXGA laptop screen. To avoid having to hit Ctrl-+ (text zoom) on every page I visited, I've been increasing the the minimum font size in the Firefox Options dialog. But this isn't an ideal solution - it screws up the layout of a lot of web sites. And minimum means minimum - you can't use Ctrl- - to zoom out and shrink the text size.

This week I ran across the NoSquint Firefox extension, which offers a much better solution. It allows you to specify a default zoom level used when pages load. Moreover, it can remember zoom levels per-site, so that sites with particularly sadistic designers can be set to zoom in more by default. It ROCKS!

Posted Thursday, April 05, 2007 8:48 PM by kevindente | 1 comment(s)

More Posts