forked from TussockyJoker/Aula-Fixer
excludes.txt -> keywords.txt
This commit is contained in:
10
content.js
10
content.js
@@ -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();
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
"web_accessible_resources": [
|
||||
{
|
||||
"resources": ["excludes.txt"],
|
||||
"resources": ["keywords.txt"],
|
||||
"matches": ["https://coventry.aula.education/*"]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user