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 = []; 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
@@ -13,10 +12,10 @@ async function loadKeywords() {
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);
} }
} }
@@ -37,10 +36,8 @@ function filterNotifications() {
} }
function startFiltering() { function startFiltering() {
// Run once
filterNotifications(); filterNotifications();
// Watch for dynamically loaded notifications
const observer = new MutationObserver(() => { const observer = new MutationObserver(() => {
filterNotifications(); filterNotifications();
}); });
@@ -51,5 +48,4 @@ function startFiltering() {
}); });
} }
// Start everything
loadKeywords(); loadKeywords();

View File

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