Huỳnh Bi

make a super gooooood extension for https://www.messenger.com/ (customize some thing essentials and so goooooooood)

Kodari AI
KodariOct 1 at 2:53 pm 1
MessengerEnhancer
A browser extension that enhances the Messenger.com experience with essential customizations. Features include a sleek dark mode toggle, customizable accent colors, compact message bubbles, font size controls, and an unread message counter badge. Users can adjust chat density, enable distraction-free focus mode, and personalize the interface with theme presets. The extension provides quick-access settings panel, keyboard shortcuts for toggling themes, and persistent preferences stored locally. It improves readability, reduces eye strain, and offers a more polished, modern look while maintaining full compatibility with Messenger's core functionality.
Huỳnh Bi

make a super gooooood extension for https://www.messenger.com/ (customize some thing essentials and so goooooooood)

Kodari AI
KodariOct 1 at 2:54 pm 1
  • Review the existing extension files and keep the implementation focused on Messenger.com.

  • Build a polished popup for essential appearance controls and persist settings.

  • Apply those settings safely on Messenger pages, with a keyboard shortcut and no unread-count claims the extension can’t reliably detect.

Added a Messenger-focused dark appearance toggle and a quick Open Messenger button. Dark mode and your existing preferences—hide Stories, compact spacing, reduce motion, text scaling, and focus color—save automatically and apply on Messenger.com.

Kodari can make mistakes. Review important code before using.
Files
background.js
content.css
content.js
manifest.json
popup.css
popup.html
popup.js
Code
7 616
popup.js
const DEFAULT_SETTINGS = {
  darkMode: false,
  hideStories: false,
  compactChat: false,
  reduceMotion: true,
  fontScale: 100,
  accentColor: "#1686ff"
};

const status = document.getElementById("status");
const controls = {
  darkMode: document.getElementById("darkMode"),
  hideStories: document.getElementById("hideStories"),
  compactChat: document.getElementById("compactChat"),
  reduceMotion: document.getElementById("reduceMotion"),
  fontScale: document.getElementById("fontScale")
};

function showStatus(message) {
  status.textContent = message;
}

async function saveSetting(key, value) {
  try {
    await chrome.storage.local.set({ [key]: value });
    showStatus("Settings saved");
  } catch (error) {
    console.error(`Failed to save ${key}:`, error);
    showStatus("Could not save settings");
  }
}

function updateFontScaleLabel(value) {
  document.getElementById("fontScaleValue").textContent = `${value}%`;
}

async function loadSettings() {
  try {
    const settings = await chrome.storage.local.get(DEFAULT_SETTINGS);
    for (const key of ["darkMode", "hideStories", "compactChat", "reduceMotion"]) {
      controls[key].checked = Boolean(settings[key]);
    }
    controls.fontScale.value = settings.fontScale;
    updateFontScaleLabel(settings.fontScale);

    document.querySelectorAll(".swatch").forEach((button) => {
      button.setAttribute("aria-pressed", String(button.dataset.color === settings.accentColor));
    });
  } catch (error) {
    console.error("Failed to load Messenger Plus settings:", error);
    showStatus("Could not load settings");
  }
}

for (const key of ["darkMode", "hideStories", "compactChat", "reduceMotion"]) {
  controls[key].addEventListener("change", () => {
    saveSetting(key, controls[key].checked);
  });
}

controls.fontScale.addEventListener("input", () => {
  updateFontScaleLabel(controls.fontScale.value);
});

controls.fontScale.addEventListener("change", () => {
  saveSetting("fontScale", Number(controls.fontScale.value));
});

document.querySelectorAll(".swatch").forEach((button) => {
  button.addEventListener("click", () => {
    const accentColor = button.dataset.color;
    document.querySelectorAll(".swatch").forEach((swatch) => {
      swatch.setAttribute("aria-pressed", String(swatch === button));
    });
    saveSetting("accentColor", accentColor);
  });
});

loadSettings();