Indeed Autofill

Automatically applies to Indeed applications once you've hit apply.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

/* globals jQuery, $, waitForKeyElements */
// ==UserScript==
// @name         Indeed Autofill
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Automatically applies to Indeed applications once you've hit apply.
// @author       ganondorc
// @match        https://m5.apply.indeed.com/beta/indeedapply/*
// @require      https://code.jquery.com/jquery-3.6.0.min.js
// @icon         https://www.google.com/s2/favicons?sz=64&domain=indeed.com
// @license      GNU GPLv3
// @grant        none
// ==/UserScript==

var $ = jQuery;
$.expr[":"].contains = $.expr.createPseudo(function(arg) {
    return function( elem ) {
        return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
    };
});
window.setInterval(function() {
    if ($('body:contains("Answer this question to continue")').length > 0) {
        // If it does, stop
        return;
    }

    var bachelorRadioButton = $('input[type="radio"][value*="Bachelor\'s"]:first');
    var resumeElement = $('span[title="MY NAME.pdf"]');
    var submitApplicationElement = $('div:contains("Submit your application")');
    var addSupportingDocumentsElement = $('a[aria-label="Add Supporting documents"]');
    var editSupportingDocumentsElement = $('a[aria-label="Edit Supporting documents"]');
    var relevantExperienceElement = $('span:contains("Relevant experience")');
    var continueToApplicationElement = $(":contains('Continue to application')");
    var previousCoverLetterAvailableElement = $("span:contains('Previous cover letter available')");
    var declineToIdentifyRadioElement = $("label:contains('I decline to identify') input[type='radio']");
    var protectedVeteranRadioElement = $('label:contains("I IDENTIFY AS ONE OR MORE OF THE CLASSIFICATIONS OF PROTECTED VETERAN LISTED ABOVE") input[type="radio"]');
    var disabilityRadioElement = $('label:contains("Yes, I Have A Disability, Or Have A History/Record Of Having A Disability") input[type="radio"]');

    var continueButton = $("button.ia-continueButton");

    bachelorRadioButton.prop("checked", true).change().trigger("click").trigger("submit");

    if (resumeElement.length) {
        resumeElement.click();
        continueButton.click();
    }

    if (submitApplicationElement.length && addSupportingDocumentsElement.length) {
        var selector = 'div.ia-Review-EmptyDocuments a';
        var element = document.querySelector(selector);
        if (element) {
            var rect = element.getBoundingClientRect();
            var clickEvent = new MouseEvent("click", {
                "view": window,
                "bubbles": true,
                "cancelable": false,
                "clientX": rect.left + 16,
                "clientY": rect.top + 13
            });
            element.dispatchEvent(clickEvent);
        }
    }

    if (editSupportingDocumentsElement.length) {
        continueButton.click();
    }

    if (relevantExperienceElement.length) {
        continueButton.click();
    }

    if(continueToApplicationElement.length === 0) {
        $('span:contains("Return to job search")').click();
    }

    if (previousCoverLetterAvailableElement.length) {
        previousCoverLetterAvailableElement.click();
        continueButton.click();
    }

    if (declineToIdentifyRadioElement.length) {
        declineToIdentifyRadioElement.click();
        $("select option:contains('I decline to identify')").prop('selected', true);
        continueButton.click();
    }

    if (protectedVeteranRadioElement.length) {
        protectedVeteranRadioElement.prop('checked', true);
        continueButton.click();
    }

    if (disabilityRadioElement.length) {
        disabilityRadioElement.prop('checked', true);
        continueButton.click();
    }


    $('button#downshift-0-toggle-button span span').text("Weekday");
    // $("#downshift-0-toggle-button").click();
    $('button#downshift-1-toggle-button span span').text("Anytime");
    // $("#downshift-1-toggle-button").click();

}, 1000);
jQuery.noConflict();