Enable Facebook's native dark mode for Messenger.com
< Feedback on Messenger Dark Mode Enabler
The reason it's not working is they forgot to overload `--messenger-card-background: #FFFFFF;` in their dark theme. If you were to add this with proper background colour, it would work.
To be exact, the real reason it's not working is some elements still have __fb-light-mode
class therefore light theme property --messenger-card-background: #FFFFFF;
overloads the same property of the dark theme. My quick solution:
var sheet = document.createElement('style')
sheet.innerHTML = ":root, .__fb-light-mode { --messenger-card-background: #242526 !important; }";
document.body.appendChild(sheet);
document.querySelector('html').classList.add('__fb-dark-mode');
Please, add some fix to your script. Technically it'll still be a one-liner (with a minor patch on what Facebook fucked up).
There's an issue with reaction bar as well, so updated version:
// ==UserScript==
// @name Messenger Dark Mode Enabler
// @namespace https://greasyfork.org/en/users/717657-crborga
// @version 1.0
// @description Enable Facebook's native dark mode for Messenger.com
// @author crborga
// @match https://*.messenger.com/*
// @grant none
// ==/UserScript==
var sheet = document.createElement('style')
sheet.innerHTML = ":root, .__fb-light-mode { --messenger-card-background: #242526 !important; } .hybvsw6c { background-color: #242526 !important; }";
document.body.appendChild(sheet);
document.querySelector('html').classList.add('__fb-dark-mode');
Unfortunately it no longer works. Facebook broke their own theme.