Hacking a 100% zoom feature onto NoSquint with KeyConfig

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

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.

X ITM Cloud News

Ana

Next Post

Empty DIV takes up space after setting innerHTML to blank on IE (aka blank lines after UpdatePanel postback)

Mon Nov 25 , 2019
Spread the love          Maybe this is common knowledge, but my co-worker and I spent some time chasing this down today, so I figured I’d post it in the hope that it will save other people some time. Normally, a empty, unstyled DIV reserves no space in an HTML document. However, it seems […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM