diff --git a/src/extensionsIntegrated/Phoenix-live-preview/FILE_PROTOCOL_PREVIEW_NOTES.md b/src/extensionsIntegrated/Phoenix-live-preview/FILE_PROTOCOL_PREVIEW_NOTES.md new file mode 100644 index 0000000000..5333796cc0 --- /dev/null +++ b/src/extensionsIntegrated/Phoenix-live-preview/FILE_PROTOCOL_PREVIEW_NOTES.md @@ -0,0 +1,577 @@ +# Static `file://` live preview for HTML files outside the project (not shipped yet) + +Status: **prototyped and verified on the Electron desktop shell on 2026-09-05, then rolled back**. Nothing +in this document is live in the product. Keep it until the feature is picked up again; the full working +patch for this repo is at the bottom, and the Electron main-process code is in the middle. + +## Problem + +Opening an HTML file that is not inside the current project shows the "Preview Unavailable!" page +(`Strings.DESCRIPTION_LIVEDEV_PREVIEW_RESTRICTED*`, built in `NodeStaticServer._getExternalPreviewURL`). +We deliberately refuse to serve such files over the live preview http server: a page served from a +non-project location could walk the disk with relative URLs (`../../.aws/credentials`), read the content +and post it to a remote server. Only project files are served, and only from the project root. + +The degraded but safe alternative is to show the file as a plain `file://` page (what a browser does when +you double-click an html file) that reloads on save. No live edit transport, no instrumentation, no popout +tab routing. This works only on the desktop app; the browser build has no local file access at all. + +## What we found (read this before re-implementing) + +1. **A plain ` + `; + ++ /** ++ * Electron desktop only: HTML files outside the project are previewed as plain `file://` pages inside a ++ * `` (Chromium refuses `file://` in an `