Search code examples
javascriptbackbone.jsbackbone-events

Ways to refresh a page in browser


Despite the fact that there are many similar topics in internet, there aren't any complete answer.

What I want:

Disable browser refreshing.

What I know:

As I know it isn't possible to hang listener on browser refresh event. So I have to hang listener on keydown event and block all possible variants of page reloading.

Problem/What I don't know

I can't imagine all possible variants for page reloading, and can neglect one of them. For example, I can check:

  • event.keyCode == 116 //F5
  • event.keyCode == 82 && event.ctrlKey // Ctrl + R

But in the same time there is Mac operation system when user can reload page with Cmd+R combination.

Question/Request:

Provide me, please, a full list of ways for page reloading.

May be better ideas?


Solution

  • You can't really disabled browser refreshing. If nothing else works, i click the refresh-button beside my addressbar or just click at the end of the addressbar and press enter to reload the page - and you fortunately can't block that.

    Please try to solve your real problem(s) instead - why should'n the user press resfresh? what goes wrong if he does? how can you work around that? Annoying the user (and this is what you're trying to do here) is never a good option.