Question
What can a website served from an ordinary origin actually do with files on the user's own disk, and where are the hard limits?
Foundational for the runtime redraw recorded on the map: webtweak 1.0 is a website you visit, not a local Node server you run. Every open ticket that assumed a server now waits on the facts below. This ticket resolves facts, not decisions - the decisions that consume them are separate tickets.
Prefer primary sources and dated statements: the WHATWG File System Access spec, MDN, Chrome for Developers, caniuse, and the WebKit and Mozilla standards positions. Where a capability is Chromium-only, say so explicitly rather than describing it as "supported".
Resolve:
- Browser support. Which engines implement
showDirectoryPicker, showOpenFilePicker, showSaveFilePicker and writable file streams. State the current Mozilla and WebKit standards positions and their dates. Whether Safari's partial implementation reaches real user directories or only the origin-private file system. Whether any of it works on mobile.
- Permission lifetime. Whether a granted directory handle survives a reload, a tab close, and a browser restart. What has to be stored, and where (IndexedDB handle persistence). Whether
queryPermission / requestPermission can restore access without a fresh user gesture, and whether installing as a PWA changes the answer.
- What counts as a user gesture for opening the picker, and whether a page can trigger it repeatedly, steal focus, or leave one open. This is the fact underneath the folder-dialog half of the now-superseded #16.
- Change notification. Whether there is any way to observe changes to a granted directory, or whether polling is the only option. If polling, what a directory scan costs at the scale of a real site.
- Rendering local files. Whether a service worker can synthesise HTTP responses from bytes read through a directory handle, so a local page renders with its own relative CSS, fonts and images. What the alternatives are (blob URLs,
srcdoc, URL rewriting) and what each breaks. Whether Range requests can be synthesised, since the current server supports them for media.
- Isolation options for rendering untrusted local HTML: sandboxed iframes and their flags, and whether any of them yields an origin genuinely distinct from the app's.
- Byte fidelity. Whether reading and writing through this API preserves bytes exactly, including for non-UTF-8 files. The "non-UTF-8 pages are served byte-for-byte" decision in
CONTEXT.md depends on this.
- Whether the origin-private file system is relevant here or a red herring, given that the whole point is editing the user's real project folder.
Record the findings as a Markdown file under docs/research/ on a research/ branch, per the house pattern set by docs/research/css-parsing-options.md.
Question
What can a website served from an ordinary origin actually do with files on the user's own disk, and where are the hard limits?
Foundational for the runtime redraw recorded on the map: webtweak 1.0 is a website you visit, not a local Node server you run. Every open ticket that assumed a server now waits on the facts below. This ticket resolves facts, not decisions - the decisions that consume them are separate tickets.
Prefer primary sources and dated statements: the WHATWG File System Access spec, MDN, Chrome for Developers, caniuse, and the WebKit and Mozilla standards positions. Where a capability is Chromium-only, say so explicitly rather than describing it as "supported".
Resolve:
showDirectoryPicker,showOpenFilePicker,showSaveFilePickerand writable file streams. State the current Mozilla and WebKit standards positions and their dates. Whether Safari's partial implementation reaches real user directories or only the origin-private file system. Whether any of it works on mobile.queryPermission/requestPermissioncan restore access without a fresh user gesture, and whether installing as a PWA changes the answer.srcdoc, URL rewriting) and what each breaks. Whether Range requests can be synthesised, since the current server supports them for media.CONTEXT.mddepends on this.Record the findings as a Markdown file under
docs/research/on aresearch/branch, per the house pattern set bydocs/research/css-parsing-options.md.