Configuration
supex.json
can be used to declare extension's manifest informations and will be converted into manifest.json
.
$schema
Define json-schema for the Supex configuration.
supex.json
{ "$schema": "https://supex.dev/schemas/config/0.0.1.json" }
name
The name of extension can't be longer than 45 characters.
supex.json
{ "name": "supex" } /* This is a mandatory property. */
version
The version string of an extension is a 1-4 number separated by dots.
supex.json
{ "version": "0.0.1" } /* This is a mandatory property. */
description
A short explaination of the extension and can be up to 132 characters.
supex.json
{ "description": "This extension does nothing." } /* This is a mandatory property. */
author
Name of extension author.
supex.json
{ "author": "Augustin Joseph" }
commands
Define the keyboard shortcuts to trigger certain actions in the extension.
supex.json
{ "commands": { "enable-dark-mode": { "key": "Ctrl+Shift+D", "description": "This enable dark mode for your browser" } } }
app/action.js
browser.commands.onCommand.addListener((command) => { if (command === "enable-dark-mode") { document.body.style.backgroundColor = "#000"; } });
commands.key
The key attribute in command can be either a string or an object with default
, mac
, linux
, windows
and chromeos
attributes.
supex.json
{ "commands": { "enable-dark-mode": { "key": { "mac": "Command+Shift+D", "default": "Ctrl+Shift+D" } } } }
incognito
Decide how the extension should behave in private browsing windows. Possible values are -
spanning
(default): The extension will use single shared proess between private and non-private windows. Messages and events from incognito windows will be sent to that shared process.split
: The extension will use separate proesses for private and non-private windows.not_allowed
: The extension won't be enabled on private windows.
supex.json
{ "incognito": "spanning" }
hosts
List of URL patterns the extension is allowed to interact with. This property will be transformed to host_permissions
in manifest v3 and permissions
in manifest v2.
supex.json
{ "hosts": ["*://supex.dev/*"] }
permissions
permissions.required
An array of permissions
which are required for the extension to work properly.
supex.json
{ "permissions": { "required": ["cookies", "background"] } }
Some permissions are browser specific, e.g. background
is only aviable on chrome
. Supex will filter out the unsupport permissions of a browser during it's build process. So the above config will be transformed into the following manifest on firefox
.
firefox/manifest.json
{ "permissions": ["cookies"] }
permissions.optional
An array of permissions
which aren't necessary for the extension to work.
supex.json
{ "permissions": { "optional": ["alarms"] } }
content-security
This property loosen or tighten the content security policy
of the extension. It is an object with directives as key instead of a string separate directives by ;
.
supex.json
{ "content-security": { "default-src": "'self' cdn.example.com", "script-src": "'self' js.example.com" } }