Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danguita/4536975 to your computer and use it in GitHub Desktop.
Save danguita/4536975 to your computer and use it in GitHub Desktop.
###
// ==UserScript==
// @name Gmail Monospace
// @namespace http://owns.ch
// @description Make emails and textareas in Gmail monospace
// @author Alen Mujezinovic & David Anguita
// @homepage http://gist.github.com/4536975
// @match http://mail.google.com/*
// @match https://mail.google.com/*
// ==/UserScript==
###
css =
"""
td > div, div.Bk, div.editable, textarea {
font-family: Menlo, Monaco, DejaVu Sans Mono, Courier, monospace !important;
}
"""
try
# Prepare style tag
node = document.createElement "style"
node.type = "text/css"
node.appendChild document.createTextNode css
# Append to all heads
heads = document.getElementsByTagName 'head'
head.appendChild(node) for head in heads
catch err
try
console.log "Error applying GMail style: "
console.log err
console.log err.stack
catch err
# pass
// Generated by CoffeeScript 1.3.1
/*
// ==UserScript==
// @name Gmail Monospace
// @namespace http://owns.ch
// @description Make emails and textareas in Gmail monospace
// @author Alen Mujezinovic & David Anguita
// @homepage http://gist.github.com/4536975
// @match http://mail.google.com/*
// @match https://mail.google.com/*
// ==/UserScript==
*/
(function() {
var css, head, heads, node, _i, _len;
css = "td > div, div.Bk, div.editable, textarea {\n font-family: Menlo, Monaco, DejaVu Sans Mono, Courier, monospace !important;\n}";
try {
node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
heads = document.getElementsByTagName('head');
for (_i = 0, _len = heads.length; _i < _len; _i++) {
head = heads[_i];
head.appendChild(node);
}
} catch (err) {
try {
console.log("Error applying GMail style: ");
console.log(err);
console.log(err.stack);
} catch (err) {
}
}
}).call(this);
@danguita
Copy link
Author

Install UserScript in Google Chrome:

  1. Open chrome://extensions
  2. Drag *.user.js file
  3. Allow extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment