Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

How to disable keyboard shortcut CTRL+W?

  • 4 답장
  • 3 이 문제를 만남
  • 1 보기
  • 최종 답변자: winserity

more options

Hello,

I am trying to disable keyboard shortcut CTRL+W, but there does not seem to be any options or addons for such issue. Is it possible to disable such keyboard shortcut? Actually, I am using CTRL+W into a gaming cloud which is accessible in browser. Thanks for your attention!

Best regards, Winserity

Hello, I am trying to disable keyboard shortcut CTRL+W, but there does not seem to be any options or addons for such issue. Is it possible to disable such keyboard shortcut? Actually, I am using CTRL+W into a gaming cloud which is accessible in browser. Thanks for your attention! Best regards, Winserity

선택된 해결법

You can possibly run code in the Browser Console to disable this shortcut, but that only works for the current window and you need to remember to run the code. The Browser Console has a command stack and remembers commands you have used, so you may only need a cursor UP to recall this code and press ENTER if you have used this.

I use this code to disable Ctrl+Q to avoid accidentally closing Firefox (Q is next to W). You can easily add more key IDs.


javascript:/*ACCESSKEY*/(function(){var wd = Services.wm.getMostRecentWindow("navigator:browser").window.document;function $(e){return(wd.getElementById(e))}function $(e){var N=$(e);if(N){N.removeAttribute("key"); N.removeAttribute("command");console.log(N)}return($(e))}$("key_quitApplication");$("key_privatebrowsing");$("key_close");})()

You can possibly use a bookmarklet (bookmark with this code in the location field) to get this JavaScript code in a prompt and copy it to the clipboard.

javascript:/*ACCESSKEY*/void(prompt('<accesskeys>',atob('amF2YXNjcmlwdDovKkFDQ0VTU0tFWSovKGZ1bmN0aW9uKCl7CnZhciB3ZCA9IFNlcnZpY2VzLndtLmdldE1vc3RSZWNlbnRXaW5kb3coIm5hdmlnYXRvcjpicm93c2VyIikud2luZG93LmRvY3VtZW50OwpmdW5jdGlvbiAkKGUpe3JldHVybih3ZC5nZXRFbGVtZW50QnlJZChlKSl9CmZ1bmN0aW9uICQkKGUpe3ZhciBOPSQoZSk7aWYoTil7Ti5yZW1vdmVBdHRyaWJ1dGUoImtleSIpOyBOLnJlbW92ZUF0dHJpYnV0ZSgiY29tbWFuZCIpO2NvbnNvbGUubG9nKE4pfXJldHVybigkKGUpKX0KJCQoImtleV9xdWl0QXBwbGljYXRpb24iKTsKJCQoImtleV9wcml2YXRlYnJvd3NpbmciKTsKJCQoImtleV9jbG9zZSIpOwp9KSgp')));

문맥에 따라 이 답변을 읽어주세요 👍 1

모든 댓글 (4)

more options

You can try something like this with code in the autoconfig.cfg file.

See also:

You need to remove this key binding for close tab (Ctrl+W):

<key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" reserved="true" key="W"/>
more options

I'm glad that there is at least a solution. However, I have limited privileges (non-admin Windows user) to apply this solution. That would be great if such option could be integrated in the preferences tab in next update for Mozilla Firefox.

Thank you for your volunteer assistance!

more options

선택된 해결법

You can possibly run code in the Browser Console to disable this shortcut, but that only works for the current window and you need to remember to run the code. The Browser Console has a command stack and remembers commands you have used, so you may only need a cursor UP to recall this code and press ENTER if you have used this.

I use this code to disable Ctrl+Q to avoid accidentally closing Firefox (Q is next to W). You can easily add more key IDs.


javascript:/*ACCESSKEY*/(function(){var wd = Services.wm.getMostRecentWindow("navigator:browser").window.document;function $(e){return(wd.getElementById(e))}function $(e){var N=$(e);if(N){N.removeAttribute("key"); N.removeAttribute("command");console.log(N)}return($(e))}$("key_quitApplication");$("key_privatebrowsing");$("key_close");})()

