How do you prevent firefox from zooming in when pressing ctrl and +?

前端 未结 3 735
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-23 11:26

I am trying to use the ctrl and + combination within firefox for a different action for our web application. How could I prevent firefox from zooming when our web application i

相关标签:
3条回答
  • 2021-01-23 12:01

    I don't think you can overwrite application shortcuts with website code. Imagine a site overwriting alt + tab, and suddenly you wouldn't be able to tab out of your browser window anymore. It is possible with some plugins, but that depends on the browser you're using.

    Instead, use something that isn't a default keyboard shortcut to prevent other users from having the same problems. Everyone expects and counts on ctrl and +- to change their zoom level; overwriting this simply isn't a good idea usability-wise.

    0 讨论(0)
  • 2021-01-23 12:15

    According to this resource http://www.arraystudio.com/as-workshop/disable-ctrl-n-and-other-ctrl-key-combinations-in-javascript.html, you should be able to prevent any control keys.

    I have used similar techniques, by catching all events on the body tag, and if they are the F keys, then returning a false to veto.

    0 讨论(0)
  • 2021-01-23 12:25

    You could try Flash. Flash tends to gobble up a lot of shortcut keys, including Ctrl+T (new tab) which drives me mad all the time.

    0 讨论(0)
提交回复
热议问题