# \[FAQ\] Preload scripts and auto-injected libraries in io.Connect Desktop

**URL:** <https://community.interop.io/t/faq-preload-scripts-and-auto-injected-libraries-in-io-connect-desktop/399>\
**Category:** io.Connect Desktop\
**Tags:** FAQs\
**Created:** [December 3, 2025, 12:28pm UTC](https://community.interop.io/t/faq-preload-scripts-and-auto-injected-libraries-in-io-connect-desktop/399 "2025-12-03T12:28:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous6](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.interop.io/anonymous6/32/53_2.png) [@anonymous6](https://community.interop.io/u/anonymous6)\
**Post date:** [December 3, 2025, 12:28pm UTC](https://community.interop.io/t/faq-preload-scripts-and-auto-injected-libraries-in-io-connect-desktop/399/1 "2025-12-03T12:28:56Z")

</div>

When I open DevTools in a window started from io.Connect Desktop (for example, from our toolbar), I see a lot of extra JavaScript/TypeScript sources that I didn’t write.

Where is this code coming from, and how does it fit into the io.Connect architecture?

---

<div class="post-metadata">

**Author:** ![toni.petrov](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.interop.io/toni.petrov/32/17_2.png) [@toni.petrov](https://community.interop.io/u/toni.petrov)\
**Post date:** [December 3, 2025, 6:47pm UTC](https://community.interop.io/t/faq-preload-scripts-and-auto-injected-libraries-in-io-connect-desktop/399/2 "2025-12-03T18:47:47Z")

</div>

That code comes from:

- **Preload scripts** configured in `system.json` or the app definition, and
- **io.Connect JavaScript libraries** that expose global factory functions like `IODesktop()` and `IOWorkspaces()`.

### 1. **Preload scripts**

io.Connect Desktop lets you define **preload scripts** at two levels:

- **System-wide** using the `"preloadScripts"` property of the `"windows"` top-level key in `system.json`.
- **Per app** using the `"preloadScripts"` property of the `"details"` top-level key in the app definition. [See the docs](https://docs.interop.io/desktop/capabilities/more/features/index.html#preload_scripts).

They are executed before the actual web app is loaded and before each `<iframe>` on the page, and allow injecting io.Connect functionality into third-party web apps over which you have little to no control.

To see which preload scripts are active in a given window Open DevTools → Console and run:

```auto
// List currently known preload scripts
iodesktop.preloadScripts

```

To match those scripts to your configuration

Open your system.json and look for:

```auto
{
  "windows": {
    "preloadScripts": { ... }
  }
}

```

And open the app definition(s) for the app in question and look for:

```auto
{
  "details": {
    "preloadScripts": [...]
  }
}

```

### 2. **The JavaScript API that is auto-injected by the platform**

io.Connect Desktop can auto-inject the `@interopio/desktop` JavaScript library into app windows. It provides essential functionality your apps use to talk to the platform (Interop, Shared Contexts, Channels, Window Management, etc.). For auto injection, io.Connect Desktop ships prebuilt `@interopio/desktop` bundles.

Auto injection is configured with `autoInjectAPI`:

- On **app level** under the `"details.autoInjectAPI"` key in the app definition.
- On **system level** under the `"windows.autoInjectAPI"` key in `system.json`.
