Job Navigation Script

Navigate application sites with arrow keys and submit application with Enter key

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Job Navigation Script
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Navigate application sites with arrow keys and submit application with Enter key
// @author       Your Name
// @match        *://*.wd1.myworkdayjobs.com/*
// @match        *://*.myworkdayjobs.com/*
// @match        *://*.myworkday.com/*
// @match        *://*.myworkdayjobs.com/*
// @match        *://*.wd1.myworkdayjobs.com/*
// @match        *://*.glassdoor.com/*
// @match        *://*.avature.net/*
// @match        *://*.greenhouse.io/*

// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.addEventListener('keydown', function(e) {
        // Check if the focus is on an input field or textarea to avoid interrupting typing
        if (e.target.tagName.toLowerCase() === 'input' || e.target.tagName.toLowerCase() === 'textarea') {
            return;
        }

        switch(e.key) {
            case 'ArrowRight':
                // Attempt to click a next button, if present
                var nextButton = document.querySelector(
                    'button[data-automation-id="bottom-navigation-next-button"], ' +
                    'button[data-automation-id="pageFooterNextButton"], ' +
                    '.next'
                );
                if (nextButton) {
                    nextButton.click();
                }
                break;
            case 'ArrowLeft':
                // Attempt to click a previous button, if present, or go back in history
                var previousButton = document.querySelector('.previous');
                if (previousButton) {
                    previousButton.click();
                } else {
                    window.history.back();
                }
                break;
            case 'Enter':
                // Attempt to click a submit button with specific class, if present
                var submitButton = document.querySelector('button[type="submit"].btn.btn--pill');
                if (submitButton) {
                    submitButton.click();
                }
                break;
            case '`':
                // Autofill fields with placeholder values that include 'No'
                var inputFields = document.querySelectorAll('input, textarea');
                inputFields.forEach(function(field) {
                    if (field.value.trim() === '' && (field.placeholder.toLowerCase().includes('no'))) {
                        field.value = field.placeholder; // Autofill with placeholder value
                    }
                });
                break;
        }
    });
})();