Chrome eats javascript keydown event handler on F11 key press, when browser is already in full screen mode

后端 未结 1 560
迷失自我
迷失自我 2021-01-19 03:33

Chrome is eating F11 key press event when the browser is already in full screen mode.

$(document).on(\'keydown\', function(e) { 
     console.log(e.keyCode);         


        
相关标签:
1条回答
  • 2021-01-19 04:39

    Chrome prevents this key detection, and not by accident. This is to prevent developer's code from forcing the user to stay in full screen. When Chrome is in full screen mode, there is no way to prevent clicking F11 via Javascript.

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