Auto Disable xLog Dark Mode

Automatically switch to Light Mode on any xLog blog site

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Auto Disable xLog Dark Mode
// @namespace    xlog-auto-disable-dark-mode
// @icon         https://xlog.app/assets/logo.svg
// @version      0.2
// @description  Automatically switch to Light Mode on any xLog blog site
// @author       Bryan
// @match        https://*/*
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const isXLog = !!document.head.querySelector("[content=xLog]");
    if (!isXLog) return;

    const oldLocalStorage = localStorage.getItem('darkMode');
    if (oldLocalStorage !== 'light') {
        localStorage.setItem('darkMode', 'light')
    }
})();