You can possibly use a bookmarklet (bookmark with this code in the location field) to get this JavaScript code in a prompt and copy it to the clipboard.

javascript:/*ACCESSKEY*/void(prompt('<accesskeys>',atob('amF2YXNjcmlwdDovKkFDQ0VTU0tFWSovKGZ1bmN0aW9uKCl7CnZhciB3ZCA9IFNlcnZpY2VzLndtLmdldE1vc3RSZWNlbnRXaW5kb3coIm5hdmlnYXRvcjpicm93c2VyIikud2luZG93LmRvY3VtZW50OwpmdW5jdGlvbiAkKGUpe3JldHVybih3ZC5nZXRFbGVtZW50QnlJZChlKSl9CmZ1bmN0aW9uICQkKGUpe3ZhciBOPSQoZSk7aWYoTil7Ti5yZW1vdmVBdHRyaWJ1dGUoImtleSIpOyBOLnJlbW92ZUF0dHJpYnV0ZSgiY29tbWFuZCIpO2NvbnNvbGUubG9nKE4pfXJldHVybigkKGUpKX0KJCQoImtleV9xdWl0QXBwbGljYXRpb24iKTsKJCQoImtleV9wcml2YXRlYnJvd3NpbmciKTsKJCQoImtleV9jbG9zZSIpOwp9KSgp')));

more options

cor-el said

You can possibly run code in the Browser Console to disable this shortcut, but that only works for the current window and you need to remember to run the code. The Browser Console has a command stack and remembers commands you have used, so you may only need a cursor UP to recall this code and press ENTER if you have used this. I use this code to disable Ctrl+Q to avoid accidentally closing Firefox (Q is next to W). You can easily add more key IDs.
javascript:/*ACCESSKEY*/(function(){var wd = Services.wm.getMostRecentWindow("navigator:browser").window.document;function $(e){return(wd.getElementById(e))}function $(e){var N=$(e);if(N){N.removeAttribute("key"); N.removeAttribute("command");console.log(N)}return($(e))}$("key_quitApplication");$("key_privatebrowsing");$("key_close");})()

You can possibly use a bookmarklet (bookmark with this code in the location field) to get this JavaScript code in a prompt and copy it to the clipboard.

javascript:/*ACCESSKEY*/void(prompt('<accesskeys>',atob('amF2YXNjcmlwdDovKkFDQ0VTU0tFWSovKGZ1bmN0aW9uKCl7CnZhciB3ZCA9IFNlcnZpY2VzLndtLmdldE1vc3RSZWNlbnRXaW5kb3coIm5hdmlnYXRvcjpicm93c2VyIikud2luZG93LmRvY3VtZW50OwpmdW5jdGlvbiAkKGUpe3JldHVybih3ZC5nZXRFbGVtZW50QnlJZChlKSl9CmZ1bmN0aW9uICQkKGUpe3ZhciBOPSQoZSk7aWYoTil7Ti5yZW1vdmVBdHRyaWJ1dGUoImtleSIpOyBOLnJlbW92ZUF0dHJpYnV0ZSgiY29tbWFuZCIpO2NvbnNvbGUubG9nKE4pfXJldHVybigkKGUpKX0KJCQoImtleV9xdWl0QXBwbGljYXRpb24iKTsKJCQoImtleV9wcml2YXRlYnJvd3NpbmciKTsKJCQoImtleV9jbG9zZSIpOwp9KSgp')));

Thank you for such a great solution! You are genius :) Google provides so many threads regarding this issue, but none of them helped me as much as you. I have tried that javascript code, but it does not work or I don't know how to apply it. However, I have accessed the Browser Toolbox and deleted following node:

<key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" reserved="true" key="W"/>

By deleting that node, I can use keyboard shortcut CTRL+W without to be closed browser tab. By the way, the correct link to documentation of Browser Toolbox is https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox