HD Software Co. Blog

Software You Can Use

Hacking a 100% zoom feature onto NoSquint with KeyConfig

Posted by Wrangler on January 10, 2012
Posted in: Programming. Tagged: enhancement request, firefox extension, keyboard.

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.

Hacking a 100% zoom feature onto NoSquint with KeyConfig





Share

Posts navigation

← Oil Rigs May Turn Migratory Birds Into Shark Food
Open Source Upstart Nginx Surpasses Microsoft Server →
  • Search

  • Categories

    • Computer HowTo Videos
    • Computer Stuff
    • Feed Generators
    • Freeware
    • Home/Hobby Software
    • Internet Software
    • NeoBook RAD5
      • NeoBook Plugins
      • NeoBook Sample Pubs
      • NeoBook Tips
    • NeoSoft Forum
    • Programming
    • Quote Of The Day
    • Uncategorized
    • Web Developer News
    • Windows Tips & Tricks
      • IE 9 Tips
    • Wired
    • WordPress Tips
  • Code Cloud

    Game Functions Java Suggestions apps Français iPad Over Jan. This 2012 Future developers software twitter podcast first Could Text More Space JavaScript About android Internet Español Facebook Apple Commands Into Data Windows NeoBookDBPro Action cloud microsoft Video From plugin google GoogleaDay General Puzzle Discussions neobook


Proudly powered by WordPress Theme: Parament by Automattic.