# Screen scripting API

> The system.* functions that screen scripts and Run script actions use - tags, navigation and popups, alarms, the shift log (Enterprise), user, local and server files, print and export, clipboard, notifications, timers - with the server check and the audit of each, and the popup, dock and navigation actions of screen objects.

Product: eaxScada · Type: Reference · Editions: Starter, Pro, Enterprise
Source: https://eaxware.com/docs/eaxscada/reference/screen-scripting-api/
Verified against commit abe2638.

Screen scripts get one object, `system`. A display's or a popup's startup script and a **Run script** action receive it as `system`, and nothing else of the page: they run in a [sandbox](#the-sandbox). In the code editor, `Ctrl+Space` after `system.` lists every function with a short description.

`system.version` is `1`. Later versions only add functions.

## Principles

- **The server is the security boundary.** Every function that reads or changes plant data calls a server API. That API checks the session, the role, the area, the write policy (confirmation, e-signature, write range) and the high-availability role, and it writes the audit record. The browser functions add the dialogs.
- **One write path.** A tag write from a script goes through the same guarded write as a button on a screen: the confirmation or e-signature dialog when the server asks for one. There is no other way for a script to write a tag.
- **No program execution.** There is no function that runs a program or a shell command, on the operator's computer or on the server.
- **Files.** Local files only through the browser's own open and save dialogs, after the operator's press. Server files only inside the [named roots](../server-files/) an administrator configures.
- **The sandbox is the script's boundary.** A script runs without access to the operator's page, session or network. Only the functions on this page are reachable, each call checked before the page runs it under the operator's session. See [The sandbox](#the-sandbox).
- **Promises.** Every function that reaches the page returns a Promise, `system.nav.current()` and `system.popup.list()` included: use `await`. Immediate (no Promise): `system.util.*`, `system.params.*`, `system.timer.*` and `system.tag.subscribe`. A refusal rejects with an `EaxError` that has `code`, `message` and `detail`. The codes are `denied`, `not_found`, `invalid`, `cancelled`, `refused_policy`, `out_of_range`, `signature_required`, `unavailable`, `offline`, `busy`, `no_gesture` and `rate_limited` (the refusals of `system.shiftlog.add`), `sandbox_refused` (the script reached for the page) and `timeout` (the script was stopped). `system.tag.write` keeps its first contract: it resolves `true` or `false`.
- **Cleanup.** Timers and tag subscriptions that a script starts end when its page or popup closes.
- **Errors are reported.** A script that throws shows a message to the operator and is recorded on the server as a `script_error` [client event](#client-events). A refused or stopped script marks its object instead (`script_refused`, `script_timeout`).

## The sandbox

Every screen script runs in a frame of its own, without access to the page that shows it (no cookies, no storage, no network), and inside it in a worker. One sandbox per screen and per popup, made when its first script runs and closed with the screen or popup.

**Diagram: What a screen script can reach** (system architecture)

A screen script runs in a worker inside a sandboxed frame of the operator's page: it has no network, no page and no session. Its only way out is a system call, which the page checks before its own scripting API runs it as the operator. A tag write then goes to the eaxScada server, which checks it as any write and asks for a confirmation or a signature when the tag needs one.

**Parts**

- **Operator's page** (trust boundary)
- **Script frame** (trust boundary)
- **Worker** (service or process, inside Script frame): runs the script
- **Page checks** (check or decision, inside Operator's page): source frame, token, type, call id, allow-list, kinds, sizes, 64 waiting calls
- **Scripting API** (service or process, inside Operator's page): the page's system.\*, as the operator
- **eaxScada server** (product): permission, policy, limits, interlocks, then record first
- **Equipment** (device or controller)

**Connections**

- **Worker → Page checks** (data or telemetry): system.\* call. The only way out of the frame is a call message to the page.
- **Page checks → Worker** (refusal): refused. A call from another frame, with a wrong token, of an unknown type or with a bad id is dropped. A function not on the allow-list, wrong arguments, markup or too much data answers "invalid"; more than 64 waiting calls answers "unavailable". A sandbox silent for 5 seconds is stopped.
- **Page checks → Scripting API** (next step): admitted
- **Scripting API → eaxScada server** (command to equipment): POST /api/tags/write. The script sends the path, the value and a reason only; it cannot send a confirmation or a signature. After the operator confirms or signs, the write is sent again.
- **eaxScada server → Scripting API** (refusal): refused, or: confirm or sign first. A write refused by the permission, the limits, the range or an interlock is refused before any dialog. A tag that needs a confirmation or a signature is answered so, and only then does the page ask the operator.
- **eaxScada server → Equipment** (command to equipment): written after the record. The server records the write in the audit trail first; a write it cannot record is refused.
- **Worker → Equipment** (command to equipment, not active): no network, no page. The frame has no network and the page's objects throw in the worker: a script cannot write past the page's checks.

Legacy screen scripts run in the page itself: off unless an Administrator turns them on for the project, with a reason, journaled first.

The sandbox removes the way around the server; it replaces none of the server's checks.

| | |
|---|---|
| **The script** | the body of an `async` function: `await` works at the top level. `this` is `undefined`. |
| **Names it has** | `system`, `system.version` (`1`), `system.sandboxed` (`true`), and the language's own objects: `Math`, `JSON`, `Date`, `Number`, `String`, `Array`, `Object`, `Promise`, `Map`, `Set`, `RegExp`, `Intl`, the errors, `setTimeout`, `setInterval` and their clear functions, `console` (the browser console only), `URL`, `TextEncoder`, `Blob`, typed arrays... |
| **Names it does not have** | `player`, `window`, `document`, `parent`, `top`, `location`, `history`, `navigator`, `localStorage`, `sessionStorage`, `indexedDB`, `fetch`, `XMLHttpRequest`, `WebSocket`, `EventSource`, `alert`, `confirm`, `prompt`, `open` and the page's own objects (`runtimePlayer`, `scadaPopup`, `eaxGuardedTagWrite`...): using one fails the script with `sandbox_refused`. |
| **Functions** | only those of this page (an allow-list): tags, alarms, user, navigation and popups, notifications and dialogs, logging, clipboard, print and export, local and server files, timers, parameters, formatting. |
| **Time** | a script that keeps its sandbox busy for 5 seconds (no pause, for example an endless loop) is stopped (`timeout`): the sandbox is closed with every script, timer and subscription in it, the screen stays usable, and the next script gets a new sandbox. Waiting on `await` (for example for the operator to answer a dialog) does not count. |
| **Legacy** | a project whose Administrator turned on **Legacy screen scripts** runs its scripts in the page as before (`system` and `player`). Off by default. See [Migrate screen scripts to the sandbox](/docs/eaxscada/how-to/migrate-screen-scripts-to-the-sandbox/#4-stop-gap-legacy-screen-scripts-for-one-project). |

The [Problems panel](/docs/eaxscada/how-to/check-screens-before-deploy/) lists scripts that use names a sandboxed script does not have (`script-not-sandboxed`, `startup-script-not-sandboxed`).

### Limits of a call

Each call from a script is checked by the page before it runs; a call that fails a check is refused with code `invalid`.

- **Plain data only**: numbers, booleans, strings, arrays and plain objects, at most 10 levels deep and 2000 members, no `__proto__`, `constructor` or `prototype` keys. A function only as the callback of `system.timer.every` / `after` and `system.tag.subscribe`.
- **No markup in texts the page uses**: a tag path, a screen or popup name, a dock edge, a text value or an object's strings may not hold `<`, `>`, `"` or a backtick. The texts of dialogs, toasts, desktop notifications and log lines are shown escaped, as text. The content of a file a script saves, exports or copies is not checked.
- **Size**: at most 16 KB of arguments per call; 64 KB for `system.tag.readMany`; 1 MB for `system.clipboard.copyText`; 10 MB for a file (`system.file.saveAs`, `readText`, `system.file.server.write`, `upload`, `system.export.csv`).
- **At most 64 calls** of one sandbox waiting at a time.

## Tags

| Function | Server check | Audit |
|---|---|---|
| `system.tag.read(path)` resolves `{path, value, quality, quality_name, ts, good}` | Read right on the tag. An unknown tag and a tag you may not read both reject with `not_found`. | - |
| `system.tag.readMany([paths])` resolves `{path: value or null}` | Same; at most 1000 paths | - |
| `system.tag.subscribe(path, callback)` returns `unsubscribe()` | Same. The callback runs now when a value is known, then on every new value. | - |
| `system.tag.write(path, value, {reason})` resolves `true` or `false` | Write permission, area, write policy (confirmation, e-signature, write range) and the active node. The dialogs open when the server asks. | Server audit of the write |

A tag path in these functions cannot hold a wildcard (`* # + >`) or a `{Param}`.

The page receives only the values of the tags its views show ([How live values reach screens](/docs/eaxscada/explanation/live-values/)). `system.tag.read` and `readMany` of a tag no view shows subscribe it for the call: the answer waits for the server's snapshot, and the tag stays subscribed for 30 seconds. `system.tag.subscribe` holds its tag until `unsubscribe()` or the end of the script, and its callback receives the snapshot as its first value.

## Navigation and popups

| Function | What it does |
|---|---|
| `system.nav.navigate(target, params?, {set}?)` | Opens a page (`/line-2`) or a screen, with one of its [parameter sets](/docs/eaxscada/reference/screen-parameters/) (`{set: 'P-101'}`) and / or values. A full address is opened only when it is one of this server's pages; a `javascript:` or `data:` address or another site is not opened (use `system.nav.openWindow`). |
| `system.nav.back()`, `system.nav.forward()` | The previous or next page of this runtime's history. |
| `system.nav.home()` | The home screen of your role (see [Home screen per role](#home-screen-per-role)), else the startup page. |
| `system.nav.current()` | resolves `{page, screen, title, params, popups, canGoBack, canGoForward}` |
| `system.nav.openPopup(screen, options)` | Opens a screen as a popup and resolves its id. See the options below. |
| `system.nav.closePopup(id?)` | Closes that popup, or the topmost. |
| `system.nav.closeAllPopups()` | Closes every popup. |
| `system.nav.openDock(edge, screen?)`, `closeDock(edge)`, `toggleDock(edge)` | Opens, closes or toggles the dock on `top`, `bottom`, `left` or `right`. A dock stays open or closed across pages until it is changed again. |
| `system.nav.swapInner(containerId, screen, {set} or {params}?)` | Shows a screen inside a container (an inner screen), optionally with one of its parameter sets or with values. See [Inner screens](#inner-screens). |
| `system.nav.loadInnerDisplay(screen, containerId?, {set, params}?)` | The same, screen first. Without a container: the page's one inner container. |
| `system.nav.openWindow(target, {name, left, top, width, height})` | Opens a browser window. Runtime pages of this server are always allowed. An external `https://` address only when it starts with one of the project's allowed external addresses. Browsers treat the position as a hint. |

`system.popup.open`, `close`, `closeAll` and `list()` are the same as the popup functions above.

### Popup options

| Option | Default | |
|---|---|---|
| `set` | none | One of the popup screen's [parameter sets](/docs/eaxscada/reference/screen-parameters/) by name (`'P-101'`). |
| `params` | none | `{Name: value}`, beside the set (they win). `{Name}` in the popup screen's tag paths, expressions and texts is replaced by the value. |
| `modal` | the screen's **Modal dim backdrop** setting | `true`: a backdrop blocks the page until the popup closes. |
| `position` | `'center'` | `'center'`, `'object'` (next to the object pressed) or `{x, y}`. |
| `title` | the screen's name | `{Name}` works. |
| `draggable` | the screen's **Draggable header** setting | The operator drags the title bar. The last position of each screen's popup is remembered in that browser. |
| `coverAlarmBanner` | `false` | By default a popup is kept clear of every alarm banner on the page. |
| `id` | the screen | Opening an id that is open brings that popup to the front. |

A screen opens once as a popup unless its Display Settings allow several copies; a second open brings the first to the front. Changing page closes the popups, except the screens set to **Stays open when the operator changes page**. `Escape` closes the topmost popup, but not while a dialog or the on-screen keyboard is open.

A parameter value cannot hold a wildcard (`* # + >`), a brace, a control character, or a `.` or `..` segment. A value given by a script may only hold letters, digits, spaces and `_ . - / : ,`. A screen that declares its parameters also refuses an undeclared name, a missing required value and a value outside its allowed values or folders. Such a value is refused and the popup does not open. A parameter can therefore never widen the tag a popup button writes to. See [Screen parameters](/docs/eaxscada/reference/screen-parameters/) for how the server enforces a templated write target such as `{Pump}/Start`.

### Inner screens

`system.nav.swapInner` and `system.nav.loadInnerDisplay` show a deployed screen inside a container of the page, in place of the screen it showed. Both work in sandboxed scripts.

| | |
|---|---|
| **Options** | Only `set` (the name of one of the screen's parameter sets, a text of at most 256 characters on one line) and `params` (`{Name: value}`: at most 32 names, each a letter followed by letters, digits or `_`, at most 32 characters; each value a text of at most 256 characters, a number or a boolean). Any other member, or a wrong shape, refuses the call with `invalid` and nothing is loaded. The values are held to the strict character set, as for `system.nav.openPopup`. |
| **No container** | `system.nav.loadInnerDisplay(screen)` uses the page's one inner container: the one the page's screen names in its Display Settings, and the ones showing an inner screen now. A page with none refuses with `not_found`; a page with several refuses with `invalid` and names them (`detail.containers`). Nothing is loaded. |
| **Live values** | Before the screen is drawn, the tags its objects name (with its parameters, the [Tags lists of web content](/docs/eaxscada/reference/web-content-script-api/#the-tags-list) included) are subscribed as the container's own view, `inner:<container>`. The screen stays hidden, its HTML objects included, and takes no input until the server has answered for them, for at most 2 seconds (up to 30 seconds while a large answer keeps coming in parts); a value still missing then shows Bad. The tags are released when the page is left or the container shows another screen. A screen that is refused (not deployed, or its parameters refused) releases the container's tags too. The page's default inner screen stays in the page's own subscription. |
| **Size** | An inner screen is scaled to its container by its own scaling mode, as a page is: *fit* (one scale, the whole screen shown, centred across and top-aligned), *stretch* (the container filled) or *pan* (design size, the container scrolls). On a phone it fits. It is fitted again when the container changes size (a window resize, a phone turned, a dock opened); taps and the placement of popups next to an object follow the scale. |
| **Isometric screens** | An isometric screen (the default inner screen, or one loaded with `loadInnerDisplay` or `swapInner`) is drawn as its live map, fitted to the container, with its tags subscribed as the container's view (17 November). It is held like any inner screen while its first values arrive, and its blocks refuse every command meanwhile. A swap to another screen, a refused screen or leaving the page removes the map and its hold at once. Before, the container stayed blank. |
| **Charts, tables, web content** | Charts, data tables, web content, gauges and alarm objects of the inner screen are drawn in its own layer and follow its fit: on load, on a swap, on a resize and when a phone is turned. Below half scale, and on a phone, they are laid out at their design size and shrunk together with the screen, as on the page. Taps land on them. When the container shows another screen, the previous screen's objects go with it. |

```javascript
await system.nav.swapInner('detail', 'pump_faceplate', { params: { Pump: 'Plant/Pumps/P101' } });
await system.nav.loadInnerDisplay('reactor_detail');   // the page's one inner container
```

### Parameters in scripts

| Function | What it does |
|---|---|
| `system.params.get(name, fallback?)` | The value the screen (in a popup's script: the popup) was opened with, else `fallback`. |
| `system.params.all()` | A copy of every value, `{Name: value}`. |
| `system.params.set()` | Refused (`EaxError` `denied`): parameters are read-only. Open the screen with another set instead. |

`{Name}` written inside a script is never replaced: a script reads its values with `system.params.get`.

A command pressed in a popup runs exactly like the same button on a page: the button's confirmation or e-signature, then the guarded write.

## Alarms

| Function | Server check | Audit |
|---|---|---|
| `system.alarm.active({priority, class, area, tag, unacked}?)` | Alarm read and role targeting, as the alarm list | - |
| `system.alarm.counts({class, priority, area}?)` resolves `{total, unacked, byPriority, byClass, byState}` | Same | - |
| `system.alarm.ack(ids)` resolves `{acknowledged, refused}` | Opens the acknowledgement dialog. The operator types the reason; it is never filled in by the script. Then the acknowledge permission per alarm. | Server audit |
| `system.alarm.shelve(id)` | Opens the shelving dialog (reason and duration). Shelve permission. | Server audit |
| `system.alarm.unshelve(id)` | Asks for a confirmation first. | Server audit |
| `system.alarm.silence()` | Silences this console's alarm sound. It acknowledges nothing. | - |

A dialog closed without sending rejects with `cancelled`. On a page without the dialogs nothing is sent (`unavailable`).

## Shift log (Enterprise)

| Function | Server check | Audit |
|---|---|---|
| `system.shiftlog.add({type?, refs})` resolves `{recorded: true}` | Opens the shift log's **New entry** dialog with the references attached. The operator records the entry, or signs and records it. Then the server's checks on the entry: the licence, the rights on the log, each reference read through the operator's read rights, the signature. | The entry's record in the audit trail, made by the operator's **Record** |

The function records nothing itself. The dialog opens with no title, no text and no signer field filled in: the signer is the signed-in user, shown read-only, and a password is asked only when the operator signs. The log is the one whose area holds a referenced tag (or an alarm's area), else the log the user used last.

Arguments:

- `refs`: 1 to 32 references `{kind, id}`. `kind` is `tag`, `alarm`, `batch`, `screen` or `entry`, the kinds the server records; another kind (`lot`, `unit`, `report_run` included) is refused with `invalid` before any dialog opens. `id` is one line of 1 to 512 characters (a tag path, an alarm id, a batch id ...). An alarm also needs `activation_id`, the occurrence. A screen may carry `params`.
- `type` (optional): the entry type the dialog starts on: `note`, `deviation`, `maintenance`, `safety` or `instruction`. Never `handover`.

Rejections:

- `invalid`: bad arguments.
- `unavailable`: the shift log is not part of this server's licence, the page has no shift log panel, the user is signed out, the server is read-only, the user may write to no log, or an error. Nothing opens.
- `cancelled`: the operator closed the dialog without recording.
- `busy`: a shift log dialog is already open (an entry, a signature, a co-signature, a handover), a signature is being sent, or this script's previous call is still open. Nothing opens.
- `no_gesture`: the page had no recent click or tap. Call it from a button the operator clicks, not from a startup script or a timer. A browser that cannot tell whether there was a gesture skips this check. Nothing opens.
- `rate_limited`: more than 3 calls in a minute on this page, all scripts of the page together. Nothing opens.

One dialog at a time, a recent click or tap, and 3 calls per minute apply to sandboxed scripts. A legacy script that runs outside the sandbox gets `busy` only, never `no_gesture` or `rate_limited`. Earlier builds rejected all three as `refused_policy` with the rule's name at the start of the message (`busy: ...`); test `e.code` instead. A script that does not catch one of these rejections shows the operator a warning in their language, not a script error: "A shift log dialog is already open: finish or close it first.", "The shift log opens only right after you click or tap a button." or "Too many shift log dialogs from this screen: wait a minute and try again."

It works in sandboxed scripts. The sandbox passes on only `type` and `refs`, and of each reference only `kind`, `id`, `activation_id` and `params` (another member is refused, `invalid`). The script gets back `{recorded: true}` or the error code, never the dialog's content.

```js
// A "Note to the shift log" button on a pump screen
try {
  await system.shiftlog.add({ type: 'maintenance', refs: [{ kind: 'tag', id: 'Plant/Line2/P101.Current' }] });
} catch (e) {
  if (e.code !== 'cancelled') await system.notify.toast('Not added to the shift log: ' + e.code, 'warning');
}
```

Operators can do the same from an alarm or a faceplate: [Add to shift log](/docs/eaxscada/how-to/write-in-the-shift-log/#add-to-shift-log-from-an-alarm-or-a-faceplate).

## User

| Function | |
|---|---|
| `system.user.current()` | `{username, displayName, roles, locale}` of the signed-in user, from the server's session |
| `system.user.hasRole(role)` | `true` when the user holds the role, directly or through a group |

A role check only changes what a screen shows. The server still checks every command.

## Local files

Browsers open a file dialog only after a press or a key. Call these from a button's **Run script** action.

| Function | |
|---|---|
| `system.file.open({accept: ['.csv'], multiple})` | The browser's open dialog; resolves the files picked, `[]` when cancelled. |
| `system.file.readText(file, {maxBytes})` | The file's text. At most 10 MB by default (100 MB at most). |
| `system.file.openText({accept, maxBytes})` | Open one file and read it: `{name, size, type, text}`, or `null`. Recorded as a `file_opened` client event. |
| `system.file.saveAs(name, data, {mime})` | The browser's save dialog where it has one (Chromium-based browsers on https or localhost), else a download to the download folder. Resolves `true` when saved, `false` when cancelled. Recorded as a `file_saved` client event. |

`data` is text, a Blob, an ArrayBuffer or an object (saved as JSON). The name keeps no folder part.

## Server files

On the [server files API](../server-files/). The server checks the session, the root's roles, its file types, its size limit and quota, and the edition: no server files on Free, one root on Starter, any number on Pro and Enterprise. Every call is audited with the file's sha256.

| Function | |
|---|---|
| `system.file.server.roots()` | The roots you may use |
| `system.file.server.list(root, folder, {offset, limit})` | A folder's entries |
| `system.file.server.read(root, path, {as: 'text' or 'blob', maxBytes})` | A file |
| `system.file.server.write(root, path, data, {overwrite})` | Writes a file (refused if it exists unless `overwrite`) |
| `system.file.server.remove(root, path)`, `mkdir(root, path)` | |
| `system.file.server.download(root, path)` | Reads the file and saves it through `saveAs` |
| `system.file.server.upload(root, folder, file, {overwrite})` | Writes a file picked with `system.file.open` |

A path that starts with `/` or a drive, or holds `..`, is refused before anything is sent.

## Print and export

| Function | |
|---|---|
| `system.print.screen({title, landscape, header, target})` | Prints the screen (or the popup `target`) through the browser's print dialog: the screen at twice its resolution with its charts, under a header with the screen, the user, the time and the server. Choose **Save as PDF** for a PDF. Recorded in the audit trail as `SCREEN_PRINTED`. |
| `system.export.csv(rows, columns, name, {separator})` | Saves the rows as a CSV file (UTF-8 with a byte-order mark). `rows` are objects or arrays; `columns` are field names or `{field, header}`; `separator` is `,` (default), `;` or a tab. Recorded as an `export` client event. |
| `system.export.png({target, filename})` | Saves the screen or a popup as a PNG file. |

A CSV cell that a spreadsheet would run as a formula (it starts with `=`, `+`, `-`, `@`, a tab or a carriage return and is not a number) gets a leading apostrophe.

## Clipboard, notifications, dialogs, logging, timers, formatting

| Function | |
|---|---|
| `system.clipboard.copyText(text)`, `readText()` | Needs https or localhost; reading asks the browser's permission. |
| `system.notify.toast(message, type)` | `info`, `success`, `warning` or `error` |
| `system.notify.desktop(title, body)` | A desktop notification while this tab is hidden, after the browser's permission; otherwise a toast. |
| `system.ui.alert(message)`, `system.ui.confirm({title, message})` | The standard dialogs; `confirm` resolves `true` or `false`. |
| `system.ui.prompt({type: 'number' or 'text', label, unit, min, max})` | Asks for a value; `null` when cancelled. Where the on-screen keyboard applies (touch panels), it opens the keypad. A number outside `min`/`max` rejects with `out_of_range`. |
| `system.log.info / warn / error(message, data)` | To the server log, not the audit trail. At most 20 lines a minute per session; data at most 4 KB. |
| `system.timer.every(ms, fn)`, `system.timer.after(ms, fn)` | Return `cancel()`. `every` needs at least 250 ms. Both end when the page or popup closes. |
| `system.util.format(value, {decimals, unit})`, `formatDate(date, 'yyyy-MM-dd HH:mm:ss')`, `parseNumber(text)`, `clamp(v, min, max)`, `now()` | |

## Actions on screen objects

The **Action** tab of an object, and the button's full dialog, offer these navigation actions next to the tag commands. None of them writes a tag.

| Action | Settings |
|---|---|
| Navigate to page / screen | Target; parameters |
| Open popup screen | Screen; parameters (one `Name=value` per line); window (as the screen says, modal, modeless); position (centre, next to the object, fixed x and y); title; "The operator cannot move it"; "May cover the alarm banner"; popup id |
| Close popup | Popup id, or empty for the popup the object is in |
| Open dock, Close dock, Open or close dock | Edge; for Open dock, the screen to show there |
| Back, Forward, Home screen | - |
| Run script | The script, with `system`, in the screen's [sandbox](#the-sandbox). Adding or changing it needs the right [`screens.script`](/docs/eaxscada/how-to/grant-the-screen-script-right/). |

An action that is not fully configured (a popup without a screen, a write without a tag or a value, a dock without an edge) does nothing when pressed. The operator sees "Action not configured", and the inspector shows the same.

In the designer, a click selects an object; only **Alt+click** runs its action. Ctrl+click and Shift+click add to the selection.

## Runtime navigation

The operator toolbar has **Back**, **Forward** and **Home** buttons; the browser's own back and forward keys do the same. Each history entry keeps the page's parameters and its docks as the operator left them, so Back returns to the previous page with its docks.

A page can show a breadcrumb bar (page setting `breadcrumb`): Home, the screen's folders in the project, the screen.

### Home screen per role

In **Project > Project manager > Operator runtime**, one `Role = page or screen` per line. The first line that matches one of the signed-in user's roles is the home screen; with no match, the project's startup page. The same section sets how values that are not Good are shown (overlay, corner marker or hatching) and the external addresses that `system.nav.openWindow` may open.

### Consoles

A project can list console layouts (`navigation.console_layouts`): named sets of windows, each with a page and an optional position and size. The runtime's **Screens** menu shows **Open console: name**, which opens one window per entry. Browsers may ask to allow pop-ups, and treat the positions as hints.

## Client events

`POST /api/client-events` records what only the browser sees. The functions above call it; a custom page may too.

```json
{ "kind": "screen_printed", "level": "info", "message": "Printed screen Line 1", "screen": "line1", "data": { "title": "Line 1" } }
```

| Field | |
|---|---|
| `kind` | `script_error`, `script_refused`, `script_timeout`, `log`, `screen_printed`, `file_saved`, `file_opened`, `export` or `security` |
| `level` | `info` (default), `warn` or `error` |
| `message` | Required; cut to 1000 characters on one line |
| `screen` | Optional; cut to 200 characters |
| `data` | Optional JSON, at most 4 KB |

- It needs a signed-in session: `401` without one, `403` when sign-in is turned off. The user recorded is the session's; the body cannot name one (unknown fields are refused with `400`).
- At most 20 events per session in any 60 seconds; the 21st answers `429` with `Retry-After`.
- Every event goes to the server log. Every kind except `log` is also written to the audit trail: category `CLIENT_EVENT`, action the kind in capitals (`SCREEN_PRINTED`), resource the screen.
- The answer is `202 {"accepted": true, "audited": true | false}`. The server records the event and never acts on it.

## Behaviour changes in this version

- Screen parameters (see [Screen parameters](/docs/eaxscada/reference/screen-parameters/)): a parameter name is now a letter followed by letters, digits or `_` (at most 32); a name with a `.` or starting with `_` is refused. `system.nav.openPopup` and `system.nav.navigate` hold the values a script gives to the strict character set. Navigation actions pass their parameters to the target page (before, they were stored but never applied).

- Popups open screens with parameters, as modal or modeless windows that the operator can drag. Before, "Open faceplate popup" showed a message in the designer and did nothing in the runtime.
- The operator toolbar has Back, Forward and Home. Docks opened or closed by the operator or a script stay so across pages.
- New object actions: Close popup, Open dock, Close dock, Open or close dock, Back, Forward, Home screen. "Run command" is called "Run script" and accepts the `system.*` functions; an unknown `system.` name is still refused.
- An action that is not fully configured does nothing and says so.
- In the designer, Ctrl+click on an object selects it and never runs its action; only Alt+click runs it.
- The runtime faceplate writes through the same guarded write path as every button.
- A display startup script that throws shows an error and records a `script_error` client event.
- **Screen scripts run in a sandbox** (breaking): no `player`, no `this`, no page globals; every `system.*` call that reaches the page returns a Promise; only the functions of this page; a script that keeps its sandbox busy for 5 seconds is stopped. A refused or stopped script marks its object and records `script_refused` or `script_timeout`. `system.nav.navigate` opens only this server's pages, for every script. Adding or changing a script needs the right `screens.script`. See [Migrate screen scripts to the sandbox](/docs/eaxscada/how-to/migrate-screen-scripts-to-the-sandbox/).
- New: `system.shiftlog.add` (Enterprise), also in sandboxed scripts. It opens the shift log's entry dialog with references attached and records nothing itself. See [Shift log](#shift-log-enterprise).
- `system.nav.swapInner` takes `{set}` or `{params}`, also in sandboxed scripts; a wrong shape is refused with `invalid`. `system.nav.loadInnerDisplay(screen)` without a container loads into the page's one inner container and refuses with `not_found` (none) or `invalid` (several); before, it went to a container named `inner-display-container` whatever the page named, and a sandboxed script's one-argument call was refused. An inner screen switched by a script subscribes its tags before it is drawn and is scaled to its container. See [Inner screens](#inner-screens).
- The charts, data tables, web content, gauges and alarm objects of an inner screen or a dock are drawn in its own layer and follow its scale, size and scroll; before, they stayed at their design size away from it, or were not shown. Alarm objects in popups are placed from the popup's canvas.
