prerender: read non-HTML main documents through response.stream()
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Start by reading src/index.js:58-108, src/index.js:157, src/index.js:172, and src/index.js:259, then check the linked Puppeteer and browserless issues for the required stream measurement. The proposal depends on HTTPResponse.stream() returning the full PDF viewer response; acceptance also calls for local server tests covering extensionless PDF and docx, HTML, size limits, rejection fallback, and one download. Done means the measurement supports the approach and every acceptance check passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
claude --dangerously-skip-permissions --resume f585c3fe-624a-4f4c-9b28-edf7962e7046
Blocked on: puppeteer HTTPResponse.stream() (https://github.com/puppeteer/puppeteer/issues/7863) and https://github.com/microlinkhq/browserless/issues/1022.
Problem
defaultGetMode (src/index.js:259) picks fetch for PDF/media/office only from the URL (isMediaUrl, isPdfUrl, isOfficeUrl). A URL without an extension that serves application/pdf or an office document goes to prerender, where page.content() (src/index.js:172) returns the viewer shell instead of the document.
Prerender also always starts a full parallel got download as a fallback (src/index.js:157). For non-HTML responses that second download is the only way to get the bytes, and it is a plain HTTP client, so it fails where the browser session passed an antibot challenge.
Proposal
Behind an opt-in flag (the existing default stays unchanged):
- In the prerender
evaluate, listen to the main-frame documentresponse. - If its
content-typeis not HTML, callresponse.stream()right away and collect the body (capped atPDF_SIZE_TRESHOLD/ the existing size limits). - Route the bytes into the existing fetch-mode pipeline (
extractSafefor PDF, mutool, pandoc for office,toEncode,src/index.js:58-108) and cancel the parallelfetch. - HTML responses keep the current
page.content()path untouched.
Acceptance
- Only start once the browserless measurement shows
stream()returns the full body for the PDF-viewer case. If it does not, close this issue with the measurement. - Tests against a local server: extensionless PDF, extensionless docx, HTML baseline (unchanged output), body over the size cap,
stream()rejection (falls back to the current behavior). - Prove a single download: server hit count is 1 for the extensionless PDF with the flag on.
- Lingua principale
- JavaScript
- Stelle
- 102
- Fork
- 10
- Merge medio
- 2h 51m
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
bug data-types
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
ClickHouse/clickhouse-js#1293 ·
I maintainer di solito rispondono entro 1 giorno
-
area: tests help wanted size/s
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
DahanItamar/DockNest#368 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100