firefox - 在没有插件的情况下重新绑定 Firefox 中的下一个/上一个选项卡
问题描述
我在 Linux 上使用了一个名为 Autokey 的工具,这样我就可以将下一个/上一个选项卡绑定到我想要在所有应用程序中使用的热键。在大多数情况下,当我需要使用 mac 时,内置的 OSX 键映射器可以完成这项工作。问题是它只能触发在应用程序中显示为菜单项的操作,而 Firefox 实际上并没有像 Chrome 那样的“下一个选项卡”或“上一个选项卡”菜单项。
我宁愿不安装 Firefox 插件只是为了绑定某些功能。他们最终总是让我在其他操作系统上变得混乱或变得过时。是否可以创建一个为 Firefox 提供菜单项的扩展,这样我就可以在 OSX 中使用内置的键盘快捷键实用程序?还有其他方法可以获得我想要的键绑定吗?
解决方案
我最终以更类似于 Autokey 的工作方式的方式使用 Karabiner 解决了这个问题。这是将我首选的下一个/上一个键绑定映射到 Firefox(和 iTerm)所需的 json 配置。
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 250,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"manipulators": [
{
"type": "basic",
"description": "next tab in firefox",
"from": {
"key_code": "l",
"modifiers": {
"mandatory": ["left_control", "left_gui"]
}
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_control"]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"org.mozilla.firefox",
"com.googlecode.iterm2"
]
}
]
},
{
"type": "basic",
"description": "prev tab in firefox",
"from": {
"key_code": "h",
"modifiers": {
"mandatory": ["left_control", "left_gui"]
}
},
"to": [
{
"key_code": "tab",
"modifiers": ["left_control", "left_shift"]
}
],
"conditions": [
{
"type": "frontmost_application_if",
"bundle_identifiers": [
"org.mozilla.firefox",
"com.googlecode.iterm2"
]
}
]
}
]
}
]
}
}
]
}
我使用 Ergodox 键盘,我的编程方式使我的左 alt 键显示为 left_gui。
推荐阅读
- angular - Angular 8 @ViewChild 模板变量错误 - 无法读取未定义的属性“nativeElement”
- java - 如何使用 Java 8 在对象列表中获取内部对象的成员
- flutter - 为什么负数的模为正(-7 % 6 == 5)?
- pandas - 如何使用基于涉及整行和先验数据的滚动自定义函数的 Pandas 向量方法
- python - 运行此 Python 代码时面临问题
- python - 如何使用 Hy 模块创建 Python 独立可执行文件?
- c# - 多个表离线同步 Xamarin.Forms & Azure
- c# - 有没有一种方法可以在不向其添加数据的情况下创建数据库 ef 代码优先
- javascript - 更新 state 中数组的状态
- linux - flutter_webview_plugin 一直在加载