如何在 Firefox 中禁用 Ctrl + Shift + C 快捷方式?
How to disable Ctrl + Shift + C shortcut in Firefox?
在 Firefox 中按 Ctrl+Shift+C 打开开发者工具并激活"Pick element" 工具。
当我想复制一些东西时,我经常错误地使用这个快捷方式(将它与在终端中复制文本的快捷方式混在一起)。
从
开始真的很烦人
- 它不复制文本
- 它会打开开发者工具
- 我什至无法再次使用此快捷方式关闭开发者工具,我需要伸手去拿鼠标才能关闭它
一个解决方案似乎是 Firefox "customizable shortcuts" 扩展,但它已被停用。
还有其他想法吗?
你不能。不幸的是,即使您在 about:config
中禁用它们,它实际上并没有禁用它们。
可能有插件可以做到这一点,但在 vanilla firefox 上是不可能的。
安装Menu Wizard,点击Keyboard shortcuts
,找到key_inspector
,删除快捷方式。
看到 Firefox 的体系结构在向 Quantum 和 WebExtensions 过渡期间发生了翻天覆地的变化,不再可能使用 "Menu Wizard" 或 "customizable shortcuts" 等扩展来禁用内置快捷方式。
如果你知道如何从源代码编译firefox,你仍然可以通过修改源代码来完成。下载源代码,解压并编辑:
path-to-ff-source-dir/devtools/startup/locales/en-US/key-shortcuts.properties
并更改
inspector.commandkey=C
到
inspector.commandkey=VK_F1
如果您不熟悉如何从源代码构建 firefox,you can follow the instructions outlined here.
最新的 firefox 的源代码可以在这里找到:
https://archive.mozilla.org/pub/firefox/releases/(不要在末尾省略 / 否则会出现 404 错误)。
只需选择一个版本(例如 64.02)并单击源:
https://archive.mozilla.org/pub/firefox/releases/64.0.2/source/
An addon 已发布以重新映射 Ctrl+Shift+C到 Ctrl+C。也可以用作用户脚本:
If you use Greasemonkey, Tampermonkey, Violentmonkey, or FireMonkey, you also could consider using the above file [content.js] in a user script.
描述:
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
v0.1.0 的 content.js
代码:
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);
只能禁用整个开发工具:
转到 about:config 页面,接受警告,搜索:
devtools.enabled
将值 true 更改为 false
关闭配置页面
在 Firefox 中按 Ctrl+Shift+C 打开开发者工具并激活"Pick element" 工具。
当我想复制一些东西时,我经常错误地使用这个快捷方式(将它与在终端中复制文本的快捷方式混在一起)。
从
开始真的很烦人- 它不复制文本
- 它会打开开发者工具
- 我什至无法再次使用此快捷方式关闭开发者工具,我需要伸手去拿鼠标才能关闭它
一个解决方案似乎是 Firefox "customizable shortcuts" 扩展,但它已被停用。
还有其他想法吗?
你不能。不幸的是,即使您在 about:config
中禁用它们,它实际上并没有禁用它们。
可能有插件可以做到这一点,但在 vanilla firefox 上是不可能的。
安装Menu Wizard,点击Keyboard shortcuts
,找到key_inspector
,删除快捷方式。
看到 Firefox 的体系结构在向 Quantum 和 WebExtensions 过渡期间发生了翻天覆地的变化,不再可能使用 "Menu Wizard" 或 "customizable shortcuts" 等扩展来禁用内置快捷方式。
如果你知道如何从源代码编译firefox,你仍然可以通过修改源代码来完成。下载源代码,解压并编辑:
path-to-ff-source-dir/devtools/startup/locales/en-US/key-shortcuts.properties
并更改
inspector.commandkey=C
到
inspector.commandkey=VK_F1
如果您不熟悉如何从源代码构建 firefox,you can follow the instructions outlined here.
最新的 firefox 的源代码可以在这里找到:
https://archive.mozilla.org/pub/firefox/releases/(不要在末尾省略 / 否则会出现 404 错误)。
只需选择一个版本(例如 64.02)并单击源:
https://archive.mozilla.org/pub/firefox/releases/64.0.2/source/
An addon 已发布以重新映射 Ctrl+Shift+C到 Ctrl+C。也可以用作用户脚本:
If you use Greasemonkey, Tampermonkey, Violentmonkey, or FireMonkey, you also could consider using the above file [content.js] in a user script.
描述:
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
v0.1.0 的 content.js
代码:
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);
只能禁用整个开发工具:
转到 about:config 页面,接受警告,搜索:
devtools.enabled
将值 true 更改为 false
关闭配置页面