DebianでFirefoxをnカスタマイズするには¶ ↑
: subtitle
How to customize Firefox on Debian
: author
Kentaro Hayashi
: institution
ClearCode Inc.
: content-source
Mini Debian Conference Japan 2016
: date
2016-12-10
: allotted-time
30m
: theme
.
自己紹介(1)n((‘note:Profile’))¶ ↑
# image # relative-height = 40 # src = https://pbs.twimg.com/profile_images/2290018079/cvcy12slbeva80jboxzf_400x400.png
-
Twitter/GitHub: @kenhys
-
所属: ((*トラックポイント・ソフトドーム派*))
自己紹介(2)n((‘note:Profile’))¶ ↑
# image # relative-height = 60 # src = images/track-points.png
-
トラックポイント・ソフトドーム派
参考画像の出典¶ ↑
# image # relative-height = 80 # src = images/irasutoya.png
パッケージ関連の活動n((‘note:As a contributor’))¶ ↑
-
groonga (全文検索エンジン)
-
groonga-normalizer-mysql
-
libhinawa
-
fcitx-imlist
-
hal-flash (Flashを延命させるアレ)
-
growl-for-linux
閑話休題¶ ↑
((‘tag:center’)) そろそろ本題にn((‘note:Back on topic’))
本日の話題n((‘note:Today’s topics’))¶ ↑
-
Firefoxのカスタマイズのことn((‘note:About how to customize Firefox’))
話さないことn((‘note:I don’t talk about…‘))¶ ↑
-
アドオンの作り方n((‘note:How to create addon’))
-
WebExtensions
会場のみなさんに質問n((‘note:Question 1’))¶ ↑
((‘tag:center’))ブラウザは何を使っていますか?n((‘note:What browsers do you love?’))
ブラウザシェアn((‘note:Browser stats’))¶ ↑
# image # relative-height = 80 # src = images/browser-share-2016.png
-
デスクトップにおけるシェアの推移(by StatCounter)
chromium on debian¶ ↑
# image # relative-height = 100 # src = images/popcorn-chromium.png
firefox on debian¶ ↑
# image # relative-height = 100 # src = images/popcorn-firefox.png
iceweasel on debian¶ ↑
# image # relative-height = 100 # src = images/popcorn-iceweasel.png
firefox-esr on debian¶ ↑
# image # relative-height = 100 # src = images/popcorn-firefox-esr.png
会場のみなさんに質問n((‘note:Question 2’))¶ ↑
((‘tag:center’))Firefoxカスタマイズしていますか?n ((‘note:Do you customize Firefox?’))
カスタマイズいろいろn((‘note:Customizing …’))¶ ↑
-
設定メニューからオプションを変更n((‘note:Tweak via options’))
-
アドオンをインストールn((‘note:Install addons’))
-
user.jsを修正するn((‘note:Modify user.js’))
-
システム全体の設定n((‘note:System-wide configuration’))
カスタマイズいろいろn((‘note:Customizing …’))¶ ↑
-
設定メニューからオプションを変更n((‘note:Tweak via options’))
-
((*アドオンをインストールn((‘note:Install addons’))*))
-
user.jsを修正するn((‘note:Modify user.js’))
-
システム全体の設定n((‘note:System-wide configuration’))
アドオンをインストールn((‘note:Install addons’))¶ ↑
# image # relative-height = 80 # src = images/addons-mozilla.png
必須のアドオンn((‘note:Must install these addons’))¶ ↑
-
Tab Groups
-
ツリー型タブn((‘note:Tree Style Tab’))
-
Vimperator
注:個人の感想です。n((‘note:Personally, I recomends these addons’))
アドオン on debiann((‘note: Addons on debian’))¶ ↑
$ apt search xul | grep xul-ext | wc -l 79
-
aptでインストール可能なパッケージがこれだけある
aptでインストールn((‘note:Easy to install by apt’))¶ ↑
$ sudo apt install xul-ext-iceweasel-branding
Iceweasel風Firefoxn((‘note:Mimic iceweasel’))¶ ↑
# image # relative-height = 80 # src = images/iceweasel-branding.png
-
Firefoxを使っていたと思ったらIceweaselだった
インストールのされかたn((‘note:How xpi is installed?’))¶ ↑
-
xpiそのままインストールn((‘note:Install xpi as is’))
-
展開済みのaddonとしてインストールn((‘note:Install as unpacked addon’))
拡張はどこに?n((‘note:Where is extension installed?’))¶ ↑
$ dpkg -S /usr/lib/firefox/browser/extensions/\{972ce4c6-7e08-4474-a285-3208198ce6fd\}.xpi firefox: /usr/lib/firefox/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
-
デフォルトのテーマはnxpiとしてインストールされている
拡張はどこに?n((‘note:Where is extension installed?’))¶ ↑
-
/usr/share/xul-ext/iceweasel-brandingに展開
/usr/share/xul-ext/iceweasel-branding ├── chrome │ ├── content │ │ ├── about-logo.png │ │ ├── about-logo@2x.png │ │ ├── about-wordmark.png │ │ ├── about-wordmark.svg │ │ ├── about.png │ │ ├── aboutDialog.css │ │ ├── aboutIceweasel │ │ │ ├── aboutIce.js │ │ │ ├── aboutIce.manifest │ │ │ └── ice.xhtml │ │ ├── browser-overlay.css │ │ ├── icon128.png │ │ ├── icon16.png │ │ ├── icon32.png │ │ ├── icon48.png │ │ ├── icon64.png │ │ └── unofficial │ │ ├── identity-icons-brand.svg │ │ └── silhouette-40.svg │ └── locale │ ├── brand.dtd │ ├── brand.properties │ └── ice.dtd ├── chrome.manifest ├── icon.png ├── icon64.png └── install.rdf
カスタマイズいろいろn((‘note:Customizing …’))¶ ↑
-
設定メニューからオプションを変更n((‘note:Tweak via options’))
-
アドオンをインストールn((‘note:Install addons’))
-
((*user.jsを修正するn((‘note:Modify user.js’))*))
-
システム全体の設定n((‘note:System-wide configuration’))
user.jsを修正するn((‘note:Modify user.js’))¶ ↑
-
伝統的なカスタマイズ方法n((‘note: Traditional way to customize’))
-
~/.mozilla/firefox/(プロファイル)/user.jsに置くn((‘note:Put user.js as ~/mozilla/firefox/(profile)/user.js’))
user.jsの例n((‘note:Example how to customize user.js’))¶ ↑
# enscript javascript user_pref("browser.tabs.closeWindowWithLastTab", false);
最後のタブを閉じたときにウィンドウを閉じないn((‘note:Do not close window even though last tab is closed’))
user.jsは万能ではないn((‘note:user.js is suitable for specific purpose’))¶ ↑
-
プロファイルごとに設定n((‘note:Need to configure each profile’))
-
プロファイルで管理されていない項目は不可n((‘note:It should be managed by profile’))
-
集中管理するのには不向きn((‘note:Not suitable for centralized management’))
-
FirefoxSyncでよいのでは?n((‘note:FirefoxSync may be better solution?’))
カスタマイズいろいろn((‘note:Customizing …’))¶ ↑
-
設定メニューからオプションを変更n((‘note:Tweak via options’))
-
アドオンをインストールn((‘note:Install addons’))
-
user.jsを修正するn((‘note:Modify user.js’))
-
((*システム全体の設定n((‘note:System-wide configuration’))*))
システム全体の設定はn((‘note:How to do system-wide configuration?’))¶ ↑
-
/etc/firefox/*.js
-
/etc/firefox/以下に置いた任意の.jsで設定できるn((‘note:Any *.js is ok under /etc/firefox/’))
-
Debian固有の設定n((‘note:Debian specific configuration’))¶ ↑
-
設定ファイルの場所n((‘note:The configuration file is:’))
/usr/lib/firefox/browser/defaults/syspref/firefox.js -> /etc/firefox/firefox.js
Debian固有の設定(1)n((‘note:Debian specific configuration’))¶ ↑
-
拡張の更新を有効n((‘note:Enable to update extensions’))
# enscript javascript pref("extensions.update.enabled", true);
Debian固有の設定(2)n((‘note:Debian specific configuration’))¶ ↑
-
LANGに応じてロケールを設定n((‘note:Use LANG environment variable to choose locale’))
# enscript javascript pref("intl.locale.matchOS", true);
Debian固有の設定(3)n((‘note:Debian specific configuration’))¶ ↑
-
既定のブラウザチェック無効n ((‘note:Disable default browser checking’))
# enscript javascript pref("browser.shell.checkDefaultBrowser", false);
Debian固有の設定(4)n((‘note:Debian specific configuration’))¶ ↑
-
OpenH264は無効n((‘note:Disable OpenH264’))
# enscript javascript pref("media.gmp-gmpopenh264.enabled", false);
Debian固有の設定(5)n((‘note:Debian specific configuration’))¶ ↑
-
新規タブはクラシックスタイルにn ((‘note:Default to classic view for about:newtab’))
# enscript javascript sticky_pref("browser.newtabpage.enhanced", false);
Debian固有の設定(6)n((‘note:Debian specific configuration’))¶ ↑
-
ヘルスレポートは無効n ((‘note:Disable health report upload’))
# enscript javascript pref("datareporting.healthreport.uploadEnabled", false);
設定方法いろいろn((‘note:pref(…) family’))¶ ↑
-
defaultPref(‘…’)
-
lockPref(‘…’)
-
pref(‘…’)
-
sticky_pref(‘…’)
defaultPref(‘…’)¶ ↑
-
初期設定値を指定
-
prefs.jsには原則保存されない
lockPref(‘…’)¶ ↑
-
設定を変更させない
pref(‘…’)¶ ↑
-
ユーザーが変更可能
sticky_pref(‘…’)¶ ↑
-
prefs.jsにデフォルト値に関わらず保存
-
通常は設定を変更したらprefs.jsに保存
-
組織向けにFirefoxを((‘note:Firefox for organizations’))¶ ↑
-
個人なら好きにカスタマイズでいい
-
組織利用はまた別の観点が必要
組織利用の観点だとn((‘note:Point of view from organizations’))¶ ↑
-
プロキシの設定をしたい
-
統計情報は送りたくない
-
勝手にアップデートしない
組織内向けカスタマイズ((‘note:How to customize for organization’))¶ ↑
-
Mozilla Japan 法人向け情報
参考記事の紹介(1)n((‘note:Blog entry how to customize’))¶ ↑
「Firefox・Thunderbirdの組織内向けカスタマイズの方法の簡単な紹介と比較」
参考記事の紹介(2)n((‘note:Blog entry how to customize’))¶ ↑
-
user.js
-
MCD
-
ActiveDirectoryのポリシー
-
CCK2 Wizard
-
その他
MCD?¶ ↑
-
McDonald?
MCDとは?n((‘note: What is MCD?’))¶ ↑
-
((M))ission ((C))ontrol ((D))esktop
-
Netscape由来の集中管理機構
* autoconfig.jsとautoconfig.cfg
autoconfig.js¶ ↑
-
/usr/lib/firefox/pref/autoconfig.js
# enscript javascript pref("general.config.filename", "autoconfig.cfg"); pref("general.config.vendor", "autoconfig"); pref("general.config.obscure_value", 0);
autoconfig.cfg¶ ↑
-
/usr/lib/firefox/autoconfig.cfg
# enscript javascript // 1行目は必ずコメントとしてください。 lockPref("autoadmin.global_config_url", "http://xxx/autoconfig.jsc");
autoconfig.jsc¶ ↑
-
ネットワーク経由で参照可能な場所に配置
-
中身は単なるprefやlockPref
-
こんなときどうする?¶ ↑
-
設定例がわからなくて困った
-
「技術的なよくある質問」
* https://www.mozilla.jp/business/faq/tech/
-
こんなときどうする?¶ ↑
-
「技術的なよくある質問」をみても解決しない
firefox-support-common¶ ↑
# image # relative-height = 70 # src = images/firefox-support-common.png
firefox-support-common¶ ↑
-
カスタマイズ事例集のリポジトリn((‘note:There are use cases in this repository’))
firefox-support-common¶ ↑
-
configurations/customization-items.ods
-
具体的なカスタマイズ方法が記載n((‘note:Practical use cases are there’))
-
customization-items.ods¶ ↑
カスタマイズ事例をシートで分類
-
customization-items
-
menuitem-shortcut-disable-items
-
misc-ui-disable-items
customization-items.ods¶ ↑
カスタマイズ事例をシートで分類
-
((customization-items))
-
menuitem-shortcut-disable-items
-
misc-ui-disable-items
customization-items¶ ↑
-
ポリシーを満たすための設定例
-
セキュリティ
-
プライバシー
-
自動更新
-
-
Firefox38/45ESRでの設定方法/設定内容
customization-items.ods¶ ↑
カスタマイズ事例をシートで分類
-
customization-items
-
((menuitem-shortcut-disable-items))
-
misc-ui-disable-items
menuitem-shortcut-disable-items¶ ↑
-
メニューのショートカットを無効にするための設定
-
ショートカットから実行できてはまずい
-
-
Firefox38/45ESRでの設定方法/設定内容
customization-items.ods¶ ↑
カスタマイズ事例をシートで分類
-
customization-items
-
menuitem-shortcut-disable-items
-
((misc-ui-disable-items))
misc-ui-disable-items¶ ↑
-
非表示にしたい項目の設定例
-
例:セキュリティパネル非表示化
-
-
Firefox38/45ESRでの設定方法/設定内容
どうやって?n((‘note:How?’))¶ ↑
-
カスタマイズ用のアドオンを活用n((‘note:Use specific addons to customize’))
カスタマイズのアドオンn((‘note:Addon to customize’))¶ ↑
-
GlobalChrome.css
-
UI Text Overrider
-
Force Addon Status
カスタマイズのアドオンn((‘note:Addon to customize’))¶ ↑
-
((GlobalChrome.css))
-
UI Text Overrider
-
Force Addon Status
GlobalChrome.css¶ ↑
-
ユーザースタイルシート機能n((‘note:Provides user stylesheet’))
-
globalChrome.cssを所定の場所に配置n((‘note:Put globalChrome.css in specific path’))
-
カスタマイズのアドオンn((‘note:Addon to customize’))¶ ↑
-
GlobalChrome.css
-
((*UI Text Overrider*))
-
Force Addon Status
UI Text Overrider¶ ↑
-
UI要素のラベルやツールチップテキストなどを変更n((‘note:Enable to customize UI labels, tooltips and so on’))
カスタマイズのアドオンn((‘note:Addon to customize’))¶ ↑
-
GlobalChrome.css
-
UI Text Overrider
-
((*Force Addon Status*))
Force Addon Status¶ ↑
-
アドオンの有効・無効の状態を強制的に変える機能
addons.mozilla.org/ja/firefox/addon/force-addon-status/
できることの一例¶ ↑
-
単機能アドオンの組み合わせでkiosk端末っぽく
-
参考:全部入りのkioskモード
使い方¶ ↑
-
odsに記載のサンプルコードをコピペ
-
目的に応じて個別の設定例をコピペ
GlobalChrome.css¶ ↑
# enscript css @-moz-document url-prefix("chrome://browser/content/browser.xul") { (セレクタ), *[always-hidden="true"] { display: none !important; -moz-user-focus: ignore !important; } }
UI Text Overrider(1)¶ ↑
# enscript javascript // disable shortcuts and UI var killedItems = []; var killedItemsWithDelay = []; var hiddenItemsWithDelay = [];
UI Text Overrider(2)¶ ↑
# enscript javascript killedItems.push("(ここにセレクタを記載)");
UI Text Overrider(3)¶ ↑
# enscript javascript function setKillItemRule(aIdentifier, aSelector, aDelayed, aDisableCommand) { lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier, aSelector); lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".disabled", "true"); lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".hidden", "true"); lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".readonly", "true"); if (aDisableCommand) { lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".command", ""); lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".oncommand", ""); } lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".always-hidden", "true"); lockPref("extensions.uitextoverrider@clear-code.com." + aIdentifier + ".delayed", aDelayed == true); } setKillItemRule("killedItems", killedItems.join(","), false, true); setKillItemRule("killedItemsWithDelay", killedItemsWithDelay.join(","), true, true); setKillItemRule("hiddenItemsWithDelay", hiddenItemsWithDelay.join(","), true, false);
Force Addon Status¶ ↑
# enscript javascript lockPref("extensions.force-addon-status@clear-code.com.plugins.0.pattern", "^Java(\\(TM\\)| )"); lockPref("extensions.force-addon-status@clear-code.com.plugins.0.enabledState", 0);"
まとめ¶ ↑
-
集中管理ならまずはMCDがよい
-
カスタマイズ専用アドオンが役立つ
-
過去のノウハウはn firefox-support-commonをチェック