eBay Dark Mode

A dark mode look for eBay

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        eBay Dark Mode
// @namespace   ebay-dark-mode
// @description A dark mode look for eBay
// @author      DeviousD4n
// @version     0.2
// @license     MIT
// @include     https://*.ebay.*/*
// @match       https://itm.ebaydesc.com/*
// @run-at      document-start
// @grant       none
// ==/UserScript==

const style = document.createElement("style");

if (location.hostname === "itm.ebaydesc.com") {

    style.textContent = `
        img, picture, video, canvas, image,
        *[style*="background-image"] {
            filter: invert(1) hue-rotate(180deg) saturate(1.12) contrast(1.05) !important;
        }
    `;
} else {

    style.textContent = `
        html {
            filter: invert(1) hue-rotate(180deg) saturate(1.12) contrast(1.05) !important;
        }

        img, picture, video, canvas, image, .gh-logo {
            filter: invert(1) hue-rotate(180deg) !important;
        }

        html, body,
        .srp-river,
        #mainContent {
            background-color: rgb(235,235,235) !important;
        }

        .vim,
        .ux-navigator__container,
        .seo-interlink {
            background: transparent !important;
        }
    `;
}

document.documentElement.appendChild(style);