您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
try to take over the world!
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/522849/1515106/New%20Userscript.js
// ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 2025-01-04 // @description try to take over the world! // @author You // @match *://*/* // @icon https://www.google.com/s2/favicons?sz=64&domain=zhipin.com // @grant none // ==/UserScript== (function() { 'use strict'; console.log('window.hideJobItem before definition', window.hideJobItem); // 判断当前页面是否为列表页 /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.hideJobItem = function(nameText) { console.log(`通过库函数在列表页隐藏职位项: ${nameText}`); const jobListItems = document.querySelectorAll('.your-list-item-selector'); // 替换为你实际的列表项选择器 jobListItems.forEach(function(item) { if (item.textContent.includes(nameText)) { item.style.display = 'none'; } }); }; // 在页面加载完成后执行,确保元素都存在 window.addEventListener('load', function() { if (isListPage) { console.log("页面为列表页"); processListPage(); } }); console.log('window.hideJobItem after definition', window.hideJobItem); })();