Posledné odpovede k Disable the stupid feature with browser closing by ctrl+qhttps://support.mozilla.org/sk/questions/13091652021-08-13T06:26:55-07:00Firefox 87+ versions have a pref to disable Ctrl+Q.
browser.quitShortcut.disabled = true
You need 2021-08-13T06:26:55-07:00cor-elhttps://support.mozilla.org/sk/questions/1309165#answer-1434739<p>Firefox 87+ versions have a pref to disable Ctrl+Q.
</p>
<ul><li>browser.quitShortcut.disabled = true
</li></ul>
<p>You need to close and restart Firefox after toggling this pref.
</p>
<hr>
<p>You can open the <b>about:config</b> page via the location/address bar.
You can click the button to "Accept the Risk and Continue".
</p>
<ul><li><a href="https://support.mozilla.org/en-US/kb/about-config-editor-firefox" rel="nofollow">https://support.mozilla.org/en-US/kb/about-config-editor-firefox</a>
</li></ul>See:
https://addons.mozilla.org/en-US/firefox/addon/disable-ctrl-q/
https://addons.mozilla.org/en-U2020-10-19T06:01:22-07:00cor-elhttps://support.mozilla.org/sk/questions/1309165#answer-1359534<p>See:
</p>
<ul><li><a href="https://addons.mozilla.org/en-US/firefox/addon/disable-ctrl-q/" rel="nofollow">https://addons.mozilla.org/en-US/firefox/addon/disable-ctrl-q/</a>
</li><li><a href="https://addons.mozilla.org/en-US/firefox/addon/disable-ctrl-q-and-cmd-q/reviews/854938/" rel="nofollow">https://addons.mozilla.org/en-US/firefox/addon/disable-ctrl-q-and-cmd-q/reviews/854938/</a>
</li></ul>
<blockquote><pre>Only works on Windows and MacOS.
Doesn't work on Linux until this bug is addressed.
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1325692" rel="nofollow">https://bugzilla.mozilla.org/show_bug.cgi?id=1325692</a></pre></blockquote>
<blockquote><pre>If you want to manually prevent the Ctrl-Q shortcut from working, open the global JavaScript console (Ctrl-Shift-J) and run the following code. This needs to be done for every new window.
document.getElementById('key_quitApplication').remove()</pre></blockquote>Hi jenamax, I'm aware of two ways to prevent immediate browser closure with the Exit/Quit shortcut. 2020-10-19T05:19:25-07:00jscher2000https://support.mozilla.org/sk/questions/1309165#answer-1359516<p>Hi jenamax, I'm aware of two ways to prevent immediate browser closure with the Exit/Quit shortcut. Note that I use Windows, in case your defaults are different on Linux.
</p><p><strong>(1) "Warn on close"</strong>
</p><p>If quitting would close more than one tab, then Firefox can display a dialog for confirmation:
</p>
&lt;center&gt;<img src="https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2020-10-19-12-13-29-60ee87.png">&lt;/center&gt;
<p>If you don't see that, you might double-check this setting:
</p><p><em>(a)</em> In a new tab, type or paste <strong>about:config</strong> in the address bar and press Enter/Return. Click the button accepting the risk.
</p><p><em>(b)</em> In the search box in the page, type or paste <strong>CLOSE</strong> and pause while the list is filtered
</p><p><em>(c)</em> If the <strong>browser.tabs.warnOnClose</strong> preference is bolded and has a value of false, double-click it to restore the default value of true
</p><p><strong>(2) At least one tab has a beforeunload event handler set</strong>
</p><p>You may occasionally have been saved by, or perhaps more often annoyed by, this warning:
</p>
&lt;center&gt;<img src="https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2020-10-19-12-16-13-38358c.png">&lt;/center&gt;
<p>When you exit, any tab with such an event handler should be focused and require you to respond to the question. (Assuming you have not set dom.disable_beforeunload to true in about:config.)
</p><p>I created an extension to leverage that behavior which you can use to create such a tab. It's probably more useful for private windows, which Firefox may close without warning, but you need to make sure to enable the extension to run in private windows for that to work. If you want to take a look: <a href="https://addons.mozilla.org/firefox/addon/prevent-closing-window/" rel="nofollow">https://addons.mozilla.org/firefox/addon/prevent-closing-window/</a>
</p>Web Extensions can't disable this command AFAIK.
I use this JavaScript code in the Browser Console t2020-10-19T03:06:29-07:00cor-elhttps://support.mozilla.org/sk/questions/1309165#answer-1359481<p>Web Extensions can't disable this command AFAIK.
</p><p>I use this JavaScript code in the Browser Console to disable some shortcut keys.
This code only works in the currently active window, so you need repeat this if you open more browsing windows.
</p>
<pre>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_responsiveUI");})()</pre><br>
<p>I use this bookmaklet to copy the code to the clipboard and paste it in the Browser Console when the command line history in the Browser Console doesn't bring it up as the first choice(s).
If necessary you can clear the history via this command: <b>clearHistory()</b>
</p>
<pre>javascript:/*ACCESSKEY*/void(prompt('&lt;accesskeys&gt;',atob('amF2YXNjcmlwdDovKkFDQ0VTU0tFWSovKGZ1bmN0aW9uKCl7CnZhciB3ZCA9IFNlcnZpY2VzLndtLmdldE1vc3RSZWNlbnRXaW5kb3coIm5hdmlnYXRvcjpicm93c2VyIikud2luZG93LmRvY3VtZW50OwpmdW5jdGlvbiAkKGUpe3JldHVybih3ZC5nZXRFbGVtZW50QnlJZChlKSl9CmZ1bmN0aW9uICQkKGUpe3ZhciBOPSQoZSk7aWYoTil7Ti5yZW1vdmVBdHRyaWJ1dGUoImtleSIpOyBOLnJlbW92ZUF0dHJpYnV0ZSgiY29tbWFuZCIpO2NvbnNvbGUubG9nKE4pfXJldHVybigkKGUpKX0KJCQoImtleV9xdWl0QXBwbGljYXRpb24iKTsKJCQoImtleV9wcml2YXRlYnJvd3NpbmciKTsKJCQoImtleV9yZXNwb25zaXZlVUkiKTsKfSkoKQ==')));</pre><br>