您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Setting a default dark theme color for Safari.
// ==UserScript== // @name Safari Default Dark Theme Color // @namespace https://gist.github.com/10tion // @version 0.2 // @description Setting a default dark theme color for Safari. // @author 10tion // @match *://*/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; var _DEFAULT_THEME_COLOR = "#1e2327"; // Flip this to true if you want to forcibly override theme color for all websites. var _FORCE_OVERRIDE = false; var _head = document.getElementsByTagName('head')[0]; for (var _h = 0; _h < _head.childNodes.length; _h++) { if (_head.childNodes[_h].name === "theme-color") { if (_FORCE_OVERRIDE) { var _cur_theme = _head.childNodes[_h]; _cur_theme.parentNode.removeChild(_cur_theme); break; } else { return; } } } var meta = document.createElement('meta'); meta.name = "theme-color"; meta.content = _DEFAULT_THEME_COLOR; _head.appendChild(meta); })();