From 814492d9b664dd1ad359a2c30e181389c71f430d Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Fri, 6 Mar 2026 17:41:34 -0800 Subject: [PATCH] Skip file upload when input only accepts images, not PDF/DOC Some LinkedIn listings have image-only upload fields (JPG/PNG). Don't attempt to upload a PDF resume to these inputs. Co-Authored-By: Claude Opus 4.6 --- lib/form_filler.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/form_filler.mjs b/lib/form_filler.mjs index c666f70..8d92776 100644 --- a/lib/form_filler.mjs +++ b/lib/form_filler.mjs @@ -573,7 +573,12 @@ Answer:`; if (radios[0]) await radios[0].click().catch(() => {}); } else if (snap.resumeRadios.length === 0 && snap.hasFileInput && resumePath) { const fileInput = await container.$('input[type="file"]'); - if (fileInput) await fileInput.setInputFiles(resumePath).catch(() => {}); + if (fileInput) { + // Skip if the file input doesn't accept our resume format (e.g. image-only uploads) + const accept = await fileInput.getAttribute('accept').catch(() => '') || ''; + const acceptsResume = !accept || /pdf|doc|docx/i.test(accept); + if (acceptsResume) await fileInput.setInputFiles(resumePath).catch(() => {}); + } } // --- Inputs (text/number/url/email/tel) ---