您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
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.
// ==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(); } }); })();