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.

Ekde 2018/04/20. Vidu La ĝisdata versio.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         CSSreloader
// @namespace    DuKaT
// @version      0.5
// @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
// @include      file:///*
// @include      http://*/*
// @include      https://*/*
// @grant        none
// ==/UserScript==

(function() {
	'use strict';

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

	var CSSReloader = function() {

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

			[].forEach.call(document.querySelectorAll('link[rel="stylesheet"][href]'), function(element) {
				var href = element.href.replace(/[\?\&]cssreloader=\d+$/, '');
				element.href = href + (href.indexOf('?') === -1 ? '?' : '&') + reloader;
			});
		}

		return { reload };

	}();

	document.addEventListener('keyup', (e) => {
		if (e.keyCode === reloadKeyCode) {
			CSSReloader.reload();
		}
	});

})();