Default CSS

enable custom CSS if and only if page does not define any styles in <head>

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Default CSS
// @version      2023-12-23
// @license      WTFPL
// @description  enable custom CSS if and only if page does not define any styles in <head>
// @author       https://matrix.to/#/@belkka:private.coffee
// @match        *://*/*
// @grant        none
// @namespace https://greasyfork.org/users/922438
// ==/UserScript==

// Note: this userscript uses CSS from https://github.com/susam/spcss/ project. Since you are already reading this,
// feel free to replace "https://unpkg.com/spcss" with style sheet of your choice
// or even use <style> instead of <link> to embed CSS directly

(function() {
    'use strict';
    const head = document.getElementsByTagName('head')[0];
    if(head.querySelector('style:not(:empty), link[rel~=stylesheet]') === null) {
        head.insertAdjacentHTML('beforeend', '<link rel="stylesheet" href="https://unpkg.com/spcss" />');
    }
})();