Greasy Fork is available in English.
test
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/522876/1515248/lbtest.js
(function() {
'use strict';
const listPageChannel = new BroadcastChannel('jobDetailsChannel'); // 创建频道
let listPageDocument = document; // 列表页的 document
console.log('List page document:', listPageDocument);
// 监听来自其他页面的消息
listPageChannel.addEventListener('message', function(event) {
if (event.data.type === 'hideJobItem') {
const { nameText, salary, bossInfo } = event.data.data;
console.log('Received message in list page:', nameText, salary, bossInfo);
hideJobItems(nameText, salary, bossInfo);
}
});
// 隐藏指定职位
function hideJobItems(nameText, salary, bossInfo) {
const jobListItems = listPageDocument.querySelectorAll('.your-list-item-selector'); // 替换为实际的选择器
jobListItems.forEach(function(item) {
const itemText = item.textContent;
const matchesName = nameText === '' || itemText.includes(nameText);
const matchesSalary = salary === '' || itemText.includes(salary);
const matchesBossInfo = bossInfo === '' || itemText.includes(bossInfo);
if (matchesName && matchesSalary && matchesBossInfo) {
item.style.display = 'none';
console.log('Hiding job item:', item);
}
});
}
})();