LeetCode-Default-Font

Always use the default monospace font in the codemirror editor.

// ==UserScript==
// @name         LeetCode-Default-Font
// @namespace    leetcode-default-font
// @version      0.3
// @description  Always use the default monospace font in the codemirror editor.
// @author       [email protected]
// @include      *://leetcode.com/*
// ==/UserScript==

(function() {
    'use strict';
    function addGlobalStyle(css) {
        var head, style;
        head = document.getElementsByTagName('head')[0];
        if (!head) { return; }
        style = document.createElement('style');
        style.type = 'text/css';
        style.innerHTML = css;
        head.appendChild(style);
    }
    addGlobalStyle('.CodeMirror { font-family: monospace !important; }');
    addGlobalStyle('pre, code, kbd, samp { font-family: monospace !important; }');
})();