Overview & Architecture
Aero Client is an Electron (Chromium) app around kirka.io. Before any page JavaScript runs, the client injects a single initialization script into the game page's own JavaScript world. That script:
- Creates the global
window.__AERO__object (settings, helpers, UI toolkit, script-settings registry). - Sets up SPA navigation detection, the client's keyboard shortcuts, raw mouse input, and Alt+F4.
- Defines the
Menuclass (the in-game client menu) and the game preload logic.
The rest runs natively in the client, outside the page: the resource swapper, links that try to open a new window (sent to your browser unless they're game links), the screenshot hotkey, Discord activity, and updates.
Userscripts are not part of this init script. They are loaded separately at runtime: the
game preload asks the client for the scripts, then evals the ones that are enabled.
Enabling or disabling a script does not require rebuilding or restarting the client.
Two kinds of scripts
- Imported scripts —
.jsfiles the user drops into a folder on their computer. - Bundled "Base" scripts — scripts shipped inside the client. They always appear and cannot be deleted by the user.
Both kinds behave identically at runtime and use the same APIs.
Folder Layout
All user data lives under the OS Documents directory:
Documents/AeroClient/
├─ settings.json # client settings (source of window.__AERO__.settings)
├─ scripts/ # imported userscripts (.js) — one file = one script
├─ CSS/ # custom game stylesheets (.css), managed by the CSS tab
└─ swapper/assets/ # resource-swapper replacement files
The scripts and CSS folders are created automatically the first time the menu
loads. The client menu has buttons to open each folder: Open Swapper Folder and
Open Scripts Folder under Settings → Client, and Open Folder
on the CSS tab.
swapper/assets/ replaces the game asset at the same path — e.g.
swapper/assets/img/foo.png replaces https://kirka.io/assets/img/foo.png. The
folder is read when the client starts, so restart after adding or changing files.
Installing a Script
- Open the client menu (Right Shift by default) and click Open Scripts Folder under Settings → Client (or browse to
Documents/AeroClient/scripts/). - Drop your
.jsfile in. One file is one script. - Reload the page (F5 by default) — the menu reads the folder when the page loads.
- On the Mods tab, the script appears as a card with a New badge. Flip its switch on — it runs immediately, no refresh needed.
File Format & Metadata Header
A script is a plain .js file. The loader reads an optional metadata header from the
first 15 lines. Each line must start exactly with // @tag — two slashes,
one space, then the tag:
// @name <text>— display label on the Mods card. If omitted, the filename without.jsis used.// @category <text>— grouping label, shown on the card. If omitted, defaults toImported. Only the valueHUDis special-cased by the menu filters.// @author <text>— shown on the card as "by <author>". If omitted, the author shows asunknown.
Other common userscript headers (// @version,
// @description, // @match, // @run-at) are ignored
by the loader — they're conventional/cosmetic only. The client decides when and where scripts run, not
the @match/@run-at directives. A // ==UserScript== …
// ==/UserScript== block is conventional but not required.
.js extension and exact
spacing/casing (e.g. Custom Skin Link.js) — is the stable identifier used everywhere: in the
enabled/favorite/seen lists, and as the key for registering a settings panel.
Lifecycle, Timing & Execution Context
- When: scripts run after
DOMContentLoadedin the game window, once the client has fetched the live settings.window.__AERO__is already fully available. - How often: once per full page load. kirka.io's in-app navigation (lobby → game → profile…) does not re-run scripts — listen for
aero-url-changeinstead. - How: each enabled script's source runs via indirect
evalin the global scope. Wrap your script in an IIFE.'use strict'is fine. - Which: only scripts whose filename is in the
enabled_scriptssetting are executed. Disabled scripts never run. - Live enable: switching a script ON runs it immediately (no refresh) by dispatching an event carrying the script's source.
- Live disable caveat: switching OFF only removes it from the enabled list — code that already ran stays active until refresh (F5). Scripts needing clean teardown should no-op when disabled or instruct the user to refresh.
- Host allowlist: the preload only initializes on
kirka.io,snipers.io,ask101math.com,fpsiogame.com,cloudconverts.com. - Error isolation: an exception while running a script is caught and logged to the console as
[Aero] Error in user script <filename>; it won't crash the client.
DOMContentLoaded listeners. Because scripts run after that event, listeners
attached to it never fire. kirka.io is a Vue SPA, so most in-game elements appear later — use a
MutationObserver or polling to wait for the game DOM.
Your First Script
Wrap everything in an IIFE and wait for the SPA DOM with a MutationObserver instead of
DOMContentLoaded:
// @name My First Script
// @category HUD
// @author you
(function () {
'use strict';
// Scripts run after DOMContentLoaded — game DOM may not exist yet.
const obs = new MutationObserver(() => {
const hud = document.querySelector('#app .game-hud');
if (!hud) return;
obs.disconnect();
// build your feature here
const tag = document.createElement('div');
tag.textContent = 'Hello from Aero';
hud.appendChild(tag);
});
obs.observe(document.body, { childList: true, subtree: true });
})();
Base vs Imported Scripts & Precedence
The client returns a combined list: bundled built-ins first, then imported folder scripts.
- Precedence: if a folder file has the same filename as a bundled built-in, the folder file is skipped — the shipped version always wins. Users can't shadow a base feature by dropping a same-named file.
- Built-ins are flagged
builtin: true, show a small Base badge, and appear under the Base filter. Imported scripts appear under Imported.
Currently shipped base scripts
Custom Skin Link.js— replace the player skin with your own image link.CustomServerPreset.js— build, save and apply custom room-creation presets.gun_scale_modifier.js— per-weapon gun size and X/Y/Z position, with keybinds to scale in-game.no_weapon_bob.js— removes the walk/idle bob from the held gun.no_reload_animation.js— holds the gun still while reload/draw animations play.
The last three adjust the held gun in a fixed order, so all three can be enabled together.
Per-script entry the menu receives
name— the filename (stable key).label— display name (from@nameor filename).content— the script source.category— from@categoryorImported.author— from@authororunknown.builtin—truefor shipped base scripts,falsefor folder scripts.
The window.__AERO__ Global
Properties and methods available to every script:
settings— live object of the client's current settings. Read it for client state (e.g.base_url,menu_keybind,menu_theme, feature toggles); the menu updates it in place as the user changes settings.version— the client version string.logos—{ mark, wordmark }: the Aero logos as PNG data URIs (the menu is injected into a remote page, so local asset paths can't be used).menuHTML,menuCSS— raw markup/styles for the client menu (used internally).invoke(command, args)— runs a client command and returns a Promise. See Client Commands.listen(event, callback)— subscribes to an event pushed by the client (e.g.notification); returns a function that unsubscribes.scriptSettings— internal registry mapping a script filename to its settings-panel builder.registerScriptSettings(name, builder)— register a settings panel for a script.ui— the UI toolkit for building native-looking settings panels.
Adding a Settings Panel
A script can add a settings panel that opens from the Settings button on its Mods card.
Call window.__AERO__.registerScriptSettings(name, builder):
name— must exactly equal the script's filename, including.jsand any spaces/casing (e.g.gun_scale_modifier.js). This is how the menu matches a panel to a card.builder— a function called asbuilder(panel, ui)each time the user opens the panel.
Always guard the call so the script also works outside the client:
(function () {
const KEY = 'myscript_glow';
function build(panel, ui) {
ui.note(panel, 'Configure My First Script.');
ui.toggle(
panel,
'Enable glow',
localStorage.getItem(KEY) === '1',
(on) => localStorage.setItem(KEY, on ? '1' : '0'),
'Adds a glow to the HUD.'
);
ui.slider(panel, 'Glow strength', localStorage.getItem('myscript_strength') || 50,
(v) => localStorage.setItem('myscript_strength', v),
{ min: 0, max: 100, unit: '%' });
}
if (window.__AERO__ && window.__AERO__.registerScriptSettings) {
window.__AERO__.registerScriptSettings('My First Script.js', build);
}
})();
How the settings view behaves
- The settings view opens in place inside the Mods tab (with a back arrow), not as a popup.
panelis that view's body; it is cleared before each open, andbuilderruns fresh every time. Don't cache DOM nodes across opens.- Each row you add shows as its own bordered card, in the menu's current theme.
uiis the same object aswindow.__AERO__.ui.- If the script is currently disabled, the menu shows "Enable this script to configure it." instead of calling your builder.
- If a script has no registered panel, the menu explains how to edit the file and offers an Open Scripts Folder button.
- If your builder throws, the menu shows "This script's settings failed to load." and logs the error.
Scripts persist their own state in localStorage — the UI toolkit does not auto-persist; your
onChange callbacks decide what to store.
The ui Toolkit
All builders append to a parent element and return the created control (or a small object). Styling
comes from the client's menu CSS, so panels match the menu and follow its Dark / Light / Graphite theme.
Call them as methods (ui.toggle(…)) — they use this internally, so don't
destructure them.
el(tag, props)—document.createElement(tag)withpropsassigned onto it (e.g.{ className: 'btn-outline', textContent: 'Go' }). Returns the element.note(parent, text)— appends a small muted paragraph. Returns the<p>.row(parent, label, control, sub)— a standard setting row: a label (with optionalsubdescription) on the left andcontrolon the right. Returns the row. The other builders use it; use it directly for custom controls. (Insert your own element before the row's.setting-infoto add e.g. an icon/thumbnail on the left.)toggle(parent, label, checked, onChange, sub)— an on/off switch row.onChange(newChecked). Returns the checkbox input.text(parent, label, value, onChange, opts)— a text input row.onChange(value)fires when the user commits the value (blur or Enter), not on every keystroke.opts:type(defaulttext),placeholder,sub,image: true(adds a live image preview for URL/base64 fields). Returns the input.imagePreview(url)— returns{ wrap, set(url) }:wrapis the preview element to insert;set('')clears it; empty/broken images show "No image"/"Invalid image".slider(parent, label, value, onChange, opts)— a range slider row with the current value shown beside it.onChange(value)fires continuously while dragging (the value is a string).opts:min,max,step,sub,unit(appended to the shown value, e.g.'%'). Returns the input.select(parent, label, options, value, onChange, sub)— a dropdown.optionsis an array of strings, or[value, label]pairs. Returns the select.button(parent, label, onClick)— an outline button sized to its label. Returns the button.keybind(parent, label, value, onChange, sub)— a "press a key" capture button. Capturesevent.key(e.g.a,Space,ArrowUp) — different from the client's own hotkeys, which storeevent.code. Returns the button.
Most helpers return the underlying control element so you can further tweak styles/attributes after creation.
Persisting Data & Events
Persisting script state
- Scripts manage their own persistence with
localStorage— the UI toolkit saves nothing automatically. - Namespace your keys with a script-specific prefix to avoid collisions (e.g.
csl_…,gsc_…,nra_…,kirka_room_presets). localStoragepersists across sessions and refreshes.
Client settings
- Read client settings via
window.__AERO__.settings. - Change a client setting with
invoke('update_setting', { key, value })(for client settings — most scripts just uselocalStoragefor their own state). This saves to disk only: it doesn't updatewindow.__AERO__.settingsor fireaero-settings-changed, so do both yourself if the change should apply right away.
Events
Dispatched on document:
aero-settings-changed— a client setting changed;detailis{ setting, value }.aero-run-script— a script was enabled live;detailis{ name, content }.aero-css-folder-changed— the enabled Custom CSS changed;detail.contentis the combined CSS of every enabled file (empty when none).
Dispatched on window:
aero-url-change— SPA navigation;detailis{ url }. React to entering lobby/game/servers/profile/market/friends.
window.addEventListener('aero-url-change', (e) => {
if (e.detail.url.includes('/profile')) {
// re-apply your feature for this view
}
});
Scripts may also define and dispatch their own CustomEvents to coordinate between a settings panel and an in-page panel.
Client Commands (invoke)
Call via window.__AERO__.invoke(command, args) → Promise. Commands are only accepted from the
client's own game window, on the allowed game hosts.
- Settings:
get_settings,update_setting({ key, value }— unknown keys are ignored, and a value of the wrong type is rejected),reset_settings(resets everything and restarts the client). - Scripts/CSS:
get_scripts,open_scripts_folder,get_css_files,open_css_folder,import_css({ name, content }— never overwrites; returns the saved filename),delete_css({ name }— moves the file to the Recycle Bin / Trash). - Swapper:
open_swapper_folder. - Window/app:
get_version,toggle_devtools,toggle_fullscreen,navigate({ url }),close_app,restart_app,launch_game,check_for_updates. - Clipboard:
get_clipboard_text,set_clipboard_text({ text }). - System:
open_external({ url }—http,httpsandmailtolinks only),set_autostart({ enable }),update_rpc_state({ url }). - Importing from other clients:
list_import_sources,import_client({ id }).
const settings = await window.__AERO__.invoke('get_settings');
window.__AERO__.invoke('update_setting', {
key: 'menu_keybind',
value: 'KeyP'
});
Most scripts only ever need update_setting/get_settings (and rarely open_scripts_folder). Everything else is used by the client's own menu.
CSS Classes & Variables
The menu's styles are scoped to elements inside an .aero root — the menu itself, its dialogs,
and your settings panel. Use these classes so your UI matches the client:
- Layout/rows:
setting-row,setting-row.col(stacked),setting-info,setting-label,setting-desc,apply-badge(small tag beside a label). - Controls:
switch(a<label class="switch">holding a checkbox and a<span class="switch-track">),text-input,range(inside arange-wrapwith an<output>),select,keybind. - Buttons:
btn-outline(andbtn-outline.danger),btn-icon,btn-ghost(.activefor the selected pill). - Image fields:
config-image-row,image-preview,image-preview-empty. - Cards:
css-card,css-card-header,css-actions.
Color custom properties are full colors — use them directly, e.g. color: var(--muted):
--text— primary text.--muted— secondary text.--bg— menu background.--panel— row/card background.--field— input/control background.--line— borders.--accent,--on-accent— selected/"on" background and the text on it.--danger— destructive actions.
The values follow the Client Theme (dark, light or graphite, from
settings.menu_theme). To give a panel of your own outside the menu the same look, put it in
an element with class="aero" and data-theme set to the theme.
text-input is 220px wide by default — set flex: 1 to fill a
row. btn-outline sizes to its label. For a compact multi-select, style small toggle "chips"
with var(--field)/var(--muted) for off and
var(--accent)/var(--on-accent) for on.
Gotchas & Best Practices
- Filename = identity. The name passed to
registerScriptSettingsmust exactly match the filename (with.js, spaces, and case). - New files need a reload. The menu reads the scripts and CSS folders when the page loads.
- No
DOMContentLoaded. Scripts run after it. Set up immediately and use observers/intervals for late-loading SPA DOM. - Wrap in an IIFE. Scripts share global scope; avoid leaking globals and name collisions.
- The settings builder re-runs and the panel is wiped each open. Rebuild your UI every call; don't hold references between opens.
- Don't throw in the builder — it's caught, but your panel won't render.
- Disabling doesn't tear down. If your script patches globals or adds observers, guard behavior behind a live
localStorage/setting check, or tell users to refresh after disabling. - Persist with
localStorage, namespaced per script. update_settingonly saves. Updatewindow.__AERO__.settingsand dispatchaero-settings-changedyourself if the change should apply now.- Keybind capture uses
event.key, notevent.code. - Built-ins win over same-named folder files.
- Categories: only
HUDis special in filters; pick it if your script is a HUD feature.
Updating Older Scripts
Scripts that only use the ui toolkit need no changes. Scripts that build their own elements
with the menu's old class names or color variables should switch to the current ones:
setting→setting-row·setting.column→setting-row col·setting-header→setting-label·setting-sub→setting-desccheckbox→switch·change-keybind→keybind·aero-button→btn-outlinergba(var(--light), 1)→var(--text)·--lgray→var(--muted)·--dgray→var(--field)·--border→var(--line)--cyan/--en-bg→var(--accent)·--en-text→var(--on-accent)·--close-bg→var(--danger)window.__AERO__.logo→window.__AERO__.logos.mark
Bundling a Base Script (maintainers)
For maintainers shipping a script with the client rather than as a user import:
- Place the
.jsfile in the client'ssrc/scripts/folder. - Add its exact filename to the
BUILTIN_SCRIPTSlist insrc/main/commands.js. The list order is the run order. - It ships with the next build. It will then always appear under the Base filter, take precedence over any same-named folder file, and behave exactly like an imported script otherwise.
