CSSreloader

That allows you to reload all the CSS files of any site or local HTML file without you have to reload the page itself. Just press F8.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         CSSreloader
// @namespace    DuKaT
// @version      0.8
// @description  That allows you to reload all the CSS files of any site or local HTML file without you have to reload the page itself. Just press F8.
// @author       DuKaT
// @match        file:///*
// @match        http://*/*
// @match        https://*/*
// @grant        none
// ==/UserScript==

(function () {
	'use strict';

	const eventCode = 'F8';
	// @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
	const keyCode = 119; // F8

	function reload() {
		const hrefSuffix = 'cssreloader=' + Date.now();

		document.querySelectorAll('link[rel="stylesheet"][href]').forEach((linkEl) => {
			const href = linkEl.href.replace(/[?&]cssreloader=\d+$/, '');
			linkEl.href = href + (href.indexOf('?') === -1 ? '?' : '&') + hrefSuffix;
		});
    }

	document.addEventListener('keyup', (evt) => {
		if (evt.code !== undefined) {
			if (evt.code === eventCode) {
				reload();
			}
		} else if (evt.keyCode === keyCode) {
			reload();
        }
	});

})();