Highlight Best LinkedIn Jobs

Highlights top LinkedIn jobs based on keywords like "Senior", "Remote", "Lead", etc.

// ==UserScript==
// @name         Highlight Best LinkedIn Jobs
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Highlights top LinkedIn jobs based on keywords like "Senior", "Remote", "Lead", etc.
// @author       YourName
// @match        https://www.linkedin.com/jobs/*
// @locale       en
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const HIGHLIGHT_COLOR = '#e6ffe6';  // light green
    const KEYWORDS = ["Senior", "Lead", "Director", "Remote", "Head", "Principal", "Chief"];

    function highlightBestJobs() {
        const jobCards = document.querySelectorAll('[data-job-id]');
        jobCards.forEach(card => {
            const text = card.innerText || "";
            const matched = KEYWORDS.some(keyword => new RegExp(`\\b${keyword}\\b`, 'i').test(text));
            if (matched) {
                card.style.backgroundColor = HIGHLIGHT_COLOR;
                card.style.border = '1px solid #008000';
            }
        });
    }

    // Initial run
    window.addEventListener('load', () => {
        setTimeout(highlightBestJobs, 1000); // slight delay to allow content to load
    });

    // MutationObserver to catch dynamic loading
    const observer = new MutationObserver(() => {
        highlightBestJobs();
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();