0

How can I prevent the firefox to prompt the save document popup window from ctr+s ?

var isCtrl = false;
$(document).keyup(function (e) {
        if(e.which == 17) isCtrl=false;
    }).keydown(function (e) {

        if(e.which == 17) isCtrl=true;

        if(e.which == 83 && isCtrl == true) {
        alert('you pressed ctrl+s');

        e.preventDefault();
        e.stopPropagation();
        return false;
    }
});

Chrome does not prompt the save doc document which is perfect. How can I fix the firefox?

Xyz
  • 5,955
  • 5
  • 40
  • 58
Run
  • 54,938
  • 169
  • 450
  • 748

1 Answers1

1

You have to delay the alert process. View this users code, and this is what exactly you are looking for.

http://jsbin.com/ecubot/6/edit

Here is the shared link from stack: https://stackoverflow.com/a/14861031/2762516

Community
  • 1
  • 1
Casey ScriptFu Pharr
  • 1,672
  • 1
  • 16
  • 36