Forked from flashingpumpkin/gmail.monospace.coffee.js
Last active
May 20, 2017 05:23
-
-
Save danguita/4536975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
// ==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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install UserScript in Google Chrome: