Open DarwinAwardWinner opened 5 years ago
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:
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%).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.)
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.
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.