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 F9.

2018/03/27のページです。最新版はこちら

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         CSSreloader
// @namespace    DuKaT
// @version      0.4
// @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 F9.
// @author       DuKaT
// @include      file:///*
// @include      http://*/*
// @include      https://*/*
// @grant        none
// ==/UserScript==

(function() {
	'use strict';

	const reloadKeyCode = 120; // F9

	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();
		}
	});

})();