New Project: Disable Workday - disable links to blacklisted job hunting websites with cunty web forms
This commit is contained in:
20
disable_workday/manifest.json
Normal file
20
disable_workday/manifest.json
Normal 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"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
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