Disable Umami

Disable Umami Analytics to prevent being tracked.

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

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

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              Disable Umami
// @license           MPL-2.0
// @namespace         https://github.com/uiolee/disable-umami
// @homepage          https://github.com/uiolee/disable-umami
// @version           1.0.2
// @description       Disable Umami Analytics to prevent being tracked.
// @description.zh    关闭 Umami 统计以避免被追踪。
// @author            Uiolee
// @match             http://*/*
// @match             https://*/*
// @icon              data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAApVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbGxsAAAAAAAAgICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEAAAAAAAAAAAAAAAAAAAAAAAAVFRUAAAAAAAABAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///94eHj9/f34+PhcXFx7e3vn5+elpaU0NDTGxsbExMSzs7Orq6uAgIDN8jZ/AAAAKHRSTlMA/vtZQfSZh/y5dPzh2o+AfWVUJNK0jW9KFw/88NPQzclwPjo1MSYGsK63cgAAAOJJREFUOMutz1Vyw0AAA1DtmhnCKbNaQ5LS/Y/WegI1rDc/fb/SjEb4X5Pcdxw/n0DpeR7yIJwPOytHskXaK3QYFnssAy2J4FCME5tK9jG/44jFPjclR8iHJn+JOOq2KWTUaK5E1LgCHqn1hJRaKTxqzRBSK4JFLQuCepDnCpfnJkwnlrs3pZ2IHRO/Zm7xqlAEHvZyblWFLxo4uHHLYV66Uxzdi2o4UgkTJz7rfv5NHy02q85KWdFGx0JcbP9mPl2RoMe8ZlB/bIpi814HnJoYMjxJCkFKz4DaepmlSbZco+UH0FBoNslGTk8AAAAASUVORK5CYII=
// @grant             none
// @run-at            document-idle
// @sandbox           DOM
// @noframes

// @source            https://gist.github.com/uiolee/8683b0c8de01e922771ad7f68e911874
// ==/UserScript==

"use strict";
(async () => {
  "use strict";
  const NAME = "DU.js";
  const VERSION = "10";
  const log = (...args) => {
    return console.log(`[${NAME}]:`, ...args);
  };
  log(VERSION);

  const db = {};
  db["umami.disabled"] = 1;

  for (const [key, value] of Object.entries(db)) {
    const currentValue = localStorage.getItem(key);
    if (currentValue === String(value)) {
      const msg = `"${key}" have been set to "${currentValue}"`;
      log(msg);
      return;
    } else {
      const msg = `setting "${key}" to "${value}"`;
      log(msg);
      localStorage.setItem(key, value);
      return;
    }
  }
})().catch((err) => {
  console.error(`[DU.js]: ${err}`);
});