diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..1b8f36f Binary files /dev/null and b/.DS_Store differ diff --git a/content.js b/content.js new file mode 100644 index 0000000..fe66e04 --- /dev/null +++ b/content.js @@ -0,0 +1,31 @@ +const keywords = ["tenancy", "bedroom available", "spacious room", "room available cv13GX queens park house unite student"]; + +// Function to check and remove matching notifications +function filterNotifications() { + const notifications = document.querySelectorAll('div[role="button"]'); + + notifications.forEach(notification => { + const text = notification.innerText.toLowerCase(); + + const containsKeyword = keywords.some(keyword => + text.includes(keyword) + ); + + if (containsKeyword) { + notification.remove(); + } + }); +} + +// Run once on load +filterNotifications(); + +// Watch for dynamically loaded notifications +const observer = new MutationObserver(() => { + filterNotifications(); +}); + +observer.observe(document.body, { + childList: true, + subtree: true +}); \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d93fdd3 --- /dev/null +++ b/manifest.json @@ -0,0 +1,13 @@ +{ + "manifest_version": 3, + "name": "Notification Keyword Filter", + "version": "0.2", + "description": "Removes notifications containing specific keywords", + "permissions": [], + "content_scripts": [ + { + "matches": ["https://coventry.aula.education/*"], + "js": ["content.js"] + } + ] +} \ No newline at end of file