MasterScrat
MasterScrat

Reputation: 7386

How to disable Ctrl + Shift + C shortcut in Firefox?

Pressing Ctrl+Shift+C in Firefox opens the developer tools and activates the "Pick element" tool.

I often mistakenly use this shortcut when I want to copy something (mixing it up with the shortcut to copy text in terminals).

It's really annoying since

One solution appeared to be the Firefox "customizable shortcuts" extensions, but it has been discontinued.

Any other idea?

Upvotes: 26

Views: 6668

Answers (6)

Qius
Qius

Reputation: 1

This firefox addon works for me.
It disables shortcut only (not devtools entirely) and makes it function as Ctrl+c

Upvotes: -1

user598527
user598527

Reputation: 199

An addon (source code repository) has been released to remap Ctrl+Shift+C to Ctrl+C. May also work as a userscript:

If you use Greasemonkey, Tampermonkey, Violentmonkey, or FireMonkey, you also could consider using the above file [content.js] in a user script.

description:

Injects a script into pages to intercept Ctrl+Shift+C as a copy command, not allowing it to open Developer Tools.

Concerned about permissions? There is no convenient way at the moment to have Firefox run this extension on every site without "all sites" permission. However, you can look at what the script does, it's minimal. https://github.com/jscher2000/Ctrl-Shift-C-Should-Copy/blob/main/content.js


The content.js code for v0.1.0 (Mozilla Public License 2.0):

document.body.addEventListener('keydown', function(evt){
    if (evt.ctrlKey && evt.shiftKey && evt.key == "C"){
        // Copy the selection to the clipboard
        document.execCommand('copy');
        // Throw away this event and don't do the default stuff
        evt.stopPropagation();
        evt.preventDefault();
    }
}, false);

/* Intercept and check keyup events for Ctrl+Shift+C */

document.body.addEventListener('keyup', function(evt){
    if (evt.ctrlKey && evt.shiftKey && evt.key == "C"){
        // Throw away this event and don't do the default stuff
        evt.stopPropagation();
        evt.preventDefault();
    }
}, false);

Upvotes: 4

Oleg Kokorin
Oleg Kokorin

Reputation: 2680

only whole devtools is possible to disable:

go to about:config page, accept warning, search for:

devtools.enabled

change value true to false

close the config page

Upvotes: 1

thebunnyrules
thebunnyrules

Reputation: 1670

Seeing how Firefox's architecture has seen an overhaul during the transition to Quantum and WebExtensions, it is no longer possible to disable built in shortcuts using an extension like "Menu Wizard" or "customizable shortcuts".

If you know how to compile firefox from source, you can still do it by modifying the source code. Download the source, extract it and edit:

path-to-ff-source-dir/devtools/startup/locales/en-US/key-shortcuts.properties

and change

inspector.commandkey=C

to

inspector.commandkey=VK_F1

If you are not familiar with how to build firefox from source, you can follow the instructions outlined here.

The source code for the latest firefox can be found here:

https://archive.mozilla.org/pub/firefox/releases/ (don't leave out the / at the end or it will give you a 404 error).

Just pick a release (64.02 for example) and click on source:

https://archive.mozilla.org/pub/firefox/releases/64.0.2/source/

Upvotes: 5

usernan
usernan

Reputation: 592

Install Menu Wizard, click on Keyboard shortcuts, find key_inspector, delete the shortcut.

Install details here

Upvotes: 6

Deckerz
Deckerz

Reputation: 2604

You can't. Unfortunately, even if you disable them in the about:config it doesn't actually disable them.

There may be plugins that do it but on vanilla firefox it is not possible.

Upvotes: 2

Related Questions