Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

docs(chrome): explain PDF base64 overhead

16Mikuee4e10445586
diff --git a/src/chrome/src/offscreen/pdf-extraction-host.js b/src/chrome/src/offscreen/pdf-extraction-host.js
index ccbfe9703..e5c37d22a 100644
--- a/src/chrome/src/offscreen/pdf-extraction-host.js
+++ b/src/chrome/src/offscreen/pdf-extraction-host.js
@@ -37,6 +37,8 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
const bytes = await fetchPdfBytes(url);
// PDF.js can transfer and detach the input buffer. Encode the optional
// Claude document before parsing so text and document use the same fetch.
+ // The ~4/3 base64 message overhead is intentional to preserve that
+ // single-fetch, byte-identical guarantee.
const pdfBase64 = message.options?.includeBase64 === true
&& bytes.length <= PDF_PASSTHROUGH_MAX_BYTES
? bytesToBase64(bytes)