It's extremely annoying since Ctrl+W is the vim equivalent of Ctrl+Backspace. I wrote this little Tampermonkey script to temporarily place an event listener on the page unload event:
// ==UserScript==
// @name disable ctrl+w
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description disable ctrl+w
// @match http://*/*
// ==/UserScript==
document.addEventListener('keydown', function(evt){
// NOTE: ctrl key is sent here, but ctrl+W is not
if (evt.ctrlKey) {
var stopEvilCtrlW = function(e) {
return "Oopsies, Chrome!";
}, clearEvilCtrlW = function() {
window.removeEventListener('beforeunload', stopEvilCtrlW, false);
};
setTimeout(clearEvilCtrlW, 1000);
window.addEventListener('beforeunload', stopEvilCtrlW, false);
}
}, false);
This part of Google Chrome is really baaad. Anyways, the hacking solution that I have found is to pass a key combination that is not predefined and then on the other pc understand that as I wanted. So for with Ctrl+W I have chosen Ctrl+End using a little AHK script: SetKeyDelay, -1 ^End::^w So the answer is Chrome failed on this but there are working custom hacks... – obeliksz – 2013-03-23T13:07:37.697