Auto-deploy: 2026-05-17 02:22:51

This commit is contained in:
Hamza-Ayed
2026-05-17 02:22:51 +03:00
parent e388ccab30
commit dfbb8b4023

View File

@@ -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);
return questions.slice(0, 15); // Max 15 questions
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';
questions.push({ question: text, type: inputType });
}
});
return questions.slice(0, 15);
}
// ─── Overlay Injection ───────────────────────────────────────────────────