-2

I've seen a lot of posts about disabling the back button or the refresh button on Windows. They do it by using JS or Jquery to disable F5. Does this same approach work for CMD+R on Mac?

  • 1
    As a user I've never understood the need for the possibility to do this: if I want to refresh the page, or go back, don't get in my way. If there's a reason I shouldn't (such as resubmission of payment) then warn me about that on-screen. Don't disable my browser's functionality, especially if your site depends on me ever returning. – David Thomas Aug 26 '15 at 15:31
  • Developers tend to think in terms of websites and web applications. We forget that there are other scenarios such as single page games where this could be advantageous to prevent a bad user experience in the case a button is bumped. If I'm shooting bad guys or saving the princess the last thing I want is a friendly dialog warning me that if I continue I'll lose my game progress or die. – N-ate Aug 26 '15 at 15:47

1 Answers1

2

https://stackoverflow.com/a/3922353/5268586

Looks like it would be possible, but I would agree with the recommend that I don't recommend this.

Once you have your key values for the keys you want to capture I would follow this post: https://stackoverflow.com/a/12444641/5268586

Stackoverflow is an amazing place :D

Community
  • 1
  • 1