How to disable save as dialog in Chrome?

白昼怎懂夜的黑 提交于 2019-12-13 09:26:08

问题


I have following code.

window.onkeypress = function(event) {

    if (event.charCode === 115 && event.ctrlKey) {
        event.preventDefault();
        // your code here....
        alert("'Save As' dialog suppressed!");
    }
};

That code works on Firefox, but in Chrome it doesn't work. Can you help me?


回答1:


You can't. Browsers don't expose (with good reason) the functionality to do this.

Don't annoy your users.



来源:https://stackoverflow.com/questions/28710702/how-to-disable-save-as-dialog-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!