Mozilla Firefox
表示
Mozilla Firefoxハンドブック
[編集]はじめに
[編集]Mozilla Firefoxは、Mozilla Foundationが開発するオープンソースのWebブラウザです。プライバシー保護、拡張性、Web標準への準拠を重視しています。本ハンドブックでは、Firefoxの基本的な使用方法から高度な設定まで、包括的に解説します。
基本操作
[編集]タブの管理
[編集]タブは効率的なブラウジングの要となります。
基本的なタブ操作
[編集]- 新しいタブを開く: Ctrl + T(macOSはCommand + T)
- タブを閉じる: Ctrl + W(macOSはCommand + W)
- タブを復元: Ctrl + Shift + T(macOSはCommand + Shift + T)
- タブのピン留め: タブを右クリックして「タブをピン留め」を選択
タブグループの管理
[編集]Firefoxでは、タブをコンテナーに分類して管理できます:
// about:configでの設定例 privacy.userContext.enabled = true; privacy.userContext.ui.enabled = true;
アドレスバーの活用
[編集]アドレスバー(Awesome Bar)は検索と履歴へのアクセスを統合します:
!
+ キーワード: キーワード検索@
+ サイト名: 特定サイト内の検索%
: 開いているタブ内の検索^
: 履歴からの検索*
: ブックマークからの検索
プライバシーとセキュリティ
[編集]トラッキング保護
[編集]Firefoxは強力なトラッキング保護機能を提供します:
about:preferences#privacy
// user.jsでの設定例 user_pref("privacy.trackingprotection.enabled", true); user_pref("privacy.trackingprotection.fingerprinting.enabled", true); user_pref("privacy.trackingprotection.cryptomining.enabled", true);
セキュリティ設定
[編集]重要なセキュリティ設定の例:
// TLSの設定 security.tls.version.min = 3 security.tls.version.max = 4 // HTTPSのみモード dom.security.https_only_mode = true
カスタマイズ
[編集]userChrome.cssによるUIカスタマイズ
[編集]ブラウザのUIをカスタマイズする例:
/* userChrome.css */ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* タブバーの高さを調整 */ .tabbrowser-tab { height: 32px !important; } /* サイドバーのスタイル */ #sidebar-box { min-width: 250px !important; max-width: 400px !important; }
user.jsによる設定のカスタマイズ
[編集]詳細設定をファイルで管理する例:
- user.js
user_pref("browser.tabs.closeWindowWithLastTab", false); user_pref("browser.urlbar.suggest.bookmark", true); user_pref("browser.urlbar.suggest.history", true); user_pref("browser.urlbar.suggest.openpage", true); user_pref("browser.sessionstore.interval", 60000);
プロファイル管理
[編集]プロファイルの作成と管理
[編集]複数のプロファイルを使用する方法:
firefox.exe -P "プロファイル名" -no-remote firefox.exe -ProfileManager
プロファイルの設定例:
// profiles.ini [Profile0] Name=default IsRelative=1 Path=Profiles/abc123.default Default=1 [Profile1] Name=work IsRelative=1 Path=Profiles/xyz789.work
開発者ツール
[編集]コンソールの使用
[編集]JavaScriptデバッグの例:
// コンソールでのデバッグ console.log("デバッグメッセージ"); console.table([ { id: 1, name: "項目1" }, { id: 2, name: "項目2" } ]); // パフォーマンス計測 console.time("処理時間"); // 処理 console.timeEnd("処理時間");
リモートデバッグ
[編集]リモートデバッグの設定:
// about:configでの設定 devtools.debugger.remote-enabled = true; devtools.debugger.remote-port = 6000; // コマンドラインでの接続 firefox -start-debugger-server
トラブルシューティング
[編集]セーフモード
[編集]問題解決のためのセーフモード起動:
firefox.exe -safe-mode
プロファイルの再作成
[編集]プロファイルをリフレッシュする手順:
- about:supportを開く
- 「Firefoxをリフレッシュ」を選択
- プロファイルのバックアップを作成
- リフレッシュを実行
拡張機能開発
[編集]WebExtension APIの使用
[編集]基本的な拡張機能の構造:
- manifest.json
{ "manifest_version": 2, "name": "Sample Extension", "version": "1.0", "description": "Sample Firefox Extension", "permissions": ["tabs", "storage"], "background": { "scripts": ["background.js"] } }
- background.js
browser.browserAction.onClicked.addListener(() => { browser.tabs.create({ url: "https://example.com" }); });
参考資料
[編集]- Mozilla Firefox公式ドキュメント
- Firefox Developer Network (MDN)
- Mozilla Source Tree Documentation