MacでFirefoxの過去バージョンを使う
以前のエントリーからの続きで、MacでFirefoxの過去バージョンを使えるように設定する。 - http://sugilog.hatenablog.com/entry/20120918/1347937065
用途は開発中のウェブアプリの動作テスト用。 メインで使っている新しいバージョンのFirefoxとは、疎になっていていいし、そうあってほしい。
過去バージョンのFirefoxの用意
- 必要なfirefoxの過去バージョンのdmgファイルをダウンロード
- ダウンロードしたdmgファイルを開き、中にある
Firefox.app
を/Applications
以外の適当なディレクトリに移動。 - 移動させたFirefox.appを名前変更する。バージョン名付けるとか。
- 例)
Firefox_3.6.28.app
- 例)
- 名前を変更したappを、
/Applications
に移動。
Profileの作成
- コマンドライン(Terminal.appとか)からFirefoxを起動
/Applications/Firefox_3.6.28.app/Contents/MacOS/firefox-bin -P
- Profileの選択ダイアログがでるので、新しくProfileを作成する。
- 新しく作成したProfileを選んで、とりあえず起動する。
- 勝手にアップデートされないように制限する。
- Preferences(環境設定) > Advanced(詳細) > Update(更新) > 「Automatically check for updates to:」(次のソフトウェアの更新を自動的に確認する:)
- Firefoxはかならずチェックオフ
- 他は好みで。
- アプリケーションを閉じる。
起動用のappを作成
- 以下のような設定で進める。
- 作業用のフォルダ:
$HOME/tmp
- appの名前:
Firefox_3.6.28_dev
- アイコンは元のFirefoxからコピる。
- 作業用のフォルダ:
- 以下、コマンドライン作業
mkdir -p $HOME/tmp/Firefox_3.6.28_dev.app/Contents/MacOS mkdir -p $HOME/tmp/Firefox_3.6.28_dev.app/Contents/Resources cp /Applications/Firefox_3.6.28.app/Contents/Resources/firefox.icns $HOME/tmp/Firefox_3.6.28_dev.app/Contents/Resources/ cat <<-EOC > $HOME/tmp/Firefox_3.6.28_dev.app/Contents/MacOS/firefox.sh #!/bin/sh /Applications/Firefox_3.6.28.app/Contents/MacOS/firefox-bin -P Firefox_3.6.28_dev & exit 0 EOC cat <<-EOC > $HOME/tmp/Firefox_3.6.28_dev.app/Contents/Info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleExecutable</key> <string>firefox.sh</string> <key>CFBundleGetInfoString</key> <string>Firefox 3.6.28 with custom profile</string> <key>CFBundleIconFile</key> <string>firefox</string> <key>CFBundleName</key> <string>Firefox 3.6.28 dev</string> <key>CFBundleShortVersionString</key> <string>3.6.28</string> <key>CFBundleVersion</key> <string>3.6.28</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleSignature</key> <string>MOZB</string> </dict> </plist> EOC chmod 755 $HOME/tmp/firefox_3.6.28_dev.app/Contents/MacOS/firefox.sh
/Applications
ディレクトリに設置する。
mv $HOME/tmp/firefox_3.6.28_dev.app /Applications/
作成したアプリの構成は、
Firefox_3.6.28_dev.app
: パッケージFirefox_3.6.28_dev.app/Contents
: パッケージの中身の入れ物Firefox_3.6.28_dev.app/Contents/Info.plist
: 設定ファイルFirefox_3.6.28_dev.app/Contents/MacOS/firefox.sh
: 起動用の実行ファイルFirefox_3.6.28_dev.app/Contents/Resources/firefox.icns
: アイコン用の画像ファイル
/Applications/firefox_3.6.28_dev
を開いて起動することが出来ればOK!
後作業
- 通常使用しているFirefoxを起動しなおす。
- Profileの選択ダイアログがでたら、「default」(もしくはいつも使っているProfile)を選び、「Don't ask at startup」にチェックを入れて起動する。
参考
http://ukstudio.jp/2008/09/18/firefox/
追記
使用中のProfileを確認するには? - http://forum.mozilla.gr.jp/cbbs.cgi?mode=al2&namber=47364&KLOG=306
- Tools > Error console
Components.classes["@mozilla.org/file/directory_service;1"].getService( Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path