blob: eb348258fab75dd06d2f9e0d57fbef73efd8f05e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
// ==UserScript==
// @name Muttagen
// @description Gmail user script providing Mutt features
// @namespace com.teddywing
// @match https://mail.google.com/*
// ==/UserScript==
type GmailCSSClass = string;
const TOOLS_PANEL: GmailCSSClass = 'bAw';
const SIDEBAR: GmailCSSClass = 'aeN';
const MESSAGE_PAGER: GmailCSSClass = 'AO';
type GmailCSSDefinitions = { [selector in GmailCSSClass]: string };
var css: GmailCSSDefinitions = {};
css[TOOLS_PANEL] = 'display: none;';
css[MESSAGE_PAGER] = 'filter: invert(100%);';
function construct_css(css: GmailCSSDefinitions): string {
var joined = '';
for (var selector in css) {
joined += `.${selector} { ${css[selector]} }`;
}
return joined;
}
function append_css(css: string): void {
var s = document.createElement('style');
var t = document.createTextNode(css);
s.appendChild(t);
document.head.appendChild(s);
}
append_css(
construct_css(css)
);
|