Skip to content

Instantly share code, notes, and snippets.

@phunanon
Created April 9, 2021 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phunanon/445feee4e2a390f7a5ea3e6b2e40c5d1 to your computer and use it in GitHub Desktop.
Save phunanon/445feee4e2a390f7a5ea3e6b2e40c5d1 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Telegram Dark mode
// @version 0.2
// @match https://web.telegram.org/*
// ==/UserScript==
setTimeout(() => {
var styles = [
["body, .tg_head_split, .im_page_wrap, .im_dialogs_search_field, .im_record_bg",
[["backgroundColor", "#000"], ["color", "#fff"]]],
[".im_dialog_peer",
[["color", "#fff"]]],
];
styles.forEach(([sel, propsvals]) =>
[...document.querySelectorAll(sel)].forEach(e =>
propsvals.forEach(([p, v]) => {e.style[p] = v;})));
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment