m6u's blog

便利な製品・サービス・アプリを見つけては、その評価を書き続けるブログ

Gmailの本文を等幅フォントで表示するGreasemonkey jsに手を加えた

 http://www.indelible.org/なるサイトで公開されている、Jon Pariseさんの「Fixed-font message bodies for Gmail」というのをベースに、ちょっと書き換えてみた。 単純に、フォントをWindowsによくあるフォント名'MS ゴシック'にするというだけですが、ダイレクトメールの類が少し読みやすくなりました。 (一部難あり)

// ==UserScript==
// @name           Gmail Fixed Font
// @namespace      http://www.indelible.org/
// @description    Fixed-font message bodies for Gmail
// @author         Jon Parise
// @version        1.21
// @include        http://mail.google.com/*
// @include        https://mail.google.com/*
// @include        http://*.mail.google.com/*
// @include        https://*.mail.google.com/*
// ==/UserScript==

// Plain-text Message Body
var css = ".ii { font-size: .9em !important; font-family: 'MS ゴシック' !important; }";
// Quoted Text
css += ".im, .gmail_quote { color: #666 !important; }";

if (typeof GM_addStyle != "undefined") {
    GM_addStyle(css);
} else if (typeof addStyle != "undefined") {
    addStyle(css);
} else {
    var heads = document.getElementsByTagName("head");
    if (heads.length > 0) {
        var node = document.createElement("style");
        node.type = "text/css";
        node.appendChild(document.createTextNode(css));
        heads[0].appendChild(node);
    }
}

 ただ、font-familyを追加しただけ。
 これでAAみたいなのはそろうかなと思ったけど、半角空白文字を なんてのに書き換えて表示しているせいか、半角空白文字を駆使してインデントしている場合に対応できてない感じ。 もうそれはしょうがないかなって思った。