DEV Community

Cover image for Claude's Install as App Needs You Online. I Built an Open Version That Doesn't
Vladimir Beskorovainyi
Vladimir Beskorovainyi

Posted on Originally published at besk.tech

Claude's Install as App Needs You Online. I Built an Open Version That Doesn't

Claude's new Install as app opens only online and signed in, on Mac or Windows. deskhatch installs any HTML as a desktop app offline, on macOS and Linux, from one 5.6 MB macOS runtime that Apple notarized once per release.

On November 24 Anthropic added Install as app to Claude Desktop. A Claude artifact gets its own icon and window and opens like any other app, but only online, signed in to Claude, on a Mac or a Windows PC. The next day I published deskhatch, an open version for HTML from anywhere. It works offline, runs on macOS and Linux, and calls the model you choose. Every app runs on one runtime: 5.6 MB on macOS, signed and notarized once per release. Notarization is Apple's automated check for malware and signing problems, not a security review of deskhatch.

What Anthropic shipped

Anthropic presents the feature for knowledge workers and developers. Its help page suggests requests like a Pomodoro timer in the menu bar or a reminder to stretch every hour. An installed app can stay at browser level, ask for notifications, shortcuts and a menu bar item, or get Full access, which lets it run programs and read, change or delete files without asking each time.

The help page also lists the limits, as of November 25, 2026:

  • an app opens only online and signed in to Claude Desktop;
  • Mac and Windows only, with no Linux, web or mobile;
  • building an app and every request it makes to Claude count toward the plan's usage limits;
  • only Claude artifacts can be installed, and not every one qualifies: Docs, Slides and Sheets cannot be;
  • Anthropic does not review apps before install.

It is rolling out as a beta on the Free, Pro, Max, Ultra, Team and Enterprise plans. On Enterprise an owner has to turn it on first.

For someone who works in Claude all day, none of this is a problem. It is a problem for HTML that came from somewhere else, for a laptop without a network, and for Linux.

What I built

deskhatch does the same with HTML from anywhere: Claude, ChatGPT, Gemini, an editor, an old page.

npx deskhatch install page.html
Enter fullscreen mode Exit fullscreen mode

The page gets an icon in the dock or the app menu, its own window, and a hatch object in JavaScript: model calls, a store per app, notifications, a tray icon, global hotkeys and access to folders the user picked. The model is the one you configure: Ollama, LM Studio or llama.cpp on your own machine, or your own key for any OpenAI-compatible API. The key sits in the system keychain, never in the app.

An app is a folder of three files: app.json, index.html and icon.png. This is the manifest of the Pomodoro example from the repository:

{
  "schema": 1,
  "id": "pomodoro",
  "name": "Pomodoro",
  "permissions": "desktop",
  "window": { "width": 420, "height": 560 },
  "tray": { "enabled": true, "tooltip": "Pomodoro", "hideOnClose": true },
  "hotkeys": { "toggle": "CmdOrCtrl+Shift+P", "startStop": "CmdOrCtrl+Shift+O" }
}
Enter fullscreen mode Exit fullscreen mode

And this is all the page needs to keep a log, notify and answer a hotkey:

await hatch.store.set('log', log);
const saved = await hatch.store.get('log');
await hatch.notify('Focus session done', 'Take a break.');
hatch.on('hotkey', name => { if (name === 'startStop') running ? stop() : start(); });
Enter fullscreen mode Exit fullscreen mode

npx deskhatch export my-app packs the folder into one .hatch file. The other person installs it with one command or drops it on the runtime. There is no store and no account.

I measured what an install leaves on a Mac. The installed package of the Pomodoro example is 20 KB. Its launcher in Applications is 148 KB. With the runtime already downloaded, install took 0.47 seconds.

Why one signed runtime

I have built and signed many desktop apps one at a time. To hand an app to someone else on a Mac without a Gatekeeper warning, it has to be signed with a Developer ID and notarized by Apple. That needs a paid Apple Developer Program membership and a signing and notarization round for every build.

deskhatch moves that work to one place. The runtime is signed and notarized once per release, and spctl reports it as Notarized Developer ID. An app is not a program. It is a folder of files that the runtime opens, so it needs no signature of its own, and the person who installs it needs no Apple account.

