您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevent white flash before DuckDuckGo dark theme is applied
// ==UserScript== // @name DuckDuckGo Anti-White Flash Fix // @namespace https://github.com/violentmonkey/violentmonkey // @version 1.1 // @description Prevent white flash before DuckDuckGo dark theme is applied // @author github:Torsteinvin - Edited by ChatGPT // @match *://*.duckduckgo.com/* // @run-at document-start // @grant none // @license GPL-3.0 // ==/UserScript== /* original idea came from: https://github.com/TorsteinVin/Duckduckgo-white-flash-fix/blob/main/duckduckgo-torsteinvin-white-flash-fix.css */ (function () { 'use strict'; const css = ` /* Set a dark default background for html and body */ html, body { background-color: #161616 !important; color-scheme: dark; } /* Respect user color scheme */ @media (prefers-color-scheme: light) { html, body { background-color: #ffffff !important; color-scheme: light; } } `; const style = document.createElement('style'); style.textContent = css; document.documentElement.appendChild(style); })();