Mozilla 도움말 검색

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

자세히 살펴보기

Key binds

  • 5 답장
  • 1 이 문제를 만남
  • 133 보기
  • 최종 답변자: cor-el

more options

Hi

I am using mozilla firefox on windows 10.

I sometimes fat finger ctrl+shift+w or ctrl+shift+q which closes the browser instead of just closing the tab which I indented.

Is there a way to disable these 2 key binds?

Best regards child

Hi I am using mozilla firefox on windows 10. I sometimes fat finger ctrl+shift+w or ctrl+shift+q which closes the browser instead of just closing the tab which I indented. Is there a way to disable these 2 key binds? Best regards child

모든 댓글 (5)

more options

ctrl+w (close tab) and ctrl+shift+w (close firefox) are very close to each other.

I was thinking it would be enough to have ctrl+shift+q to close firefox (not also ctrl+shift+w).

Using a mouse to close a tab is of course possible. But key binds are very nice to use, both for speed and comfort. Imagine not having a keyboard at all and instead use an on screen keyboard and click every single key with the mouse. It may solve something but it's not really a suitable solution.


Disable a this keybind would be really nice for my problem. Do anyone know how to? Using a mouse instead of any shortcuts is not good enough for me.

more options

There are extensions for configuring keyboard shortcuts but AFAIK they don't enable you to disable Firefox shortcuts. The only way I know is to assign those shortcuts to other actions on your system. I have trained myself to use shortcuts which I set myself using the extension linked below.

https://addons.mozilla.org/en-GB/firefox/addon/select-after-closing-current/

more options

If you close a window accidentally then you can restore that window via "History -> Recently Closed Windows".

Firefox 87+ versions have a pref to disable Ctrl+Shift+Q (Mac/Linux:Command/Ctrl+Q) to close Firefox. You need to close and restart Firefox after toggling this pref.

  • about:config => browser.quitShortcut.disabled = true

Disabling the "Ctrl+Q" warning is controlled by this pref.

  • about:config => browser.warnOnQuitShortcut

글쓴이 cor-el 수정일시

more options

cor-el said

If you close a window accidentally then you can restore that window via "History -> Recently Closed Windows". Firefox 87+ versions have a pref to disable Ctrl+Shift+Q (Mac/Linux:Command/Ctrl+Q) to close Firefox. You need to close and restart Firefox after toggling this pref.
  • about:config => browser.quitShortcut.disabled = true
Disabling the "Ctrl+Q" warning is controlled by this pref.
  • about:config => browser.warnOnQuitShortcut

Thank you! This disabled the "Ctrl+Shift+Q" command.

Is there a way to disable "Ctrl+shift+W" as well?

글쓴이 hwoarangwins2 수정일시

more options

The only way to disable the Ctrl+Shift+W shortcut to close a window is via an autoconfig,cfg file like I posted in the thread.

See also:

In your case you need to modify this line:

  • let KEYS = ['key_quitApplication','key_reload'];

Change to:

  • let KEYS = ['key_closeWindow'];

In case you want to include more keys, see also:


You can use the autoconfig.cfg file in the Firefox installation folder to initialize (set/lock) preferences and run privileged JavaScript code.

To use Autoconfig, place two files into the Firefox installation directory.

  • on Windows, they go into the same directory where Firefox is installed
  • on macOS, they go into the Contents/Resources directory of the Firefox.app

The autoconfig.js file that specifies to use autoconfig.cfg is placed into the "defaults\pref" directory where the channel-prefs.js file is located.

//
pref("general.config.filename", "autoconfig.cfg");
pref("general.config.obscure_value", 0);
pref("general.config.sandbox_enabled", false); // disable sandbox to allow privileged JavaScript

The autoconfig.cfg file is placed at the top level of the Firefox directory.

  • autoconfig.cfg and autoconfig.js need to start with a comment line (//)
  • autoconfig.js needs to use Unix line endings (LF instead of CR/LF)

See also:


Content of autoconfig.cfg

// first line in autoconfig.cfg is a comment line
try {
 let {classes:Cc, interfaces:Ci, manager:Cm, utils:Cu} = Components;
 let Services = globalThis.Services || ChromeUtils.import("resource://gre/modules/Services.jsm").Services;
 function ConfigJS() { Services.obs.addObserver(this, 'chrome-document-global-created', false); }
 ConfigJS.prototype = {
  observe: function (aSubject) { aSubject.addEventListener('DOMContentLoaded', this, {once: true}); },
  handleEvent: function (aEvent) {
   let document = aEvent.originalTarget;
   let window = document.defaultView;
   let location = window.location;
   if (/^(chrome:(?!\/\/(global\/content\/commonDialog|browser\/content\/webext-panels)\.x?html)|about:(?!blank))/i.test(location.href)) {
    if (window._gBrowser) {
     let attr, elm, key, mbo;
      let KEYS = ['key_closeWindow'];
      let ATTR = ['key','modifiers','command','oncommand'];
      for (key in KEYS){
       elm = window.document.getElementById(KEYS[key]);
       if (elm) for (attr in ATTR) if (ATTR[attr] in elm.attributes) elm.removeAttribute(ATTR[attr]);
      }
    }
   }
  }
 };
 if (!Services.appinfo.inSafeMode) { new ConfigJS(); }
} catch(e) {Cu.reportError(e);}

글쓴이 cor-el 수정일시