Domain‑specific CSS Injector

Inject custom CSS per domain – works on iOS, iPadOS and desktop browsers.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

Autor
Nick Bakaka
Dziennych instalacji
0
Wszystkich instalacji
7
Oceny
0 0 0
Wersja
1.0
Utworzono
05-01-2026
Zaktualizowano
05-01-2026
Rozmiar
2,68 KB
Licencja
CC-ND-NA
Dotyczy

This script allows injection of CSS on a per‑domain basis and works on iOS/iPadOS Safari (via the native userscript support in Safari 15+), Chrome, Firefox, and all other browsers that support Userscripts.

How it works

@match *://*/*

The script runs on every page, giving you full control over which hosts receive CSS.

Domain‑specific configuration

hostRegex: A regular expression that tests the current hostname (window.location.hostname). css: Plain CSS rules to be injected. Separate rules with newlines; you can use any valid CSS, including media queries and !important. Injection

The helper injectCss creates a style element and appends it to the document head (or the root element if head is missing).

This works in all browsers that support Userscripts, including iOS Safari.

Customising

To add a new domain, insert another object into domainCssMap.

Example:

{
    hostRegex: /^shop\.example\.com$/i,
    css: `
        .product-grid { grid-template-columns: repeat(3,1fr) !important; }
    `
}

If you want a rule to apply to all sites, add an entry with a regex that always matches, e.g. /^.*$/.

Notes for iOS/iPadOS

Safari on iOS 15+ supports Userscripts via the built‑in script editor (Settings → Safari → Extensions).

After installing this script in the extension, it will run automatically on every page you visit.