Compare commits
48 Commits
62e0305d43
...
V1.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
| bad697fa99 | |||
| b6edcdc8c0 | |||
| 1c839e6b54 | |||
| 843d38bccb | |||
| 21b1ee40e6 | |||
| 46f81a1e81 | |||
| 105ff6e0cd | |||
| fd1452d0ce | |||
|
|
28d5fb6f83 | ||
|
|
b5984fba76 | ||
|
|
ad17674577 | ||
|
|
5fe2d981e8 | ||
| 6f15bf70c6 | |||
| 3c703d7425 | |||
| 91b692593f | |||
| c7b4955291 | |||
| 2706812496 | |||
| a6bd5a5d5c | |||
| bc0f77bfd4 | |||
| c48c5c45ba | |||
| b4a86d0e2d | |||
| 5578b22148 | |||
| 12ceca7bea | |||
| 2c2c5dc3d4 | |||
| 498999d12a | |||
| c0d206a957 | |||
| 36c004b802 | |||
| 8390c0a43e | |||
| 293f5142e6 | |||
| 11830f9e20 | |||
| 8bacbb301e | |||
| 0e71f8ba63 | |||
| 0b10f5f993 | |||
| 366117a93c | |||
| 10fc5f88bc | |||
| e1bd9ad31e | |||
| f76a8db079 | |||
| aaeae49517 | |||
| 100bcb4c2c | |||
| 5900482d93 | |||
| a9c257dc99 | |||
| 6f2198a268 | |||
| f9103ba332 | |||
| 39581b5404 | |||
| 8e63c4e09c | |||
| 0b1d4d49e6 | |||
| c09d713887 | |||
| 4c4c518460 |
2
.env_example
Normal file
2
.env_example
Normal file
@@ -0,0 +1,2 @@
|
||||
API_KEY="YOUR_API_KEY"
|
||||
API_SECRET="YOUR_API_SECRET"
|
||||
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
.DS_Store
|
||||
Archive.zip
|
||||
.amo-upload-uuid
|
||||
dev-resources
|
||||
content copy.js
|
||||
aula-fixer_v1-2.zip
|
||||
.env
|
||||
|
||||
web-ext-artifacts
|
||||
src.pem
|
||||
23
README.md
23
README.md
@@ -1,7 +1,22 @@
|
||||
# Aula-Extension
|
||||
# Aula-Fixer
|
||||
|
||||
Browser extension that removes all the notifications about rooms for rent and shit
|
||||
This is a browser extension that removes all the notifications about rooms for rent and tenancy takeovers etc. from Aula and changes the styling of the pages to stop wasting so much space.
|
||||
|
||||
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.
|
||||
Will remove any notifications containing the any of the ~keywords~ keyphrases in the keywords.txt file stored in this repo, it can also fall back on a local keywords.txt if the server cannot be reached.
|
||||
|
||||
I've only tested with chrome, atm the easiest way to install this is to turn on dev mode in chrome://extensions/, click on 'Load unpacked' and select the Aula-Extension folder.
|
||||
I've only tested with Chrome, Brave and Firefox. The easiest way to install this on chromium or similar is to download the .zip file, extract it somewhere, turn on dev mode in chrome://extensions (or equivalent), clicking on 'Load unpacked' and select the extracted folder. Alternatively clone this repo and select the src folder. I did pack a .crx for this purpose but Chrome has removed the ability to load .crx files 😐
|
||||
|
||||
For Firefox, I've made a signed .xpi which can be found in builds. To install from here, just open a new firefox tab and drag it into the window.
|
||||
|
||||
The Firefox version will often be slightly more up-to-date compared to the chrome version as building for chrome cannot be done from the CLI (afaik).
|
||||
|
||||
I'm working on getting the extension published on both the Chrome and Firefox stores.
|
||||
|
||||
https://addons.mozilla.org/en-GB/firefox/addon/aula-ad-filter/
|
||||
|
||||
https://chromewebstore.google.com/detail/aula-ad-filter/ooghijbicaoiccbkjplnellggncbcgbl?authuser=0&hl=en-GB
|
||||
|
||||
If you just want the 'ad-blocker' function, I've kept a separate branch in this repo.
|
||||
If you have customised keywords.txt, you will have to break the url in 'background.js' so that it falls back on the local keywords.txt file. This only works if you are NOT using the prepackaged extensions or extensions from the chrome/firefox stores, these will only pull from the file in this repo or fall back on the included version if the server cannot be reached. If you think a word or phrase should be added to keywords.txt, either submit a pull request or raise an issue.
|
||||
|
||||
If you would like to build the extension for yourself run /build_scripts/build.sh, which will give you a .zip compatible with most browsers, if you wish to build a Firefox .xpi you will need to get a developer api key and change the id in the manifest.
|
||||
3
build_scripts/build.sh
Executable file
3
build_scripts/build.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
web-ext build --source-dir=./src --artifacts-dir=./builds
|
||||
11
build_scripts/build_ff_listed.sh
Executable file
11
build_scripts/build_ff_listed.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
!/usr/bin/env bash
|
||||
|
||||
source .env
|
||||
|
||||
echo "Building/signing listed firefox extension"
|
||||
mv src/manifest.json src/manifest_temp.json
|
||||
mv src/manifest_ff.json src/manifest.json
|
||||
echo "manifest_ff > manifest"
|
||||
web-ext sign --channel=unlisted --api-key=user:$API_KEY --api-secret=$API_SECRET --source-dir=./src --artifacts-dir=./builds
|
||||
mv src/manifest.json src/manifest_ff.json
|
||||
mv src/manifest_temp.json src/manifest.json
|
||||
10
build_scripts/build_ff_unlisted.sh
Executable file
10
build_scripts/build_ff_unlisted.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source .env
|
||||
|
||||
echo "Building/signing UNlisted firefox extension"
|
||||
mv src/manifest.json src/manifest_temp.json
|
||||
mv src/manifest_ff.json src/manifest.json
|
||||
web-ext sign --channel=unlisted --api-key=user:$API_KEY --api-secret=$API_SECRET --source-dir=./src --artifacts-dir=./builds
|
||||
mv src/manifest.json src/manifest_ff.json
|
||||
mv src/manifest_temp.json src/manifest.json
|
||||
BIN
builds/aula_fixer-1.4.1.xpi
Normal file
BIN
builds/aula_fixer-1.4.1.xpi
Normal file
Binary file not shown.
BIN
builds/aula_fixer-1.4.zip
Normal file
BIN
builds/aula_fixer-1.4.zip
Normal file
Binary file not shown.
51
content.js
51
content.js
@@ -1,51 +0,0 @@
|
||||
let keywords = [];
|
||||
|
||||
async function loadKeywords() {
|
||||
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);
|
||||
|
||||
console.log("Loaded keywords:", keywords);
|
||||
|
||||
startFiltering();
|
||||
|
||||
} catch (error) {
|
||||
console.error("Failed to load keywords.txt:", error);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startFiltering() {
|
||||
filterNotifications();
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
filterNotifications();
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
loadKeywords();
|
||||
11
keywords.txt
11
keywords.txt
@@ -1,11 +0,0 @@
|
||||
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
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Aula Ad Filter",
|
||||
"version": "1.1",
|
||||
"description": "Removes all the notifications about rooms for rent on Aula",
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://coventry.aula.education/*"],
|
||||
"js": ["content.js"]
|
||||
}
|
||||
],
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["keywords.txt"],
|
||||
"matches": ["https://coventry.aula.education/*"]
|
||||
}
|
||||
]
|
||||
}
|
||||
34
src/background.js
Normal file
34
src/background.js
Normal file
@@ -0,0 +1,34 @@
|
||||
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
if (request.type === "GET_KEYWORDS") {
|
||||
|
||||
const remoteUrl = "https://git.wbell.dev/TussockyJoker/Aula-Fixer/raw/branch/main/src/keywords.txt";
|
||||
const localUrl = chrome.runtime.getURL("keywords.txt");
|
||||
|
||||
// remote
|
||||
fetch(remoteUrl)
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error("Remote fetch failed");
|
||||
return response.text();
|
||||
})
|
||||
.then(text => {
|
||||
console.log("Loaded remote keywords");
|
||||
sendResponse({ success: true, data: text });
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn("Remote failed, loading local fallback");
|
||||
|
||||
// local
|
||||
fetch(localUrl)
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
console.log("Loaded local fallback keywords");
|
||||
sendResponse({ success: true, data: text });
|
||||
})
|
||||
.catch(error => {
|
||||
sendResponse({ success: false, error: error.toString() });
|
||||
});
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
89
src/content.js
Normal file
89
src/content.js
Normal file
@@ -0,0 +1,89 @@
|
||||
let keywords = [];
|
||||
|
||||
function loadKeywords() {
|
||||
chrome.runtime.sendMessage({ type: "GET_KEYWORDS" }, (response) => {
|
||||
if (!response || !response.success) {
|
||||
console.error("Failed to load remote keywords:", response?.error);
|
||||
return;
|
||||
}
|
||||
|
||||
keywords = response.data
|
||||
.split("\n")
|
||||
.map(k => k.trim().toLowerCase())
|
||||
.filter(Boolean);
|
||||
|
||||
console.log("Loaded keywords:", keywords);
|
||||
|
||||
injectStyles();
|
||||
startFiltering();
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function injectStyles() {
|
||||
// Prevent duplicate injection
|
||||
if (document.getElementById("aula-fixer-styles")) return;
|
||||
|
||||
const style = document.createElement("style");
|
||||
style.id = "aula-fixer-styles";
|
||||
|
||||
style.textContent = `
|
||||
.css-qbgecn {
|
||||
max-height: 99% !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.css-15ampbt {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.css-1iji2l6 {
|
||||
margin: 1px !important;
|
||||
}
|
||||
|
||||
#main-content > div > div > div.css-qbgecn.e1f8gytw1 {
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
.css-1vz9kb2 {
|
||||
flex-basis: 85% !important;
|
||||
padding: 0px 0px 0px 1% !important;
|
||||
}
|
||||
|
||||
.css-nivjaw {
|
||||
padding: 12px 12px 12px 12px !important;
|
||||
}
|
||||
`;
|
||||
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
|
||||
function startFiltering() {
|
||||
filterNotifications();
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
filterNotifications();
|
||||
});
|
||||
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
loadKeywords();
|
||||
19
src/keywords.txt
Normal file
19
src/keywords.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
en-suite room available
|
||||
double studio room is available
|
||||
need a space for 1 person (girl) to stay
|
||||
hey everyone looking space for one
|
||||
room available for girl (shared accommodation)
|
||||
takeover an en-suite room
|
||||
i'm currently seeking for someone who can take over an en-suite room
|
||||
accomodation alert
|
||||
35
src/manifest.json
Normal file
35
src/manifest.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Aula Fixer",
|
||||
"version": "1.4",
|
||||
"description": "Removes all notifications about rooms for rent etc. on Aula and changes styling so that less screen space is wasted.",
|
||||
|
||||
"background": {
|
||||
"service_worker": "background.js",
|
||||
"scripts": ["background.js"]
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://coventry.aula.education/*"],
|
||||
"js": ["content.js"]
|
||||
}
|
||||
],
|
||||
|
||||
"host_permissions": [
|
||||
"https://git.wbell.dev/*"
|
||||
],
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["keywords.txt"],
|
||||
"matches": ["https://coventry.aula.education/*"]
|
||||
}
|
||||
],
|
||||
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "aula-fixer@tussockyjoker.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
34
src/manifest_chrome.json
Normal file
34
src/manifest_chrome.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Aula Fixer",
|
||||
"version": "1.4",
|
||||
"description": "Removes all notifications about rooms for rent etc. on Aula and changes styling so that less screen space is wasted.",
|
||||
|
||||
"background": {
|
||||
"service_worker": "background.js"
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://coventry.aula.education/*"],
|
||||
"js": ["content.js"]
|
||||
}
|
||||
],
|
||||
|
||||
"host_permissions": [
|
||||
"https://git.wbell.dev/*"
|
||||
],
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["keywords.txt"],
|
||||
"matches": ["https://coventry.aula.education/*"]
|
||||
}
|
||||
],
|
||||
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "aula-fixer@tussockyjoker.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
34
src/manifest_ff.json
Normal file
34
src/manifest_ff.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"manifest_version": 3,
|
||||
"name": "Aula Fixer",
|
||||
"version": "1.4.1",
|
||||
"description": "Removes all notifications about rooms for rent etc. on Aula and changes styling so that less screen space is wasted.",
|
||||
|
||||
"background": {
|
||||
"scripts": ["background.js"]
|
||||
},
|
||||
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["https://coventry.aula.education/*"],
|
||||
"js": ["content.js"]
|
||||
}
|
||||
],
|
||||
|
||||
"host_permissions": [
|
||||
"https://git.wbell.dev/*"
|
||||
],
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["keywords.txt"],
|
||||
"matches": ["https://coventry.aula.education/*"]
|
||||
}
|
||||
],
|
||||
|
||||
"browser_specific_settings": {
|
||||
"gecko": {
|
||||
"id": "aula-fixer@tussockyjoker.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user