Skip to content

Instantly share code, notes, and snippets.

@dcdunkan
Created November 18, 2025 12:41
Show Gist options
  • Select an option

  • Save dcdunkan/af26dfe925a5cd042b5ebcf37e2c9ea4 to your computer and use it in GitHub Desktop.

Select an option

Save dcdunkan/af26dfe925a5cd042b5ebcf37e2c9ea4 to your computer and use it in GitHub Desktop.
Font customizer for WhatsApp
// ==UserScript==
// @name font customizer for whatsapp
// @namespace Violentmonkey Scripts
// @match https://web.whatsapp.com/*
// @grant GM_getValue
// @grant GM_setValue
// @version 1.0
// @author Dunks
// @description 18/11/2025, 5:33:09 pm
// ==/UserScript==
console.log("Font customizer running");
console.log("Change or set a localStorage variable named 'wafc-font-family' and reload if you wanna change");
let isFirstTime = GM_getValue("first-time", true);
if (isFirstTime) {
alert("font customizer will default to system font, change the localStorage variable 'wafc-font-family' to change it");
GM_setValue("first-time", false);
localStorage.setItem("wafc-font-family", "system-ui");
}
const mutationObserver = new MutationObserver((list, observer) => {
const appEl = document.getElementById("app");
if (document.getElementById("app") != null) {
if (!localStorage.getItem("wafc-font-family")) {
localStorage.setItem("wafc-font-family", "system-ui");
}
app.style.fontFamily = localStorage.getItem("wafc-font-family") || "system-ui";
observer.disconnect();
}
});
mutationObserver.observe(document, { childList: true, subtree: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment