firefox の shortcut を無効にする

# 背景
- firefox の shortcut key がうざい
- Ctrl-N, Ctrl-P, Ctrl-m, Ctrl-H とかを無効にしたい

# 結論
- firefox のアップデート毎に bat (patch) を走らせればよい

# 手順
1. firefox 更新
1. firefox 停止
1. bat (firemod.bat on windows) を起動
1. firefox 起動
1. Ctrl-N で何も起きないことを確認

# 内容
Desktop とかに置いておく bat スクリプト
``` firemod.bat
bash --login -i -c C:/home/app/sh/firemod.sh
```

起動される shell スクリプト
``` firemod.sh
#!/bin/bash -x

WORK=/cygdrive/c/home/app/sh
patchfile=${WORK}/_firefox.patch
echo $patchfile

omni='/cygdrive/c/Program Files/Mozilla Firefox/browser/omni.ja'
#SUDO="/usr/bin/cygstart --action=runas"
SUDO="python3 /usr/bin/cygwin-sudo.py"
cd $WORK

if [ -d ../tmp/firefox-omni ]; then
  rm -rf ../tmp/firefox-omni/*
else
  mkdir -p ../tmp/firefox-omni
fi;

cd ../tmp/firefox-omni
unzip -q "$omni" || true

patch chrome/browser/content/browser/browser.xhtml $patchfile
zip -0DXqr ../omni.ja ./*
sleep 2;

$SUDO chmod a+rw "$omni"
$SUDO cp -v "$omni" "$omni.orig"
pwd
sleep 2;

$SUDO cp -vf ../omni.ja "$omni"
sleep 2;

ca=`cygpath ${LOCALAPPDATA}/Mozilla/Firefox/Profiles/*/startupCache`
rm -rf $ca;

sleep 2;
```
patch file (ご参考まで)
```_firefox.patch
--- browser.xhtml.20230317      2023-03-17 12:36:22.809165800 +0900
+++ browser.xhtml       2023-03-17 12:40:21.295152700 +0900
@@ -268,33 +268,33 @@ if (AppConstants.platform == "macosx") {
 </commandset>

   <keyset id="mainKeyset">
-    <key id="key_newNavigator"
+<!-- <key id="key_newNavigator"
          data-l10n-id="window-new-shortcut"
          command="cmd_newNavigator"
-         modifiers="accel" reserved="true"/>
-    <key id="key_newNavigatorTab" data-l10n-id="tab-new-shortcut" modifiers="accel"
-         command="cmd_newNavigatorTabNoEvent" reserved="true"/>
+         modifiers="accel" reserved="true"/> -->
+<!-- <key id="key_newNavigatorTab" data-l10n-id="tab-new-shortcut" modifiers="accel"
+         command="cmd_newNavigatorTabNoEvent" reserved="true"/> -->
     <key id="focusURLBar" data-l10n-id="location-open-shortcut" command="Browser:OpenLocation"
          modifiers="accel"/>
     <key id="focusURLBar2" data-l10n-id="location-open-shortcut-alt" command="Browser:OpenLocation"
          modifiers="alt"/>

     <key id="key_search" data-l10n-id="search-focus-shortcut" command="Tools:Search" modifiers="accel"/>
-    <key id="key_search2"
+<!-- <key id="key_search2"
          data-l10n-id="search-focus-shortcut-alt"
          modifiers="accel"
-         command="Tools:Search"/>
-    <key id="key_openDownloads"
+         command="Tools:Search"/> -->
+<!-- <key id="key_openDownloads"
          data-l10n-id="downloads-shortcut"
          modifiers="accel"
-         command="Tools:Downloads"/>
+         command="Tools:Downloads"/> -->
     <key id="key_openAddons" data-l10n-id="addons-shortcut" command="Tools:Addons" modifiers="accel,shift"/>
     <key id="openFileKb" data-l10n-id="file-open-shortcut" command="Browser:OpenFile"  modifiers="accel"/>
     <key id="key_savePage" data-l10n-id="save-page-shortcut" command="Browser:SavePage" modifiers="accel"/>
-    <key id="printKb" data-l10n-id="print-shortcut" command="cmd_print"  modifiers="accel"/>
-    <key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" reserved="true"/>
-    <key id="key_closeWindow" data-l10n-id="close-shortcut" command="cmd_closeWindow" modifiers="accel,shift" reserved="true"/>
-    <key id="key_toggleMute" data-l10n-id="mute-toggle-shortcut" command="cmd_toggleMute" modifiers="control"/>
+<!-- <key id="printKb" data-l10n-id="print-shortcut" command="cmd_print"  modifiers="accel"/> -->
+<!-- <key id="key_close" data-l10n-id="close-shortcut" command="cmd_close" modifiers="accel" reserved="true"/> -->
+<!-- <key id="key_closeWindow" data-l10n-id="close-shortcut" command="cmd_closeWindow" modifiers="accel,shift" reserved="true"/> -->
+<!-- <key id="key_toggleMute" data-l10n-id="mute-toggle-shortcut" command="cmd_toggleMute" modifiers="control"/> -->
     <key id="key_undo"
          data-l10n-id="text-action-undo-shortcut"
          modifiers="accel"
@@ -324,7 +324,7 @@ if (AppConstants.platform == "macosx") {
     <key id="goForwardKb"  keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
     <key id="goHome" keycode="VK_HOME" oncommand="BrowserHome();" modifiers="alt"/>
     <key keycode="VK_F5" command="Browser:Reload"/>
-    <key id="showAllHistoryKb" data-l10n-id="history-show-all-shortcut" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
+<!-- <key id="showAllHistoryKb" data-l10n-id="history-show-all-shortcut" command="Browser:ShowAllHistory" modifiers="accel,shift"/> -->
     <key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
     <key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
     <key id="key_toggleReaderMode"
@@ -364,10 +364,10 @@ if (AppConstants.platform == "macosx") {
     <key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>

-    <key id="key_gotoHistory"
+<!-- <key id="key_gotoHistory"
          data-l10n-id="history-sidebar-shortcut"
          modifiers="accel"
-         oncommand="SidebarUI.toggle('viewHistorySidebar');"/>
+         oncommand="SidebarUI.toggle('viewHistorySidebar');"/> -->

     <key id="key_fullZoomReduce" data-l10n-id="full-zoom-reduce-shortcut" command="cmd_fullZoomReduce"  modifiers="accel"/>
     <key                         data-l10n-id="full-zoom-reduce-shortcut-alt-a" command="cmd_fullZoomReduce"  modifiers="accel"/>
```

# 参考
- Disabling the Ctrl-W shortcut on Firefox
  https://www.math.cmu.edu/~gautam/sj/blog/20220329-firefox-disable-ctrl-w.html
- cygwin sudo
  https://github.com/Chronial/cygwin-sudo.git
- startup cache clear
  https://windowsbulletin.com/ja/how-to-clear-startup-cache-in-mozilla-firefox/