PocketBase Dark Mode

Adds a simple css inject that inverts the colors except for images on PocketBase UI.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        PocketBase Dark Mode
// @namespace   ModLabs
// @version     1.0.0-GitHub
// @description Adds a simple css inject that inverts the colors except for images on PocketBase UI.
// @license     Apache License 2.0
// @author      ModLabs
// @match       *://*/*
// @grant       none
// ==/UserScript==

const isPocketBaseAdminPage = () =>
  !!document.querySelector(
    'link[rel="prefetch"][href="./libs/tinymce/skins/ui/pocketbase/skin.min.css"][as="style"]'
  );

let pbIntervalId = null;

if (isPocketBaseAdminPage()) {
  pbIntervalId = setInterval(() => {
    if (!document.querySelector("#pb_dark_mode_patch")) {
      const el = document.createElement("style");
      el.id = "pb_dark_mode_patch";
      el.textContent = `
        body { filter: invert(1); }
        img  { filter: invert(1); }
      `;
      document.head.appendChild(el);
    }
  }, 1);
}