jparise / gmail-fixed-font (http://userscripts.org/scripts/show/17869)

A Greasemonkey script that applies the browser's monospace font to message body text in Gmail.

commit 1: cd82805272e5
parent 0: 210ee7c79d9a
branch: default
tags: tip
Applying the real 1.22 changes.
Jon Parise / jparise
7 months ago
gmail-fixed-font / gmail-fixed-font.user.js
r1:cd82805272e5 30 loc 971 bytes embed / history / annotate / raw /
// ==UserScript==
// @name           Gmail Fixed Font
// @namespace      http://www.indelible.org/
// @description    Fixed-font message bodies for Gmail
// @author         Jon Parise
// @version        1.22
// @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, .dV { font: .9em monospace !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);
    }
}