Compare commits
13 Commits
9560208b93
...
aula-ad-bl
| Author | SHA1 | Date | |
|---|---|---|---|
| 39581b5404 | |||
| 8e63c4e09c | |||
| 0b1d4d49e6 | |||
| c09d713887 | |||
| 4c4c518460 | |||
| 62e0305d43 | |||
| 39d1386977 | |||
| 8e2e081155 | |||
| 054f0d7b92 | |||
| 9559111ba6 | |||
| 088deb0cb3 | |||
| 6d550a9f02 | |||
| 67c2fab8e7 |
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
|
||||
|
||||
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 = [];
|
||||
|
||||
// Load excludes.txt first
|
||||
async function loadKeywords() {
|
||||
try {
|
||||
const response = await fetch(chrome.runtime.getURL("excludes.txt"));
|
||||
const text = await response.text();
|
||||
try {
|
||||
const response = await fetch(chrome.runtime.getURL("keywords.txt"));
|
||||
const text = await response.text();
|
||||
|
||||
keywords = text
|
||||
.split("\n")
|
||||
.map(k => k.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
keywords = text
|
||||
.split("\n")
|
||||
.map(k => k.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
|
||||
console.log("Loaded keywords:", keywords);
|
||||
console.log("Loaded keywords:", keywords);
|
||||
|
||||
startFiltering(); // start only after keywords are ready
|
||||
startFiltering();
|
||||
|
||||
} catch (error) {
|
||||
console.error("Failed to load excludes.txt:", error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to load keywords.txt:", error);
|
||||
}
|
||||
}
|
||||
|
||||
function filterNotifications() {
|
||||
const notifications = document.querySelectorAll('div[role="button"]');
|
||||
const notifications = document.querySelectorAll('div[role="button"]');
|
||||
|
||||
notifications.forEach(notification => {
|
||||
const text = notification.innerText.toLowerCase();
|
||||
notifications.forEach(notification => {
|
||||
const text = notification.innerText.toLowerCase();
|
||||
|
||||
const containsKeyword = keywords.some(keyword =>
|
||||
text.includes(keyword)
|
||||
);
|
||||
const containsKeyword = keywords.some(keyword =>
|
||||
text.includes(keyword)
|
||||
);
|
||||
|
||||
if (containsKeyword) {
|
||||
notification.remove();
|
||||
}
|
||||
});
|
||||
if (containsKeyword) {
|
||||
notification.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startFiltering() {
|
||||
// Run once
|
||||
filterNotifications();
|
||||
|
||||
// Watch for dynamically loaded notifications
|
||||
const observer = new MutationObserver(() => {
|
||||
filterNotifications();
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
const observer = new MutationObserver(() => {
|
||||
filterNotifications();
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
// Start everything
|
||||
loadKeywords();
|
||||
@@ -1,5 +0,0 @@
|
||||
tenancy
|
||||
bedroom available
|
||||
spacious room
|
||||
i'm looking for a place to rent
|
||||
short-term let available
|
||||
11
keywords.txt
Normal file
11
keywords.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
tenancy
|
||||
bedroom available
|
||||
bedroom is available
|
||||
spacious room
|
||||
i'm looking for a place to rent
|
||||
short-term let available
|
||||
i am looking for accomodation
|
||||
i'm looking for accomodation
|
||||
fully furnished house
|
||||
ensuite room available
|
||||
room available cv13gx queens park house unite student
|
||||
@@ -13,8 +13,18 @@
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["excludes.txt"],
|
||||
"resources": ["keywords.txt"],
|
||||
"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