LinkedIn Job Navigator

Navigate LinkedIn jobs and pages using arrow keys and apply to jobs with 'S' key press

目前为 2024-06-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         LinkedIn Job Navigator
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Navigate LinkedIn jobs and pages using arrow keys and apply to jobs with 'S' key press
// @icon         https://www.google.com/s2/favicons?sz=64&domain=linkedin.com
// @match        *://www.linkedin.com/jobs/*
// @match        *://*.linkedin.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    let currentIndex = 0;

    document.addEventListener('keydown', function(event) {
        // Navigate job listings on LinkedIn Jobs page
        if (window.location.href.includes('www.linkedin.com/jobs/')) {
            let jobLists = document.querySelectorAll(".job-card-container");

            if (!jobLists.length) return;

            switch(event.key) {
                case "ArrowDown":
                    if (currentIndex < jobLists.length - 1) {
                        currentIndex++;
                        jobLists[currentIndex].scrollIntoView({ behavior: 'smooth', block: 'center' });
                        jobLists[currentIndex].click(); // Simulate click to select the job.
                    }
                    break;
                case "ArrowUp":
                    if (currentIndex > 0) {
                        currentIndex--;
                        jobLists[currentIndex].scrollIntoView({ behavior: 'smooth', block: 'center' });
                        jobLists[currentIndex].click(); // Simulate click to select the job.
                    }
                    break;
                case "s":
                    // Simulate click to apply for the selected job
                    let applyButton = document.querySelector(".jobs-apply-button");
                    if (applyButton) {
                        applyButton.click();
                    } else {
                        alert("Apply button not found. Please select a job first.");
                    }
                    break;
            }
        }

        // Navigate LinkedIn pages
        if (window.location.href.includes('linkedin.com/')) {
            if (event.key === "ArrowRight") {
                // Logic for moving to the next page
                const nextPageElement = document.querySelector('.active').nextElementSibling;
                if (nextPageElement) {
                    nextPageElement.querySelector('button').click();
                }
            } else if (event.key === "ArrowLeft") {
                // Logic for moving to the previous page
                const previousPageElement = document.querySelector('.active').previousElementSibling;
                if (previousPageElement) {
                    previousPageElement.querySelector('button').click();
                }
            }
        }
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址