excludes.txt -> keywords.txt

This commit is contained in:
2026-02-21 20:08:30 +00:00
parent 088deb0cb3
commit 9559111ba6
4 changed files with 31 additions and 35 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1,9 +1,8 @@
let keywords = [];
// Load excludes.txt first
async function loadKeywords() {
try {
const response = await fetch(chrome.runtime.getURL("excludes.txt"));
const response = await fetch(chrome.runtime.getURL("keywords.txt"));
const text = await response.text();
keywords = text
@@ -13,10 +12,10 @@ async function loadKeywords() {
console.log("Loaded keywords:", keywords);
startFiltering(); // start only after keywords are ready
startFiltering();
} catch (error) {
console.error("Failed to load excludes.txt:", error);
console.error("Failed to load keywords.txt:", error);
}
}
@@ -37,10 +36,8 @@ function filterNotifications() {
}
function startFiltering() {
// Run once
filterNotifications();
// Watch for dynamically loaded notifications
const observer = new MutationObserver(() => {
filterNotifications();
});
@@ -51,5 +48,4 @@ function startFiltering() {
});
}
// Start everything
loadKeywords();

View File

@@ -13,7 +13,7 @@
"web_accessible_resources": [
{
"resources": ["excludes.txt"],
"resources": ["keywords.txt"],
"matches": ["https://coventry.aula.education/*"]
}
]