bosslbk

boss调用操作列表

目前为 2025-01-04 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/522849/1515095/bosslbk.js

(function() {
    'use strict';

    // 判断当前页面是否为列表页 /geek/job
    const isListPage = window.location.href.includes("/geek/job");

    // 处理列表页的逻辑
    function processListPage() {
        console.log("正在处理列表页...");

        // 获取列表中的所有职位项
        const jobListItems = document.querySelectorAll('.your-list-item-selector'); // 替换为你实际的列表项选择器

        // 监听翻页操作
        const nextPageButton = document.querySelector('.pagination-next');
        if (nextPageButton) {
            nextPageButton.addEventListener('click', function() {
                console.log("翻页了,重新加载列表页面");
                processListPage(); // 重新调用列表页的处理函数
            });
        }

        // 监听 postMessage 事件,接收来自详情页的消息
        window.addEventListener("message", function(event) {
            if (event.data && event.data.type === "hideJobItem" && event.data.data) {
                const nameText = event.data.data.nameText;
                console.log(`接收到隐藏职位的事件: ${nameText}`);
                jobListItems.forEach(function(item) {
                    if (item.textContent.includes(nameText)) {
                        item.style.display = 'none';
                        console.log(`在列表页隐藏职位项: ${nameText}`);
                    }
                });
            }
        });
    }

    // 在页面加载完成后执行,确保元素都存在
    window.addEventListener('load', function() {
        if (isListPage) {
            console.log("页面为列表页");
            processListPage();
        }
    });
})();

QingJ © 2025

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