New Project: Disable Workday - disable links to blacklisted job hunting websites with cunty web forms
This commit is contained in:
34
disable_workday/scripts/content.js
Normal file
34
disable_workday/scripts/content.js
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
// content.js
|
||||
const blacklistedDomains = [
|
||||
"linkedin.com",
|
||||
// Add more domains to the blacklist
|
||||
];
|
||||
|
||||
function disableBlacklistedLinks() {
|
||||
const elements = document.querySelectorAll('a, button');
|
||||
|
||||
elements.forEach(element => {
|
||||
const href = element.href || element.onclick?.toString();
|
||||
|
||||
if (href) {
|
||||
const url = new URL(href, window.location.origin);
|
||||
|
||||
if (blacklistedDomains.some(domain => url.hostname.includes(domain))) {
|
||||
element.style.pointerEvents = 'none';
|
||||
element.style.opacity = '0.5';
|
||||
element.onclick = null;
|
||||
element.setAttribute('disabled', 'disabled');
|
||||
element.title = 'This link has been disabled due to blacklisting';
|
||||
element.textContent = 'This link has been disabled due to blacklisting';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Run the function when the page loads
|
||||
disableBlacklistedLinks();
|
||||
|
||||
// Use a MutationObserver to handle dynamically added content
|
||||
const observer = new MutationObserver(disableBlacklistedLinks);
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
Reference in New Issue
Block a user