Form filler now defaults to page root instead of scoping to [role="dialog"]. LinkedIn Easy Apply passes its modal selector explicitly. Fixes external ATS forms being scoped to wrong container. Also improved Greenhouse handler with targeted resume upload and form detection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
/**
|
|
* greenhouse.mjs — Greenhouse ATS handler (extends generic)
|
|
*
|
|
* Greenhouse boards show the form directly on the page (no Apply button needed).
|
|
* Form ID: #application-form. Resume input: #resume. Submit: "Submit application".
|
|
*/
|
|
import { apply as genericApply } from './generic.mjs';
|
|
|
|
export const SUPPORTED_TYPES = ['greenhouse'];
|
|
|
|
export async function apply(page, job, formFiller) {
|
|
return genericApply(page, job, formFiller, {
|
|
formDetector: '#application-form',
|
|
submitSelector: 'button:has-text("Submit application"), input[type="submit"]',
|
|
verifySelector: '#application-form',
|
|
beforeSubmit: async (page, formFiller) => {
|
|
if (!formFiller.profile.resume_path) return;
|
|
const resumeInput = await page.$('#resume');
|
|
if (resumeInput) {
|
|
const hasFile = await resumeInput.evaluate(el => !!el.value);
|
|
if (!hasFile) {
|
|
await resumeInput.setInputFiles(formFiller.profile.resume_path).catch(() => {});
|
|
await page.waitForTimeout(1000);
|
|
}
|
|
}
|
|
},
|
|
});
|
|
}
|