Notice
I wrote this article and was originally published on Qiita on 31 August 2021.
Reason to write this
When I look up jobs in "LinkedIn Jobs", I found that there are so much ads posted by job agent. I used so much time every day to filter out these ads. Therefore I wrote this code.
This code is written by pure JavaScript and no 3rd library is used. I tried it on Google Chrome only and it seens that can work on other browser.
How to use the code
- fill your agent list into variable "agentList"
let agentList = [
"ADD YOUR LIST INTO HERE"
];
function highlightAgent() {
document.querySelectorAll("a[data-control-name='job_card_company_link']").forEach(function(currentValue) {
let name = currentValue.text.trim();
let agentName = agentList.find(function(input) {return input === name});
if (agentName !== undefined) {
currentValue.style.backgroundColor = "#FF0000";
}
});
}
window.setInterval(highlightAgent, 5000);
- paste the code into "Console" of "DevTools" (assume that you are using Google Chrome). The highlight function will be run in every 5 seconds, so you can see result at most 5 seconds after you press next page.
It is in active when you press next page, unless you press "reload" of browser.
Top comments (0)