Indeed UX+

Reveals hidden reviews, Removes Archived, Saved & Applied Job Posts from showing up & Allows select Job Posts via Arrow Keys

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Indeed UX+
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Reveals hidden reviews, Removes Archived, Saved & Applied Job Posts from showing up & Allows select Job Posts via Arrow Keys
// @author       TigerYT
// @include      *://*.indeed.tld/*
// @icon         https://uk.indeed.com/images/favicon.ico
// @grant        GM_addStyle
// @grant        GM_registerMenuCommand
// @license      The Unlicense
// ==/UserScript==

(function checkDocumentReady() { document.readyState === 'complete' ? executeUsercript() : setTimeout(checkDocumentReady, 0); })();

function executeUsercript() {
    'use strict';

    const customCSS = `
#reviewDescription {
    :is(&, & + div) {
        :is([itemprop="reviewBody"] > span, h2 + div) {
            &, * {
                background-color: rgba(0, 0, 0, 0) !important;
                color: rgb(89, 89, 89) !important;
                font-weight: 400 !important;
                text-shadow: none !important;
                -webkit-user-select: auto !important;
                user-select: auto !important;
            }
        }
    }

    & ~ button {
        display: none !important;
    }
}
    `;
    GM_addStyle(customCSS);

    let getViewJobPanelElem = () => document.getElementById('jobsearch-JobFullDetailsTitle')?.parentElement.querySelector('.fastviewjob');
    let getJobResultsPanelElem = () => document.getElementById('mosaic-provider-jobcards')?.firstElementChild;
    let allPosts = Array.from(getJobResultsPanelElem()?.children ?? []);
    let getJobPosts = () => allPosts.filter((jobPost) => jobPost.firstElementChild.classList.contains('tapItem')).map((({firstElementChild}) => firstElementChild));
    let getVisiblePosts = () => getJobPosts().filter((jobPostElem) => !jobPostElem.classList.contains('disliked'));
    let getCurrentJobPostId = () => getViewJobPanelElem()?.querySelector('.jobsearch-HeaderContainer a')?.href.split("&fromjk=")[1];
    let getCurrentJobPostElem = () => getVisiblePosts().find((jobPostElem) => getCurrentJobPostId() == getjobPostId(jobPostElem));
    let getCurrentJobPostElemIndex = () => getVisiblePosts().findIndex((jobPostElem) => getCurrentJobPostId() == getjobPostId(jobPostElem));
    let getjobPostId = (jobPostElem) => jobPostElem.className.split(' ').find((classStr) => classStr.startsWith('job_'))?.slice(4);

    /* Hide All Saved Job Posts */
    getJobPosts().forEach((jobPostElem) => {
        let jobPostId = getjobPostId(jobPostElem);

        if ((jobPostElem.querySelector('div.underShelfFooter span')?.textContent.startsWith('Saved ') || jobPostElem.querySelector('div.underShelfFooter span')?.textContent.startsWith('Archived ') || jobPostElem.querySelector('.mainContentTable div[data-testid="appliedSnippet"]')?.textContent == 'Applied') && !jobPostElem.classList.contains('disliked')) {
            jobPostElem.classList.add('disliked');
            if (jobPostId == getCurrentJobPostId() || !getCurrentJobPostElem()) getViewJobPanelElem()?.firstElementChild?.click();
        } else if (jobPostId == getCurrentJobPostId()) getCurrentJobPostElem().classList.add('vjs-highlight');

    });

    /* Allow Arrow Keys to Select Job Posts */

    let newJobPostElemIndex, currentJobPostElemIndex
    newJobPostElemIndex = currentJobPostElemIndex = getCurrentJobPostElemIndex();

    let jobPostSelector = (e) => {
        let upKey = ['ArrowUp', 'ArrowLeft'].includes(e.key);
        let downKey = ['ArrowDown', 'ArrowRight'].includes(e.key);

        if (!getCurrentJobPostElem()) getViewJobPanelElem()?.firstElementChild?.click();

        if (currentJobPostElemIndex > 0 && upKey) newJobPostElemIndex--;
        else if (currentJobPostElemIndex < (getVisiblePosts().length - 1) && downKey) newJobPostElemIndex++;
        else return;

        let newJobPostElem = getVisiblePosts()[newJobPostElemIndex];
        let newJobPostId = getjobPostId(newJobPostElem);

        newJobPostElem.scrollIntoView({ behavior: 'auto', block: 'center', inline: 'center' });
        document.querySelector(`#sj_${newJobPostId}, #job_${newJobPostId}`).click();

        currentJobPostElemIndex = newJobPostElemIndex;
    }

    window.addEventListener('keydown', (e) => jobPostSelector(e));
}

// Register context menu option
GM_registerMenuCommand("Execute", executeUsercript);