On macOS the option --standalone gives an app its own copy of the runtime, about the same size, so the system shows the app's own name in the menu bar and the app switcher. That copy is made on the user's machine and signed ad hoc there. It never passes through a browser download, so it carries no quarantine flag. Gatekeeper does not check that copy, and the runtime's notarization does not cover it.

Permissions

Tier Requests from the page Notifications, tray, hotkeys Files
web, the default none no none
desktop only listed hosts yes folders the user picked
full only listed hosts yes the home folder

In every tier the model is reached through the runtime. The runtime is built to enforce the tier in Rust and through the page's content security policy, so the HTML should not be able to raise its own level. A web app is not allowed to make network requests, load remote scripts or read files. Every page is blocked from navigating away from its own package or opening a new window. ~/.ssh, ~/.gnupg, ~/.aws and deskhatch's own folder are blocked in every tier.

Two of those rules came from checking this post against the code. Version 0.2.2 let a page leave by setting location.href, which the content security policy does not cover, and let full read outside the home folder. Both are fixed in 0.2.3, and the repository has a test that fails on 0.2.2 and passes now. If you installed 0.2.2, update. Nobody has audited deskhatch independently, so treat these rules as design goals, not a certification.

There is no API to start a program, in any tier. That does not make full harmless: it can write any file in your home folder, shell startup files included, and code there runs at your next login. Grant full only to apps you wrote or trust. Claude's Full access can run programs directly.

Side by side

Claude Install as app deskhatch
Opens offline no yes
Account Claude, signed in none
Model Claude, counted against the plan any: local, or your own key
Platforms macOS, Windows macOS, Linux
Source of the HTML Claude artifacts any file
Starting programs with Full access no API for it

Claude's version has things mine does not. Its apps use the connectors you have set up in Claude, they update when you edit the artifact, and they run on Windows. For an app that has to start other programs, deskhatch is the wrong tool.

Try it

npx deskhatch gallery
npx deskhatch install examples/pomodoro
npx deskhatch new "a pomodoro timer with a tray icon and a daily log"
Enter fullscreen mode Exit fullscreen mode

new sends the request and the hatch API reference to your model, takes the HTML out of the reply and installs it. I have not measured how often a local model gets it right on the first try. The npx wrapper needs Node 18 or newer. On Linux the runtime comes as an AppImage or a .deb; neither is signed yet.

What is open, Windows first

Windows is where I need help. Tauri, which deskhatch is built on, targets Windows, but the release has no Windows build yet. What is missing is listed in issue #1:

  • a launcher in runtime/src/packages.rs: a Start menu shortcut that starts the runtime with --app <id>, with the icon converted from icon.png to .ico;
  • an NSIS or MSI bundle in the release workflow;
  • opening .hatch files with the runtime;
  • the win32 asset name and binary path in cli/index.js;
  • a test of the tray and the global hotkeys on Windows.

Code signing for SmartScreen can wait. A pull request for any one of these items is welcome, and I review and merge them myself. A thumbs-up on #1 decides the order of work.

