如何在Firefox中禁用Ctrl + Shift + C快捷键?

时间:2016-03-15 09:24:11

标签: firefox keyboard-shortcuts

在Firefox中按 Ctrl + Shift + C 打开开发人员工具并激活“选择元素”工具。

当我想复制某些东西时,我经常错误地使用这个快捷方式(将其与快捷方式混合以复制终端中的文本)。

这真的很烦人,因为

  • 它不会复制文本
  • 打开开发者工具
  • 我甚至无法再次使用此快捷方式关闭开发人员工具,我需要触及鼠标才能关闭它

一个解决方案似乎是Firefox "customizable shortcuts"扩展程序,但它已停止使用。

还有其他想法吗?

5 个答案:

答案 0 :(得分:6)

安装Menu Wizard,点击Keyboard shortcuts,找到key_inspector,然后删除快捷方式。

Install details here

答案 1 :(得分:2)

你不能。不幸的是,即使您在about:config中停用它们,它也不会实际禁用它们。

可能有插件可以做到,但在vanilla firefox上是不可能的。

答案 2 :(得分:1)

只能禁用整个开发工具:

转到about:config页面,接受警告,搜索:

devtools.enabled

将值 true 更改为 false

关闭配置页面

答案 3 :(得分:0)

看到Firefox的体系结构在过渡到Quantum和WebExtensions的过程中进行了大修后,就不再可以使用“菜单向导”或“可自定义的快捷方式”这样的扩展来禁用内置的快捷方式。

如果您知道如何从源代码编译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/

答案 4 :(得分:0)

An addon 已被发布以将 Ctrl+Shift+C 重新映射到 Ctrl+< kbd>C。也可以用作用户脚本:

<块引用>

如果您使用 Greasemonkey、Tampermonkey、Violentmonkey 或 FireMonkey,您也可以考虑在用户脚本中使用上述文件 [content.js]。

说明:

<块引用>

将脚本注入页面以拦截 Ctrl+Shift+C 作为复制命令,不允许它打开开发者工具。< /p> <块引用>

担心权限?目前没有方便的方法让 Firefox 在没有“所有站点”许可的情况下在每个站点上运行这个扩展。但是,您可以查看脚本的作用,它是最小的。 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);
相关问题