New Project: Disable Workday - disable links to blacklisted job hunting websites with cunty web forms

This commit is contained in:
2024-09-30 16:06:21 +01:00
parent b57b77569f
commit 0d2c91add0
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
{
"manifest_version": 2,
"name": "Blacklist Domain Disabler",
"version": "1.0",
"description": "Disables buttons and onclick methods for blacklisted domains on specific sites",
"permissions": [
"activeTab"
],
"content_scripts": [
{
"matches": [
"*://*.example.org/*",
"*://*.example.edu/*",
"*://*.linkedin.com/*"
],
"js": ["content.js"]
}
]
}

View 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 });