V1
This commit is contained in:
31
content.js
Normal file
31
content.js
Normal file
@@ -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
|
||||
});
|
||||
13
manifest.json
Normal file
13
manifest.json
Normal file
@@ -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"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user