11 Commits

7 changed files with 59 additions and 40 deletions

BIN
.DS_Store vendored

Binary file not shown.

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.DS_Store
Archive.zip
.amo-upload-uuid

Binary file not shown.

View File

@@ -1,5 +1,13 @@
# Aula-Extension # Aula-Extension
Browser extension that removes all the notifications about rooms for rent and shit Browser extension that removes all the notifications about rooms for rent and shit
Only tested with chrome
Will remove any notifications containing the any of the 'keywords' in 'excludes.txt' so you can make it hide other stuff too. Will remove any notifications containing the any of the ~keywords~ keyphrases in keywords.txt so you can make it hide other stuff too if you wanted.
I've only tested with Chrome, Brave and Firefox. The easiest way to install this on chromium or similar is to turn on dev mode in chrome://extensions (or equivalent), click on 'Load unpacked' and select the Aula-Extension folder.
For firefox I've built an xpi which is signed (surprisingly difficult), just open a new firefox tab and drag it into the window.
I'm working on getting the extension published on the chrome and firefox stores.
The keyphrases cannot be edited if you're using the prepacked .xpi file. Possibly an oversight and I may fix this at some point

View File

@@ -1,55 +1,51 @@
let keywords = []; let keywords = [];
// Load excludes.txt first
async function loadKeywords() { async function loadKeywords() {
try { try {
const response = await fetch(chrome.runtime.getURL("excludes.txt")); const response = await fetch(chrome.runtime.getURL("keywords.txt"));
const text = await response.text(); const text = await response.text();
keywords = text keywords = text
.split("\n") .split("\n")
.map(k => k.trim().toLowerCase()) .map(k => k.trim().toLowerCase())
.filter(Boolean); .filter(Boolean);
console.log("Loaded keywords:", keywords); console.log("Loaded keywords:", keywords);
startFiltering(); // start only after keywords are ready startFiltering();
} catch (error) { } catch (error) {
console.error("Failed to load excludes.txt:", error); console.error("Failed to load keywords.txt:", error);
} }
} }
function filterNotifications() { function filterNotifications() {
const notifications = document.querySelectorAll('div[role="button"]'); const notifications = document.querySelectorAll('div[role="button"]');
notifications.forEach(notification => { notifications.forEach(notification => {
const text = notification.innerText.toLowerCase(); const text = notification.innerText.toLowerCase();
const containsKeyword = keywords.some(keyword => const containsKeyword = keywords.some(keyword =>
text.includes(keyword) text.includes(keyword)
); );
if (containsKeyword) { if (containsKeyword) {
notification.remove(); notification.remove();
} }
}); });
} }
function startFiltering() { function startFiltering() {
// Run once
filterNotifications();
// Watch for dynamically loaded notifications
const observer = new MutationObserver(() => {
filterNotifications(); filterNotifications();
});
observer.observe(document.body, { const observer = new MutationObserver(() => {
childList: true, filterNotifications();
subtree: true });
});
observer.observe(document.body, {
childList: true,
subtree: true
});
} }
// Start everything
loadKeywords(); loadKeywords();

View File

@@ -1,9 +1,11 @@
tenancy tenancy
bedroom available bedroom available
bedroom is available
spacious room spacious room
i'm looking for a place to rent i'm looking for a place to rent
short-term let available short-term let available
i am looking for accomodation i am looking for accomodation
i'm looking for accomodation i'm looking for accomodation
fully furnished house fully furnished house
ensuite room available ensuite room available
room available cv13gx queens park house unite student

View File

@@ -13,8 +13,18 @@
"web_accessible_resources": [ "web_accessible_resources": [
{ {
"resources": ["excludes.txt"], "resources": ["keywords.txt"],
"matches": ["https://coventry.aula.education/*"] "matches": ["https://coventry.aula.education/*"]
} }
] ],
}
"browser_specific_settings": {
"gecko": {
"id": "aulaadremoverpublic@tussockyjoker.com",
"data_collection_permissions": {
"required": ["none"],
"optional": []
}
}
}
}