Skill references: setup and errors
Electron, setup, when something fails.
Electron apps
navigera -s app start --electron ./my-app # app directory or main script (Electron from its node_modules), a packaged app's executable, or a .app bundle
navigera -s app ax # the window it opened first, read like a page
navigera -s app tab-list # each window is a tab (a <webview> too, "webview": true); one the app opens after an action becomes the active tab
navigera -s app eval --main "({ app }) => app.getName()" # the app's main process (a function gets the electron module)
navigera -s app quit # ends the app
--electron-arg <arg> (repeatable) passes arguments to the app. Every other
command works as on a page. tab-new, reset, show and hide don’t: the
app owns its windows and storage. start waits for a window the app shows to
have content and says electron: {version, main_process}; an app that is
still starting may need wait --text <word> before ax. On a Linux server,
run the whole session inside one xvfb-run (one per command kills the app).
An app already running with --remote-debugging-port=9222: start --attach 9222 drives its windows the same way; quit leaves it running.
Setup details
Windows (PowerShell): irm https://raw.githubusercontent.com/andrey-usa/navigera/master/install.ps1 | iex;
single-quote JavaScript that contains $ there. JavaScript with quotes,
backslashes or regex survives no shell’s quoting reliably: save it to a file
and run eval --file extract.js (or pipe it to eval -). Chrome is found on
its own (a system install, or the chrome-headless-shell navigera install-browser downloads from Google); else pass start --chromium <path>
or set $CHROME_BIN.
When something fails
| error | do this |
|---|---|
no element matches selector … / no element with text … | ax to see what is really there; act by ref |
no element has that ref now | take a fresh ax |
timed out … waiting for load | a slow resource: goto <url> --wait domcontentloaded, then wait --text … |
select: element is … not a <select> | click the dropdown, ax, then click the option by ref |
no navigera session at … | navigera -s <name> start; the error says why the last one stopped |
text you expect is missing from ax | collapsed, or further down: expand it or scroll, then ax again |
Output and notes
- Output: compact, as above; errors go to stderr as
error: …with exit code 1, notes asnote: …(a dialog answered, a new tab, an exception the page threw: read them).--output jsonprints one JSON line per command,{"ok":true,"result":…}or{"ok":false,"error":"…"}, actions with{tab, tabs, url, title}, for programs.
Made from skills/navigera/references/electron.md, skills/navigera/references/setup.md, skills/navigera/references/troubleshooting.md.