PowerUp API
This is the same PUAPI guide that ships in the browser at stealth://powerup-guidelines (Settings → Power Ups → View API Guidelines). One .spu file holds the manifest, scripts, icons, and optional UI. PowerUps are not Chrome extensions.
Outline of that same API, fitted to this docs layout:
Quick start
Put manifest.json and main.js in one .spu file.
Settings → Power Ups → Load .spu, then pick the file.
Turn on PowerUp Creator in the AI Assistant and build one there.
Export / send that single .spu file.
manifest.json
{
"id": "com.author.my-powerup",
"name": "My PowerUp",
"version": "1.0.0",
"author": "Your Name",
"description": "What it does",
"permissions": ["tabs", "ui.toolbar", "storage"],
"main": "main.js",
"icon": "icon.png",
"toolbar": { "title": "My PowerUp", "icon": "icon.png" },
"content_scripts": [
{ "matches": ["*://*/*"], "js": ["content.js"], "css": ["content.css"], "run_at": "document_idle" }
],
"settings": {
"title": "My PowerUp",
"ownTab": true,
"schema": [
{ "type": "toggle", "key": "enabledFeature", "label": "Enable feature", "default": true }
]
},
"min_api": 2
}
id must be 3-64 characters: letters, numbers, ., _, -.
Permissions
| tabs | List, create, close, activate tabs. Pin, mute, set tab color. |
| ui.toolbar | Toolbar icons and badges. Multiple buttons via id. |
| ui.notify | Toast notifications. |
| ui.panel | Open a simple panel or page. |
| ui.layering | Chrome overlay z-index helpers. |
| ui.theme | Register Appearance themes shown in Settings → Appearance. |
| ui.settings | Contribute a Settings section or a named PowerUp Settings tab. |
| ui.chrome | Inject CSS into Stealth browser chrome, not web pages. |
| page.inject | Inject CSS/JS into pages. Sandboxed. Honors content_scripts matches. |
| settings.read / settings.write | Non-paid settings only. |
| storage | Per-PowerUp key/value storage. |
| ai.enhance | Register hints for the built-in AI. |
| bookmarks | Add, list, remove bookmarks. |
| clipboard.read | Read clipboard history items the user already captured. |
| net.fetch | HTTP(S) GET/POST/PUT/PATCH/DELETE to a server you host. |
| business | Extend Business via Browse: policy overlay, events, console UI. |
Install is rejected if the pack tries to reach license activation, VPN connect/disconnect, AI API keys, password vault export, native shell, or arbitrary filesystem writes. Paid features stay gated by the browser.
PUAPI object
main.js gets a global PUAPI. Calls are Promise-based except PUAPI.log and PUAPI.meta. main.js runs as an async function body (top-level await is allowed). It is not an ES module: do not use import / export.
| PUAPI.version | 2 |
| PUAPI.meta | { id, name, version, author, permissions } |
| PUAPI.storage | get, set, remove, clear |
| PUAPI.tabs | list, create, close, activate, getActive, pin, mute, setColor |
| PUAPI.ui | addToolbarButton, removeToolbarButton, showNotification, setBadge, openPanel, closePanel, registerTheme, unregisterTheme, listThemes, injectChromeCss, removeChromeCss, portalToBody, punchOverlay, clearOverlay, flushOverlay |
| PUAPI.page | insertCSS, executeScript, executeInAllTabs (page.inject) |
| PUAPI.settings | get, set, registerSection, unregisterSection, getValues, setValues, setValue |
| PUAPI.bookmarks | list, add, remove |
| PUAPI.clipboard | listHistory (clipboard.read) |
| PUAPI.net | fetchText, request |
| PUAPI.business | getState, getPolicy, getActivity, reportEvent, registerRules, unregisterRules, registerConsoleSection, unregisterConsoleSection, fetch |
| PUAPI.ai | registerHint (ai.enhance) |
| PUAPI.events | on / off: toolbar-click, navigate, settings-changed, business-updated, business-warning, business-blocked |
| PUAPI.log | Console helper |
try {
await PUAPI.ui.addToolbarButton({ title: 'Hello' });
PUAPI.events.on('toolbar-click', async () => {
await PUAPI.ui.showNotification('Hello from a Stealth PowerUp');
});
} catch (e) {
PUAPI.log(String(e && e.stack || e));
}
PowerUp Settings tabs
Use a named tab under Power Ups when options should sit next to PowerUp Settings. ownTab: true (default) adds a nav item named title. ownTab: false stacks the section on the shared PowerUp Settings page. Schema values persist in PowerUp storage (__settings). Listen with PUAPI.events.on('settings-changed', ...).
Appearance themes
A PowerUp can ship themes. They appear in Settings → Appearance while the PowerUp is enabled. Declare themes in the manifest (ui.theme) or call PUAPI.ui.registerTheme. Theme CSS should override Stealth CSS variables. base picks the built-in sheet underneath: dark, light, stealth, stealth-glass, stealth-float. Disabling the PowerUp removes its themes.
Cut-corner, purple, panels
| Shape | Use --stealth-cut (12px 2px 2px 2px). Do not use clip-path polygons or pill buttons for chrome UI. |
| Accent | Primary #5a0dd6. Secondary #4900c2. Primary buttons: linear-gradient(135deg, #5a0dd6, #4900c2). Font: Segoe UI. |
| Floating panels | Direct child of document.body. position: fixed. z-index: 2147483647. data-native-overlay="true". Then PUAPI.ui.flushOverlay() or openPanel. |
.spu packaging
A .spu is either a JSON envelope exported by Stealth:
{
"format": "stealth-powerup",
"formatVersion": 1,
"manifest": { },
"files": { "main.js": "...", "icon.png": "data:image/png;base64,..." }
}
or a ZIP archive renamed to .spu with manifest.json at the root. Users send one file. No unpacked folders. No Chrome Web Store packaging.
Business via Browse packs
A company .spu can plug into Business via Browse and talk to the HTTP(S) server they host. It can add blocks, report events, and add console UI. It cannot loosen policy, change the PIN, or unenroll a seat. Permission: business.
AI PowerUp Creator
Enable PowerUp Creator in the AI Assistant. Creator/dev PowerUps quarantine after an unexpected exit or repeated runtime errors. Clear quarantine from Settings → Power Ups.
Minimal example
// manifest.json
{
"id": "com.example.hello",
"name": "Hello Stealth",
"version": "1.0.0",
"permissions": ["ui.toolbar", "ui.notify"],
"main": "main.js",
"toolbar": { "title": "Hello" }
}
// main.js
try {
await PUAPI.ui.addToolbarButton({ title: 'Hello' });
PUAPI.events.on('toolbar-click', async () => {
await PUAPI.ui.showNotification('Hello from a Stealth PowerUp');
});
} catch (e) {
PUAPI.log(String(e && e.stack || e));
}
Related
PowerUps Catalog · Plugins · StealthAI · Business via Browse