# Custom Renderer Scripts

Place user scripts here as plain `.js` files before running the Wand patch.

During patching, Wand Enhancer copies generated default scripts from `web-panel/dist/renderer-scripts` and user scripts from this folder into `remote-panel/renderer-scripts` inside `app.asar`. Default script sources live under `web-panel/bridge/scripts/default` and are generated by `pnpm run build:bridge`. Scripts are loaded in filename order on every Wand renderer startup.

Each script runs in the Wand renderer and receives a small global API:

```js
;(function (WandEnhancer) {
  WandEnhancer.log("custom script loaded", WandEnhancer.remoteUrl)
})(globalThis.WandEnhancer)
```

Use unique global guards for repeat-safe scripts because the renderer can be reinjected after navigation.
