Compare commits
11 Commits
6d550a9f02
...
aula-ad-bl
| Author | SHA1 | Date | |
|---|---|---|---|
| 39581b5404 | |||
| 8e63c4e09c | |||
| 0b1d4d49e6 | |||
| c09d713887 | |||
| 4c4c518460 | |||
| 62e0305d43 | |||
| 39d1386977 | |||
| 8e2e081155 | |||
| 054f0d7b92 | |||
| 9559111ba6 | |||
| 088deb0cb3 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.DS_Store
|
||||||
|
Archive.zip
|
||||||
|
.amo-upload-uuid
|
||||||
BIN
6fd68f08d4504eb297b6-1.1.xpi
Normal file
BIN
6fd68f08d4504eb297b6-1.1.xpi
Normal file
Binary file not shown.
12
README.md
12
README.md
@@ -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
|
||||||
64
content.js
64
content.js
@@ -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();
|
||||||
@@ -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
|
||||||
@@ -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": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user