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

自己紹介(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’))

閑話休題

((‘tag:center’)) そろそろ本題にn((‘note:Back on topic’))

本日の話題n((‘note:Today’s topics’))

話さないことn((‘note:I don’t talk about…‘))

会場のみなさんに質問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

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:Customizing …’))

アドオンをインストールn((‘note:Install addons’))

# image
# relative-height = 80
# src = images/addons-mozilla.png

必須のアドオンn((‘note:Must install these addons’))

注:個人の感想です。n((‘note:Personally, I recomends these addons’))

アドオン on debiann((‘note: Addons on debian’))

$ apt search xul | grep xul-ext | wc -l
79

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

インストールのされかたn((‘note:How xpi is installed?’))

拡張はどこに?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

拡張はどこに?n((‘note:Where is extension installed?’))

カスタマイズいろいろn((‘note:Customizing …’))

user.jsを修正するn((‘note:Modify 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:Customizing …’))

システム全体の設定はn((‘note:How to do system-wide configuration?’))

Debian固有の設定n((‘note:Debian specific configuration’))

Debian固有の設定(1)n((‘note:Debian specific configuration’))

Debian固有の設定(2)n((‘note:Debian specific configuration’))

Debian固有の設定(3)n((‘note:Debian specific configuration’))

Debian固有の設定(4)n((‘note:Debian specific configuration’))

Debian固有の設定(5)n((‘note:Debian specific configuration’))

Debian固有の設定(6)n((‘note:Debian specific configuration’))

設定方法いろいろn((‘note:pref(…) family’))

defaultPref(‘…’)

lockPref(‘…’)

pref(‘…’)

sticky_pref(‘…’)

組織向けにFirefoxを((‘note:Firefox for organizations’))

組織利用の観点だとn((‘note:Point of view from organizations’))

組織内向けカスタマイズ((‘note:How to customize for organization’))

参考記事の紹介(1)n((‘note:Blog entry how to customize’))

「Firefox・Thunderbirdの組織内向けカスタマイズの方法の簡単な紹介と比較」

参考記事の紹介(2)n((‘note:Blog entry how to customize’))

MCD?

MCDとは?n((‘note: What is MCD?’))

autoconfig.js

autoconfig.cfg

autoconfig.jsc

こんなときどうする?

こんなときどうする?

firefox-support-common

# image
# relative-height = 70
# src = images/firefox-support-common.png

firefox-support-common

firefox-support-common

customization-items.ods

カスタマイズ事例をシートで分類

customization-items.ods

カスタマイズ事例をシートで分類

customization-items

customization-items.ods

カスタマイズ事例をシートで分類

menuitem-shortcut-disable-items

customization-items.ods

カスタマイズ事例をシートで分類

misc-ui-disable-items

どうやって?n((‘note:How?’))

カスタマイズのアドオンn((‘note:Addon to customize’))

カスタマイズのアドオンn((‘note:Addon to customize’))

GlobalChrome.css

カスタマイズのアドオンn((‘note:Addon to customize’))

UI Text Overrider

カスタマイズのアドオンn((‘note:Addon to customize’))

Force Addon Status

addons.mozilla.org/ja/firefox/addon/force-addon-status/

できることの一例

使い方

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);"

まとめ