最好的开发网站建设,大连公共资源交易平台官网,发布一个网站要多少钱,浦东做网站公司最近给Firefox这一快捷键坑了几次。恰好发现在CMU也有人遇到类似的烦恼#xff0c;找到一篇基于Linux的教程。 我使用的是Windows#xff0c;所以根据自己的情况做了些修改#xff0c;成功了。小众需求就犯懒直接将笔记贴上了#xff0c;如果有谁用得上的话#xff0c;我写… 最近给Firefox这一快捷键坑了几次。恰好发现在CMU也有人遇到类似的烦恼找到一篇基于Linux的教程。 我使用的是Windows所以根据自己的情况做了些修改成功了。小众需求就犯懒直接将笔记贴上了如果有谁用得上的话我写个中文版。 Disabling the Ctrl-W shortcut on Firefox Many vim users use ctrl-w to delete a word. Unfortunately on Firefox, this closes the current tab. So if you’re editing a text area / filling out a form you may accidentally close the tab. There’s no option to change or disable default keyboard shortcuts (Firefox 98, 2022-03-29 // Firefox 117依然不支持). So if you want to do it, you need to edit files manually. To disable ctrl-w shortcut in Firefox, you need to manually edit the file:
/usr/lib/firefox/browser/omni.ja (Linux) ./c/Program Files/Mozilla Firefox/browser/omni.ja (Windows)
Modify the File
Run git bash in administration mode.
First unzip it to a temporary directory:
mkdir /tmp/firefox-omni
cd /tmp/firefox-omni
unzip /c/Program Files/Mozilla Firefox/browser/omni.jaNow you need to edit ./chrome/browser/content/browser/browser.xhtml to make your changes. You can change as many shortcuts as you want here. The ctrl-w key is called close-shortcut. You can either
comment out the offending line, orchange modifiersaccel,shift to require ctrl-shift-w to close tabs. Note, the above instructions only make Ctrl-W an unreserved shortcut. This means extensions can now remap it. If you don’t have any extensions that remap it then Ctrl-W will still close your current window. If you’d like to simply disable Ctrl-W, then just comment out the above shortcut definitions entirely (instead of only changing reservedtrue to reservedfalse as I suggest above). Here is how to comment it out:
key idkey_close data-l10n-idclose-shortcut commandcmd_close modifiersaccel reservedtrue/Now switch to root, and install your changes:
cd /tmp/firefox-omni
zip -0DXqr /tmp/omni.ja * # I have install zip into DELL
cd /c/Program Files/Mozilla Firefox/browsercp ./omni.ja ./omni.ja.bkup # backupcp /tmp/omni.ja ./omni.ja # TOCHECK: if the first path is correct
rm -r /tmp/omni.ja /tmp/firefox-omniClear Firefox Start Cache and Restart
In URI panel, enter about:support
Click “Clear startup cache…” on the right, and click restart. (opened pages won’t be lost)
Done Note: You will have to do this every time you reinstall firefox. I automated the above into a script. First save firefox-omni.patch as ~/local/src/firefox-omni.patch, and then download and run this script as a normal users (that has sudo privileges). Reference
https://www.math.cmu.edu/~gautam/sj/blog/20220329-firefox-disable-ctrl-w.html