Last active
October 2, 2017 04:14
-
-
Save willjobs/cf0142ca324ccde835baec42f0226a7d to your computer and use it in GitHub Desktop.
Tampermonkey/greasemonkey script to fix FastMail's email body width (which is set to 938px) to fit on the page
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 Fastmail - email body width | |
// @description Fix width of emails being wider than screen | |
// @author Will Jobs | |
// @id fastmail-emailwidth | |
// @include https://www.fastmail.com/mail/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant GM_addStyle | |
// ==/UserScript== | |
/*- The @grant directive is needed to work around a design change | |
introduced in GM 1.0. It restores the sandbox. | |
*/ | |
(function() { | |
'use strict'; | |
function fixWidth (jNode) { | |
jNode.width('inherit'); | |
} | |
waitForKeyElements (".v-Message-body.v-Message-body--html", fixWidth); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses the waitForKeyElements function (see docs here and here and example here) to detect AJAX updates (when you select a new folder or message) and re-style.