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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
// ==UserScript==
// @name Facebook Messenger Force Dark Mode
// @description "Forcefully" applies the dark mode style to messenger (for use in sandboxed environments like Rambox)
//
// @version Indev 0.2
// @license MIT
// @author Syndamia
//
// @source https://gitlab.com/Syndamia/userscripts/-/blob/main/fb-messenger-force-darkmode.js
// @supportURL https://gitlab.com/Syndamia/userscripts/-/issues
// @homepage https://gitlab.com/Syndamia/userscripts/
// @icon https://upload.wikimedia.org/wikipedia/commons/b/be/Facebook_Messenger_logo_2020.svg
//
// @namespace Syndamia
// @match *://*.messenger.com/*
// @run-at document-start
// ==/UserScript==
document.querySelector('html').classList.add('__fb-dark-mode');
document.onload = function() {
var lights = document.getElementsByClassName("__fb-light-mode");
while (lights.length) {
lights[0].classList.remove("__fb-light-mode");
}
}
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = `
:root {
--header-height: 0px;
--base: #000;
--base-ninety: rgba(255, 255, 255, 0.9);
--base-seventy-five: rgba(255, 255, 255, 0.75);
--base-seventy: rgba(255, 255, 255, 0.7);
--base-fifty: rgba(255, 255, 255, 0.5);
--base-fourty: rgba(255, 255, 255, 0.4);
--base-thirty: rgba(255, 255, 255, 0.3);
--base-twenty: rgba(255, 255, 255, 0.2);
--base-five: rgba(255, 255, 255, 0.05);
--base-ten: rgba(255, 255, 255, 0.1);
--base-nine: rgba(255, 255, 255, 0.09);
--container-color: #323232;
--container-dark-color: #1e1e1e;
--list-header-color: #222;
--blue: #0084ff;
--selected-conversation-background: linear-gradient(hsla(209, 110%, 45%, 0.9), hsla(209, 110%, 42%, 0.9));
}
.oo9gr5id {
color: #e6e6e6;
}
.x1xr0vuk {
background-color: #3d3d3d !important;
}
/* Better scrollbar */
/* width */
::-webkit-scrollbar {
width: 10px;
}
/* Track */
::-webkit-scrollbar-track {
background: #f1f1f1;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #888;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
/* Top bar: App menu button color */
[aria-label="Settings, help and more"] .a8c37x1j.ms05siws.hwsy1cff.b7h9ocf4 {
fill: currentColor !important;
color: var(--primary-text) !important;
}
/* Top bar: New message button color */
[aria-label="New Message"] .a8c37x1j.ms05siws.hwsy1cff.b7h9ocf4 {
fill: currentColor !important;
color: var(--primary-text) !important;
}
/* Preferences: Icon color */
[aria-label="Preferences"] .a8c37x1j.ms05siws.hwsy1cff.b7h9ocf4 {
fill: currentColor !important;
color: var(--primary-text) !important;
}
/* Menu: Icon color in menu */
[role="menu"] .a8c37x1j.ms05siws.hwsy1cff.b7h9ocf4 {
fill: currentColor !important;
color: var(--primary-text) !important;
}
/* Right sidebar: Icon color */
.rq0escxv.l9j0dhe7.du4w35lb.j83agx80.cbu4d94t.g5gj957u.f4tghd1a.ifue306u.kuivcneq.t63ysoy8 .a8c37x1j.ms05siws.hwsy1cff.b7h9ocf4 {
fill: currentColor !important;
color: var(--primary-text) !important;
}
/* Contact list: delivered icon color */
.aahdfvyu [role="grid"] .a8c37x1j.ms05siws.hwsy1cff.b7h9ocf4 {
fill: currentColor !important;
color: var(--primary-text) !important;
}
body::-webkit-scrollbar {
display: none;
}
`
document.getElementsByTagName("head")[0].appendChild( style );
/* Fixing light mode not being present */
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
async function fix() {
while(true) {
var lights = document.getElementsByClassName("__fb-light-mode");
while (lights.length) {
lights[0].classList.remove("__fb-light-mode");
}
await sleep(1000);
}
}
fix();
|