BlackGlory / eternity

🌲 A minimalist JavaScript user script loader and manager for modern browsers.
MIT License
16 stars 3 forks source link
chrome-extension esm manifest-v3 typescript unpublished

Eternity

eternity-logo

A minimalist JavaScript user script loader and manager for modern browsers.

In order to use this extension, you need Chrome 120 or above, and developer mode enabled.

Supported browsers and platforms

When do you need this?

When you want to load normal JavaScript scripts as user scripts, and

Example

// @name Hello World
// @match <all_urls>
import { addStyleSheet } from 'https://esm.sh/userstyle@0.2.1'

addStyleSheet(`
  *:before {
    content: 'Hello'
  }

  *:after {
    content: 'World'
  }
`)

Metadata

You need to write the metadata as comments at the beginning of the script, refer to the example for the format.

@name

The name of the user script.

@match

Specifies which pages this user script will be injected into.

See Chrome Extensions match patterns.

You can specify multiple patterns via multiple @match.

@update-url

The update URL of the user script. It is optional, Eternity accesses the URL to keep the user script up to date.

You can specify multiple update URLs via multiple @update-url. Eternity will check them one by one in order until a usable user script is found.