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 <noreply@anthropic.com>
This commit is contained in:
@@ -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) ---
|
||||
|
||||
Reference in New Issue
Block a user