default-zoom icon indicating copy to clipboard operation
default-zoom copied to clipboard

Control+0 should reset to preferred zoom level instead of 100%

Open DarwinAwardWinner opened this issue 5 years ago • 3 comments

This extension correctly sets the zoom level upon loading a website, but pressing control+0 always sets the zoom level to 100%. It would be nice if this extension modified that shortcut to set the zoom level to the preferred default instead.

DarwinAwardWinner avatar Mar 07 '19 17:03 DarwinAwardWinner

Hi @DarwinAwardWinner, thanks for your feature request!

I like the idea, but I'm not sure that WebExtensions allow you to override default keyboard shortcuts.

I couldn't find anything definitive. There's a bug report that seems undecided on whether it should be allowed, and there are reports of inconsistencies across platforms. But I tried it myself (with Firefox on Linux) and couldn't get Ctrl+0 to work; it only seemed to play nice when using a random shortcut Firefox wasn't already using.

A workaround is to:

  1. Enable the Browser Console command-line.
  2. Open the Browser Console.
  3. Run FullZoom._cps2.setGlobal(FullZoom.name,1.33,gBrowser.selectedBrowser.loadContext); where 1.33 is the zoom level you want Ctrl-0 to reset things to (in this case 133%).

jamielinux avatar Sep 02 '19 07:09 jamielinux

I wonder if you could write a user script script to run this on every startup. (I assume the user would have to set it up manually, since the extension itself doesn't have the permissions.)

DarwinAwardWinner avatar Sep 02 '19 19:09 DarwinAwardWinner

After you run that command, the setting persists after you close Firefox which is handy :) And as a bonus you get Ctrl+0 that does the Right Thing. The problem is, as you correctly mentioned, you can't do exactly the same with an extension.

jamielinux avatar Sep 03 '19 15:09 jamielinux