全局Css

美化网页

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript== 
// @name 全局Css
// @description 美化网页
// @run-at document-start
// @author Royli
// @version 1.2    
// @grant unsafeWindow
// @include *
// @match *://*/*
// @namespace 
// ==/UserScript==
(function() {
    function addStyle(rules) {
        var styleElement = document.createElement('style');
        styleElement.type = 'text/css';
        document.getElementsByTagName('head')[0].appendChild(styleElement);
        styleElement.appendChild(document.createTextNode(rules));
    }
    addStyle('* {text-decoration: none!important;}');
    addStyle('a:hover {-webkit-border-radius: 2px;-webkit-box-shadow: 0px 0px 3px #666666;color: #39F !important;text-shadow: -5px 3px 18px #39F;}');
    addStyle('a:visited {color: #666666;}');
    addStyle('a[target="_blank"]:hover {color: red !important;text-shadow: 0px 0px 20px #F90 !important;}');
    addStyle('img {-webkit-transition-duration: .31s;-webkit-transition-property: box-shadow;}');
    addStyle('img:hover {-webkit-transition-duration: .31s;-webkit-transition-property: box-shadow;box-shadow: 0px 0px 4px 4px rgba(130, 190, 10, 0.6);}');
})();