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.
- Chrome
When you want to load normal JavaScript scripts as user scripts, and
- You need ES modules.
- You don't need Greasemonkey API.
- You always want user scripts to run as early as possible.
// @name Hello World
// @match <all_urls>
// @world MAIN
import { addStyleSheet } from 'https://esm.sh/[email protected]'
addStyleSheet(`
*:before {
content: 'Hello'
}
*:after {
content: 'World'
}
`)
You need to write the metadata as comments at the beginning of the script, refer to the example for the format.
The name of the user script.
Specifies which pages this user script will be injected into.
See Chrome Extensions match patterns.
You can specify multiple patterns via multiple @match
.
The update URL of the user script. This 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.
The JavaScript world for a user script to execute within. This is optional, the default value is the same as the extension API.