From 0d2c91add04e1329c488ba109af773b884c566d9 Mon Sep 17 00:00:00 2001 From: teddy Date: Mon, 30 Sep 2024 16:06:21 +0100 Subject: [PATCH] New Project: Disable Workday - disable links to blacklisted job hunting websites with cunty web forms --- disable_workday/manifest.json | 20 ++++++++++++++++++ disable_workday/scripts/content.js | 34 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 disable_workday/manifest.json create mode 100644 disable_workday/scripts/content.js diff --git a/disable_workday/manifest.json b/disable_workday/manifest.json new file mode 100644 index 0000000..5cdad37 --- /dev/null +++ b/disable_workday/manifest.json @@ -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"] + } + ] +} + \ No newline at end of file diff --git a/disable_workday/scripts/content.js b/disable_workday/scripts/content.js new file mode 100644 index 0000000..f5ab95b --- /dev/null +++ b/disable_workday/scripts/content.js @@ -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 }); \ No newline at end of file