# Browser AI privacy: exact source excerpts

Evidence class: **source-reviewed**, September 7, 2026. These are source excerpts, not captured requests.

The site patch and cache files were reviewed from the working source; use the SHA-256 in `source-review.json` to identify each full input. The recovered bundle is the input to the runtime patch. Excerpts retain original text, without formatting or renaming identifiers. Line numbers refer to the original input file. The minified excerpt uses zero-based UTF-8 byte offsets with an exclusive end.

## Whisper local file picker

Source: `recovered-netlify-dist/assets/index-cce58688.js`, UTF-8 byte offsets 26794–26988 (end exclusive).

```javascript
function je(){const i=document.createElement("input");return i.type="file",i.accept="audio/*",i.click(),new Promise(e=>{i.onchange=t=>{const s=t.target.files[0],n=URL.createObjectURL(s);e(n)}})}
```

## Whisper decoded input to worker

Source: `scripts/whisper-runtime-patch.mjs`, lines 135–150.

```javascript
  try{
    const source=t.current?.getMediaElement()?.src;
    if(!source)throw new Error("Load an audio file before transcribing.");
    const response=await fetch(source);
    if(!response.ok)throw new Error("The audio file could not be loaded.");
    const bytes=await response.arrayBuffer();
    audioContext=new AudioContext({sampleRate:16000});
    const decoded=await audioContext.decodeAudioData(bytes);
    let samples;
    if(decoded.numberOfChannels===2){
      const left=decoded.getChannelData(0),right=decoded.getChannelData(1);
      samples=new Float32Array(left.length);
      for(let index=0;index<samples.length;index++)samples[index]=Math.sqrt(2)*(left[index]+right[index])/2;
    }else samples=decoded.getChannelData(0);
    if(!samples.length)throw new Error("The audio file contains no decoded samples.");
    y.postMessage({action:"transcribe",src:samples,language,requestId});

```

## Whisper model loader

Source: `scripts/whisper-runtime-patch.mjs`, lines 29–46.

```javascript
    if (data.action === "modalLoad") {
      try {
        if (!loading) {
          loading = Promise.resolve().then(() => pipelineFactory("automatic-speech-recognition", "whisper-tiny", {
            quantized: true,
            progress_callback: ({ file = "", progress } = {}) => {
              if (file.includes("decoder_model_merged_quantized") && Number.isFinite(progress)) {
                worker.postMessage({ action: "progress", progress: Math.max(0, Math.min(100, Math.round(progress))) });
              }
            },
            config: null,
            cache_dir: "/models/whisper-tiny",
            local_files_only: true,
          })).then((model) => {
            if (typeof model !== "function") throw new Error("Invalid transcription pipeline");
            transcriber = model;
            return model;
          });

```

## Whisper inference and text return

Source: `scripts/whisper-runtime-patch.mjs`, lines 67–84.

```javascript
    if (!(data.src instanceof Float32Array) || data.src.length === 0) {
      sendError("transcribe", "INVALID_AUDIO", "No decoded audio was available. Load an audio file and try again.", requestId);
      return;
    }
    const language = languages.has(data.language) ? data.language : "chinese";
    busy = true;
    try {
      const result = await transcriber(data.src, {
        language,
        task: "transcribe",
        chunk_length_s: 30,
        stride_length_s: 2,
        chunk_callback: ({ isLast, tokens }) => {
          const text = transcriber.tokenizer.decode(tokens, { skip_special_tokens: true });
          worker.postMessage({ action: "chunkChange", requestId, chunk: { isLast, tokens: text } });
        },
      });
      worker.postMessage({ action: "transcribeComplete", requestId, text: typeof result?.text === "string" ? result.text : null });

```

## Model cache service worker

Source: `scripts/model-runtime-cache.sw.js`, lines 1–42.

```javascript
const MODEL_CACHE = "ai-creator-models-v2";
const LEGACY_CACHES = new Set(["my-cache", "ai-creator-models-v1"]);
const MODEL_EXTENSIONS = /\.(?:onnx|bin|wasm|json)$/i;

self.addEventListener("install", (event) => {
  // Models are intentionally not pre-cached. Each tool downloads only the
  // files it actually requests, which avoids a multi-model download on every
  // first visit and keeps a missing optional model from breaking installation.
  event.waitUntil(self.skipWaiting());
});

self.addEventListener("activate", (event) => {
  event.waitUntil((async () => {
    const cacheNames = await caches.keys();
    await Promise.all(cacheNames
      .filter((name) => LEGACY_CACHES.has(name))
      .map((name) => caches.delete(name)));
    await self.clients.claim();
  })());
});

self.addEventListener("fetch", (event) => {
  const request = event.request;
  const url = new URL(request.url);
  const isModelRequest = request.method === "GET"
    && url.origin === self.location.origin
    && (MODEL_EXTENSIONS.test(url.pathname) || url.pathname.startsWith("/models/"));

  if (!isModelRequest || request.headers.has("range")) return;

  event.respondWith((async () => {
    const cache = await caches.open(MODEL_CACHE);
    const cached = await cache.match(request);
    if (cached) return cached;

    const response = await fetch(request);
    if (response.ok && response.type === "basic") {
      await cache.put(request, response.clone());
    }
    return response;
  })());
});

```

## Related editor provider handoff

Source: `recovered-netlify-dist/resources/evidence/2026-09-07/generation-plugin/upstream/src/plugins/generation/providers/puter/adapter.js`, lines 108–123.

```javascript
    async generate({ request }) {
      const prompt = String(request.prompt || "").trim();
      if (request.mode === "text-to-image") {
        const isXai = String(request.model).startsWith("grok-");
        const outputPath = isXai ? `generated-images/${crypto.randomUUID()}.jpg` : "";
        let storedBlob = null;
        try {
          const image = await puter.ai.txt2img(prompt, {
            model: request.model,
            ...(isXai ? { provider: "xai", puter_output_path: outputPath } : {}),
          });
          const source = image.currentSrc || image.src;
          if (outputPath) {
            try { storedBlob = await puter.fs.read(outputPath); } catch { /* Use the direct output while it is alive. */ }
          }
          storedBlob ||= await readMediaBlob(source);

```

## Related editor video handoff

Source: `recovered-netlify-dist/resources/evidence/2026-09-07/generation-plugin/upstream/src/plugins/generation/providers/puter/adapter.js`, lines 141–149.

```javascript
      const ratio = request.ratio || "16:9";
      const duration = Number(request.duration);
      const size = ratio === "9:16" ? "720x1280" : "1280x720";
      const result = await puter.ai.txt2vid(prompt, { model: request.model, seconds: duration, size });
      const normalized = await normalizeVideoResult(result);
      try {
        await waitForVideoMetadata(normalized.video);
        const blob = normalized.blob || await readMediaBlob(normalized.source);
        if (!blob) throw new Error("The generated video could not be downloaded before its temporary URL expired.");

```

## Attribution

Related-editor excerpts: MartinDelophy/ai-video-editor, commit `3684ec4063583c66c80e34e90c655a71d65dad1b`, MIT. The [complete archived license](../generation-plugin/upstream/LICENSE) accompanies the full archived source. The adapter is a separate project and release from AI Creator Whisper. Its SDK implementation and provider servers were not audited here.
