# Perspective Workstation: showSaveFilePicker() crashes the renderer on write; download-dialog fallback doesn't return window focus

**URL:** <https://forum.inductiveautomation.com/t/perspective-workstation-showsavefilepicker-crashes-the-renderer-on-write-download-dialog-fallback-doesnt-return-window-focus/116395>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [July 14, 2026, 1:25pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-showsavefilepicker-crashes-the-renderer-on-write-download-dialog-fallback-doesnt-return-window-focus/116395 "2026-07-14T13:25:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![porter.grigg](https://avatars.discourse-cdn.com/v4/letter/p/71c47a/32.png) [@porter.grigg](https://forum.inductiveautomation.com/u/porter.grigg)\
**Post date:** [July 14, 2026, 1:25pm UTC](https://forum.inductiveautomation.com/t/perspective-workstation-showsavefilepicker-crashes-the-renderer-on-write-download-dialog-fallback-doesnt-return-window-focus/116395/1 "2026-07-14T13:25:03Z")

</div>

**Context:**  
Same custom Perspective component as above, this time exporting/saving a JSON config file. It uses `window.showSaveFilePicker()` (File System Access API), with a Blob + `<a download>` fallback for browsers that lack it. Works correctly in Perspective web sessions. In Workstation, two separate problems show up.

**Issue A — `showSaveFilePicker()` write crashes the renderer**

Steps to reproduce:

1. Call `window.showSaveFilePicker()`, then `handle.createWritable()` → `writable.write(data)` → `writable.close()`.
2. Pick a save location in the dialog that appears, then confirm.

Observed: the save dialog itself works fine — it opens, and you can navigate and choose a filename/location. But as soon as the write proceeds, the screen goes white and an attached DevTools session (via `devTools=true`) disconnects — consistent with the renderer process crashing outright, not a catchable JS error (nothing is logged before the crash).

Workaround: skip `showSaveFilePicker()` in Workstation and fall back to the older Blob + `<a download>` technique instead — the same mechanism `system.perspective.download()` uses internally client-side (confirmed by reading the compiled `@inductiveautomation/perspective-client` bundle: `PageStore.downloadFile()` is literally `document.createElement('a'); a.download = filename; a.click()`). This completes successfully with no crash.

**Issue B — the download-dialog workaround doesn't return window focus**

With the Blob/anchor-download workaround above, if Workstation's Chromium is configured to prompt for a save location on download, the native "Save As" dialog appears and works correctly — but after clicking Save in that dialog, the Workstation window doesn't regain focus. It drops behind whatever window was previously active instead of returning to the foreground. This looks like the native dialog isn't being parented/owned by the Workstation window correctly at the OS level, so focus falls back to the previously-active window instead of returning to Workstation when the dialog closes.

We couldn't find any setting — in Workstation's Settings/Manage UI, launch arguments, or `config.json` — to control this download/save-dialog behavior at all.

**Ask:** Is the `showSaveFilePicker()` crash a known bug in Workstation's Chromium build? Separately, is the window-focus-after-dialog-close behavior something Workstation's team is aware of, and is there any supported way (config, launch argument, or otherwise) to either suppress the "ask where to save" download prompt entirely, or fix the focus handoff when it's used?