Three more items are open: streaming replies from hatch.llm.chat (#3), importing a Claude artifact from its share link (#4), and the app name on macOS, where an app on the shared runtime is called Deskhatch in the menu bar unless it is installed with --standalone (#2).

deskhatch is an independent open source project. It is not affiliated with, endorsed by or sponsored by Anthropic. Claude is a trademark of Anthropic.

If something breaks on your machine, open an issue and tell me what you ran. If you build something with it, the repository has a showcase file that takes pull requests, and a star tells me the idea is worth continuing. deskhatch is MIT-licensed.

Sources


Vladimir Beskorovainyi, Enterprise AI Architect & CTO, author of the Amazon bestseller "Enterprise AI: The KATA Way", founder of Besk Tech (besk.tech)

Top comments (35)

Collapse
 
dosaygo profile image
dosaygo •

When an HTML app depends on remote scripts or assets, how do you make sure the installed copy still works offline later?

Collapse
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo It does not fetch them later. The page's content security policy allows scripts only from the package itself, in every tier, so a script from a CDN never loads, online or offline. A page that needs a library has to carry it: put the file in the app folder next to index.html, or inline it. Images and fonts in desktop and full can come from hosts listed in allowedHosts, but those need the network, so for offline use they belong in the folder too. Today install does not download remote files into the package.

Collapse
 
dosaygo profile image
dosaygo •

Thanks for the detail on enforcing a package-only script CSP and noting that remote images, fonts, and external assets have to be bundled locally for offline use since install does not fetch them into the package today, I'm building TDF (Tree Document Format), which captures live web pages alongside their rendered assets, comments, and notes into a single self-contained offline file that stays browsable without the network: trees.dosaygo.com/go/forum-2026112...

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That fits the gap well: a page captured with its assets already inside is what an offline app needs. In deskhatch a fetch of a file inside the package works in every tier, so assets written next to the page would load. How does TDF handle scripts that load other files at run time, a dynamic import or a fetch of a JSON file? Those are the ones a static capture usually misses.

Thread Thread
 
dosaygo profile image
dosaygo •

Thanks for asking. Tree-grower uses WebDriver BiDi interception at network.responseStarted in the live browser to read and store responses the browser receives during the capture session in the .tdf SQLite archive. That includes dynamic import() modules, fetch/XHR JSON, and assets triggered while browsing or driving with Grip under --keep-open; Tree Player can replay them offline. Paths not requested during the session are not pre-crawled, so exercise them while capturing. What are you hoping to archive?

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo Not an archive as such. The case I have in mind is a page someone built once and wants to keep using without a network. In deskhatch that page becomes a folder of three files, and the Pomodoro example installs as 20 KB, so a captured page with its responses could fit the same shape. Does Tree Player look up each response by its original URL in the SQLite file? If so, exporting those responses as plain files keyed by path could turn a .tdf capture into an app folder.

Thread Thread
 
dosaygo profile image
dosaygo •

Yes. The .tdf SQLite responses table uses PRIMARY KEY (ring_id, key), where key is the method followed by the original URL (for example GEThttps://...), and stores status, headers, content_type and the body BLOB, with canonical_key for deduplicated bodies. Select the GET rows and strip the method and origin to produce path-keyed files. Would that fit your export workflow?

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo It would, with one catch. A deskhatch page reads its files through the runtime's own hatch: scheme, so a relative fetch such as data/items.json gets the file at that path inside the package and never touches the network. Stripping the origin works for the page's own host. A capture usually also holds a font or a script from a second host, though, and two hosts can share a path like /main.js. When Tree Player replays, how does it route a request to a third-party host: does it intercept it in the browser, or rewrite the URL in the page?

Thread Thread
 
dosaygo profile image
dosaygo •

Tree Player intercepts every request in the browser before it reaches the network (network.addIntercept at beforeRequestSent on WebDriver BiDi, or CDP Fetch.enable at the Request stage) and fulfills it from SQLite by the full (ring_id, method + URL) key without rewriting URLs in the captured page bytes. Because each row in responses also stores the origin column alongside the full URL key, two hosts sharing /main.js stay distinct in the database; if you export a .tdf into a hatch: package folder, you can write the page's own origin to root-relative paths and namespace any third-party origins under a subpath like _origins/<host>/<path>, rewriting only those cross-origin references during export.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That layout would work, and reading the runtime code shows two more things the export has to handle. The hatch: handler looks only at the path: the query string and the method are dropped before the file is read. So /api/items?page=1 and ?page=2, or a GET and a POST to the same URL, would land on one file unless the export folds the query into the file name and rewrites those references to match. The handler also takes the content type from the file extension. Google Fonts, for example, serves its CSS from /css2?family=..., with no extension, so that file would come back as application/octet-stream and the browser would ignore it as a stylesheet. Does a .tdf keep each response's original Content-Type header, so the export could pick the extension from it?

Thread Thread
 
dosaygo profile image
dosaygo •

Thanks for tracing the query, method and extension handling. Yes: TDF stores captured response headers and a content type field, so an exporter can consult the captured Content-Type when available; it would still need an explicit mapping and collision-safe names incorporating query and method. I have not verified such an exporter for that runtime. trees.dosaygo.com/go/forum-2026112...

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi • • Edited

@dosaygo Thanks, that settles the type question. One more layer sits below the HTML. On the default web tier the content security policy allows fonts, images and scripts only from hatch: and data:, so a captured stylesheet that still points at fonts.gstatic.com would be blocked rather than replayed. On the desktop tier the same request would be allowed only for hosts listed in the manifest, and it would then go to the network, so the app would stop working offline. An exporter would have to rewrite url() and @import inside CSS too, not only the HTML attributes. Does Tree Player see those CSS references as separate captured requests, so they can be mapped by the same key?

Thread Thread
 
dosaygo profile image
dosaygo •

Yes. WebDriver BiDi captures each browser-fetched CSS @import and font or image url() as a separate response keyed by GET<resolved-url>. Tree Player serves those requests through CDP Fetch interception without rewriting the CSS; a static exporter would rewrite the CSS references using the same key.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo Good, then the key carries over cleanly. One case would still slip through. Before the page parses, the runtime strips resource hints from every HTML response it serves: link tags with rel preload, modulepreload, prefetch, prerender, preconnect or dns-prefetch. A plain module or font preload is harmless to lose, because the real request follows anyway. The common async-CSS pattern is not: <link rel="preload" as="style" onload="this.rel='stylesheet'"> is removed along with its onload, so that stylesheet never applies. An exporter would have to turn those into plain stylesheet links. Does a capture record which request started from a preload hint, so the exporter could find them?

Thread Thread
 
dosaygo profile image
dosaygo •

No: the responses table does not store an initiator or preload-hint flag on the stylesheet row ((ring_id, key) stores origin, status, headers, content_type, and body, and Sec-Fetch-Dest: style only enters key when the response declares Vary, which is identical to a normal stylesheet request). However, TDF stores the unmodified HTML response bytes in responses.body without stripping resource hints during capture, alongside the fetched CSS response under GET<resolved-href>. An exporter scanning captured text/html bodies can match <link rel="preload" as="style" ...> directly in the stored HTML, confirm GET<resolved-href> exists in responses, and rewrite that tag to <link rel="stylesheet" href="..."> before your runtime serves it.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That works, since the stored HTML is untouched. Two more parts of the policy would bite a captured page, and no rewrite of links fixes them. The runtime sets frame-src 'none', so any iframe in the capture, a video embed or a comments widget, renders as an empty box. It also sets form-action 'none', so a search form or a login form on the page cannot submit anywhere, even to its own package. A static export can only keep those parts as dead markup or replace them with a placeholder. Does a capture record the documents loaded inside iframes as separate HTML responses, so an exporter could at least inline them?

Thread Thread
 
dosaygo profile image
dosaygo • • Edited

Yes — TDF's browser-level CDP controller attaches to both page and iframe targets and records each iframe's navigation document (along with its subresources) as its own row in responses(ring_id, key) under <METHOD><url>, with its own headers (Content-Type: text/html) and compressed body. A static exporter can resolve <iframe src>, look up GET<resolved_url> in responses, and inline that HTML document directly. If you want to try TDF on your exporter, we can send a free 14-day Grower licence — you can ask at sales@dosaygo.com.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo Thanks, that covers the iframe case. Inlining has its own catch on the runtime side. It looks only at the path of a request and drops the query string, so two embeds such as /embed?v=abc and /embed?v=xyz would resolve to the same file in the package. An exporter would have to give each captured document its own path and rewrite the iframe src to match. Thanks for the licence offer as well; for now I am only looking at how the two formats fit. When two captured URLs differ only in their query string, are they stored as separate rows under separate keys?

Thread Thread
 
dosaygo profile image
dosaygo •

Thanks for pointing out the path-only collision. In TDF, responses are keyed by ring and normalized URL, so those two URLs get separate keys and rows if the v parameter survives normalization. Privacy sanitization and configurable URL-key rules can strip parameters, so that distinction is not guaranteed for every parameter or configuration. An exporter would still need distinct output paths and rewritten iframe sources. I haven't tested that export case end to end. trees.dosaygo.com/go/forum-2026112...

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That makes sense, and it points to one more rule for the exporter. The runtime decides the content type from the file extension alone, so a captured document saved under a path like /embed, with no extension, would be served as application/octet-stream and would not render as a page. The stored Content-Type header does not help here, because the package has no place to carry it. So the exporter has to write each iframe document as a .html file and point the src at that name. Which parameters does the default normalization strip, only tracking ones such as utm_, or anything on a list the user sets?

Thread Thread
 
dosaygo profile image
dosaygo •

Both: the built-in default ruleset strips a global ("*") list of 21 analytics parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id, gclid, gclsrc, dclid, gbraid, wbraid, fbclid, msclkid, _hsenc, _hsmi, mc_cid, mc_eid, _ga, _gl, ref, ref_src, ref_url) plus four CDN rules (akamaihd.net strips hdnts, hdntl, token; cloudfront.net strips Expires, Signature, Key-Pair-Id, Policy; fbcdn.net strips efg, oh, oe, dl, _nc_ht, _nc_cat, _nc_ohc; googlevideo.com keeps an allowlist of id, itag, range, clen, mime, dur, xtags), and Grower writes that file to url_key_rules.json on first run so the user can add their own domain-suffix strip_params or keep_params rules.

The active ruleset is also saved inside the .tdf SQLite kv table under "url_key_rules", and whenever normalization or query sorting changes a URL, Collector writes both the normalized key and a written_key row under the exact browser-requested URL. Since every row in responses stores content_type alongside the body even though your runtime package does not carry headers, the exporter can read responses.content_type at export time to append .html (or .js, .css, .json) to extensionless paths like /embed?v=abc -> embed_v_abc.html before writing the folder. TDF captures the live page, its iframe documents, and every runtime network response with its MIME type and URL-key rules into one self-contained offline SQLite archive ready to replay or unpack: trees.dosaygo.com/go/forum-2026112...

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That naming scheme meets one more check on the runtime side. When it unpacks a package, it refuses one with two entries whose names differ only in case, so embed_v_Abc.html and embed_v_abc.html in the same folder would reject the whole package. It also caps a package at 5,000 files and 200 MB. An exporter that turns query values into file names would have to lowercase them or add a short hash. How many responses does a typical TDF capture of a busy page hold, with all its iframes and media?

Thread Thread
 
dosaygo profile image
dosaygo •

Measured two captures from yesterday, one page each.

A vendor pricing page: 199 responses from 57 hosts in a 2.7 MB archive. Most of those hosts are trackers and tag loggers. 126 of the rows are GETs, 18 are POST beacons and 5 are OPTIONS preflights, so the exporter writes 126 files at most.

A game store page with trailers: 350 responses from 8 hosts in a 21.8 MB archive, 317 of them GETs. 13 rows are video and 13 audio, about 13 MB between them. Media arrives as segments, so that count follows how much of a trailer played during the capture and not how many videos the page embeds.

So a single busy page is a few hundred files and tens of MB, far inside 5,000 and 200 MB. A session is what hits the cap: twenty pages like these in one archive is 4,000 to 7,000 rows. The exporter should cut one package per page and refuse to turn a whole session into one app.

On case, hash and don't lowercase. Query values are case-sensitive often enough (video ids, signed tokens) that lowercasing merges two different responses into one file, which is the collision you started with. A lowercased path plus the first 8 hex characters of a SHA-256 over the exact stored key is unique on any filesystem, and the rewrite table falls out of the same pass. Neither of these two captures had keys that differ only in case, but one video embed is enough to produce them.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo Hashing is the better call, agreed: lowercasing would merge two real responses into one file. Your trailer numbers raise one more runtime detail. It answers every request with status 200 and the whole file; there is no support for Range requests or 206 partial responses. A short clip served that way is fine, but a player that asks for byte ranges gets the full file each time, and I have not tested whether every platform's video element accepts that. Were the 13 video segments in your capture fetched by script, through Media Source Extensions, or requested by a plain video element?

Thread Thread
 
dosaygo profile image
dosaygo •

By script, through Media Source Extensions. Nothing in that capture came from a plain video element.

The page loads a DASH manifest (dash_av1.mpd, 3 KB) and its player fetches one .m4s file per three-second segment, then appends each to a SourceBuffer. I went back through the archive: all 350 responses are status 200, none carries a Content-Range header, and the 26 media rows are an init file plus 12 chunks for the 720p video stream and the same again for audio. The manifest uses SegmentTemplate, so every segment has its own URL and the player never asks for a byte range. A handler that answers 200 with the whole file serves this page as it stands.

Range matters for the other kind of page: one progressive .mp4 on a plain video element. Chrome plays that from a 200 but cannot seek past what it has buffered, and Safari refuses to play without 206. The exporter can sort captures on that. Segmented media goes through; a lone .mp4 of more than a few MB gets a warning.

Two things on this page break before Range does. The player attaches to the video element with a blob: URL from URL.createObjectURL, so the policy needs media-src blob: or the element stays empty. And the manifest lists four video renditions while the capture holds only the one that played, so the exporter has to cut the manifest down to stream 1 and the audio stream, or the first bitrate switch asks for a file that is not in the package.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo Good news on the first one: media-src already allows blob:, so the player can attach its MediaSource as it is. The tighter rule is the fetch. The segments are loaded by script, so connect-src decides, and it allows only the package itself, plus allowedHosts on the desktop tier. A manifest whose BaseURL or SegmentTemplate points at the CDN's absolute address would have every segment request blocked, even with all the files sitting in the package. The exporter would have to rewrite those addresses to relative ones, next to cutting the manifest down to the stream that played. In the DASH manifests you capture, are segment addresses usually relative, or absolute with the CDN host?

Thread Thread
 
dosaygo profile image
dosaygo •

Relative, in this one. The manifest has no BaseURL element anywhere, and every Representation carries the same SegmentTemplate: initialization="dash_av1/init-stream$RepresentationID$.m4s" and media="dash_av1/chunk-stream$RepresentationID$-$Number%05d$.m4s". The player resolves those against the manifest's own address, so put the manifest in the package with dash_av1/ beside it and every segment request stays inside connect-src. No address inside the manifest needs rewriting.

The absolute address is one level up. The store page's HTML names the manifest by full URL on the CDN host, a different host from the page, with a ?t= query on it. It sits in a JSON blob in the page, and that string is the one the exporter rewrites.

"Usually" I can't give you from captures: this is the only DASH manifest I have pulled out of a capture, a sample of one. What decides it is the packager. These file names are ffmpeg's DASH muxer defaults with a directory in front, and ffmpeg writes relative templates unless someone adds a BaseURL, which sites do when segments come from a second CDN. So the exporter needs both paths. Resolve each template against BaseURL, or the manifest URL when there is none, the way the player does. Look the result up in the capture (rows are keyed by full URL, so the match is exact), write the file, and emit a relative template with the BaseURL dropped.

One more for the trim. The manifest says mediaPresentationDuration="PT3M2.0S", which is 61 segments, and the capture holds 12. Cut the duration to 36 seconds along with the renditions, or the player asks for chunk 13. The third AdaptationSet, AVIF thumbnail tiles, has no rows in the capture either; drop it.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That settles the manifest side: a relative template and one absolute string in the page JSON is a small rewrite. The file types are the next thing the runtime decides by extension. The .mpd file would be served as application/dash+xml, but .m4s is not in its type table, so every segment goes out as application/octet-stream. Most MSE players fetch segments as raw bytes and do not look at the type, but I have not tested that here. What content type did the CDN send for the .m4s files in your capture?

Thread Thread
 
dosaygo profile image
dosaygo •

video/mp4 on the video stream's files and audio/mp4 on the audio stream's, init file and chunks alike, 13 rows of each. The .mpd came as application/dash+xml. None of the 26 segment responses carries X-Content-Type-Options, and all of them have Access-Control-Allow-Origin: *.

Your octet-stream is fine for this page, and that comes from the page's own player, which is in the capture too. It downloads each segment with responseType: "arraybuffer" and reads no response header on those requests. The string it passes to addSourceBuffer is built from the manifest: the Representation's mimeType attribute, then ;codecs=, then its codecs attribute. So video/mp4;codecs=av01.0.08M.08 comes out of the XML and the server's label is never looked at. The only header that script reads anywhere is Date, on the manifest response, and it uses it for live streams only.

The label matters where the browser itself is the consumer: module scripts, stylesheets, WebAssembly.instantiateStreaming. Bytes a script fetches and appends are typed by whoever appends them. Adding .m4s to the table changes nothing a player sees.

One thing the CDN's answer does show: the type is per stream, not per extension. Audio and video segments share .m4s here, so a table keyed on extension could not reproduce what the CDN sent even with the entry added. The capture keeps the type on each row, next to the body.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo That narrows the risk to the three cases you list, and the runtime's table covers all three when the file keeps its extension: .js and .mjs go out as JavaScript, .css as text/css, .wasm as application/wasm, so module scripts, stylesheets and instantiateStreaming all get the type they need. The gap is a script saved under a path with no extension: it would go out as octet-stream, and the browser refuses to run it as a module. So the exporter should name files from the type stored on each row, not from the URL. In your captures, how often do scripts come from URLs with no extension at all?

Thread Thread
 
dosaygo profile image
dosaygo •

Counted it on three captures, scripts with a body only.

Steam store page: 145 scripts, all 145 end in .js. Bitwarden's pricing page: 68 scripts, 55 end in .js and 13 don't. A Newegg product page that came back as a Cloudflare challenge: 2 scripts, one of them /cdn-cgi/challenge-platform/.../v1.

All 13 on the Bitwarden page come from other hosts: /gtag/js three times, Facebook's /signals/config/<id>, two from doubleclick, four from one ad network, clarity, zoominfo, and cdn.jsdelivr.net/npm/search-insights@2.17.3. None is from bitwarden.com. The site's own entry point is a module and it ends in .js. So what a site builds keeps its extension, and what gets injected by a tag manager often has none. Those injected ones are classic scripts, and a browser runs a classic script served as octet-stream as long as you don't send nosniff. Only the module gets refused.

The jsdelivr one is the case to design for. It's a real library, the tag manager's script loads it, and a table keyed on extension reads its extension as .3. And /gtag/js is three rows with three query strings and three different bodies, so a file name built from the path collides before the type question comes up. Naming from the row fixes both: the stored type picks the extension, the full URL with its query picks the name.

Thread Thread
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@dosaygo The jsdelivr URL has one more detail. I requested it just now: the CDN sends application/javascript together with X-Content-Type-Options: nosniff. So if an export replayed the original headers but served that body as octet-stream, the browser would refuse it even as a classic script, and the tag manager's search tracking would break without an error on the page. /gtag/js came back as application/javascript with no nosniff, so it would still run. That settles the rule for me: the stored type always goes out with the body, and stored headers never go out without it. For the name, a hash of the full URL with its query, plus the extension from the stored type. Does your capture keep all response headers on each row, or only the type?

Thread Thread
 
dosaygo profile image
dosaygo •

All of them. Each row has a headers column with the full list of name and value pairs the browser received, and content_type is a separate column beside it.

The jsdelivr row in the Bitwarden capture has 19 headers, and x-content-type-options: nosniff is one of them, so the capture from 28 November agrees with what you fetched today. 60 of that capture's 199 rows carry nosniff. None of the /gtag/js rows do.

Three things in those rows your exporter should know about. No row has Content-Encoding and the bodies are already decoded, so nothing needs inflating. No row has Set-Cookie. And 82 of the 199 rows have an empty body with canonical_key filled in: the URL exactly as the browser asked for it is kept as its own row, and the bytes sit once under the normalized key, the one with its query parameters sorted. The exporter has to follow canonical_key before it writes a file. Hash that key for the name and the 82 collapse into the files they point at.

Collapse
 
the_daily_flare profile image
The daily flare •

Would I still get a 20 KB Pomodoro install in 0.47 seconds on Linux, or is that Mac only?

Collapse
 
vladimir_beskorovainyi profile image
Vladimir Beskorovainyi •

@the_daily_flare The package is the same on Linux: the same three files, app.json, index.html and icon.png, about 10 KB of content, so it takes about the same space. The launcher is where Linux is lighter. On a Mac it is a 148 KB app bundle in Applications; on Linux it is one small text file, a .desktop entry in ~/.local/share/applications, plus a copy of the icon, and the runtime then calls update-desktop-database so the menu picks it up. The 0.47 seconds I measured only on a Mac, so I can't give you a Linux number yet. Which desktop are you on, GNOME, KDE or something else, and does the app show up in the menu right after install there?