From dfbb8b4023c70cde12d9a65e3840dfb99b6258d5 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sun, 17 May 2026 02:22:51 +0300 Subject: [PATCH] Auto-deploy: 2026-05-17 02:22:51 --- content.js | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/content.js b/content.js index cf046a6..9859255 100644 --- a/content.js +++ b/content.js @@ -228,34 +228,29 @@ function extractApplicationQuestions() { const questions = []; - const formSelectors = [ - '.jobs-easy-apply-content', - '.jobs-easy-apply-form-section__grouping', - '.fb-dash-form-element' - ]; + const modal = document.querySelector('.artdeco-modal, .jobs-easy-apply-modal, #artdeco-modal-outlet'); + if (!modal) return questions; - for (const sel of formSelectors) { - document.querySelectorAll(sel).forEach(section => { - // Labels - const labels = section.querySelectorAll('label, legend, .fb-dash-form-element__label'); - labels.forEach(label => { - const text = label.textContent.trim(); - if (text && text.length > 3 && text.length < 300) { - // Determine input type - const parent = label.closest('.fb-dash-form-element') || section; - let inputType = 'text'; - if (parent.querySelector('select')) inputType = 'select'; - else if (parent.querySelector('input[type="radio"]')) inputType = 'radio'; - else if (parent.querySelector('textarea')) inputType = 'textarea'; - else if (parent.querySelector('input[type="checkbox"]')) inputType = 'checkbox'; + const labels = modal.querySelectorAll('label, legend'); + const seen = new Set(); - questions.push({ question: text, type: inputType }); - } - }); - }); - } + labels.forEach(label => { + let text = label.textContent.replace(/\*/g, '').replace(/Submit/i, '').trim(); + if (text && text.length > 5 && text.length < 200 && !seen.has(text)) { + seen.add(text); + + let inputType = 'text'; + const parent = label.closest('div') || label.parentElement; + if (parent.querySelector('select')) inputType = 'select'; + else if (parent.querySelector('input[type="radio"]')) inputType = 'radio'; + else if (parent.querySelector('textarea')) inputType = 'textarea'; + else if (parent.querySelector('input[type="checkbox"]')) inputType = 'checkbox'; - return questions.slice(0, 15); // Max 15 questions + questions.push({ question: text, type: inputType }); + } + }); + + return questions.slice(0, 15); } // ─── Overlay Injection ───────────────────────────────────────────────────