屏蔽所有网站的ctrl+s操作 close_ctrl_s

2020/5/13 下午5:28:13

// ==UserScript==
// @name        屏蔽所有网站的ctrl+s操作 close_ctrl_s
// @namespace   Violentmonkey Scripts
// @match       *://*/*
// @grant       none
// @version     1.0
// @author      [email protected]
// @description 2020/5/13 下午5:28:13
// ==/UserScript==
document.onkeydown = function(e){
      var keyCode = e.keyCode || e.which || e.charCode;
      var ctrlKey = e.ctrlKey || e.metaKey;
      if(ctrlKey && keyCode == 83) {
        console.log("stop ctrl+s")
        e.preventDefault();
        return false;
      }
}