Овај сајт ће имати ограничену функционалност док га будемо ажурирали у циљу побољшања вашег искуства. Ако неки чланак не реши ваш проблем и желите да поставите питање, на располагању ће вам бити наше заједнице подршке @FirefoxSupport на Twitter-у и /r/firefox на Reddit-у.

Претражи подршку

Избегните преваре подршке. Никада од вас нећемо тражити да зовете или шаљете поруке на број или да делите личне податке. Пријавите сумњиве радње преко „Пријавите злоупотребу” опције.

Сазнај више

How to disable keyboard shortcut CTRL+W?

  • 4 одговорa
  • 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