diff --git a/.gitignore b/.gitignore index 0c5b4e7..1f50f2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store Archive.zip .amo-upload-uuid +dev-resources +content copy.js diff --git a/c46df4c4228843d2a8b9-1.0.xpi b/c46df4c4228843d2a8b9-1.0.xpi new file mode 100644 index 0000000..fb5ab33 Binary files /dev/null and b/c46df4c4228843d2a8b9-1.0.xpi differ diff --git a/content.js b/content.js index 0f87f81..45d6308 100644 --- a/content.js +++ b/content.js @@ -12,6 +12,7 @@ async function loadKeywords() { console.log("Loaded keywords:", keywords); + injectStyles(); // 👈 Add this startFiltering(); } catch (error) { @@ -23,7 +24,7 @@ function filterNotifications() { const notifications = document.querySelectorAll('div[role="button"]'); notifications.forEach(notification => { - const text = notification.innerText.toLowerCase(); + const text = notification.innerText?.toLowerCase() || ""; const containsKeyword = keywords.some(keyword => text.includes(keyword) @@ -35,6 +36,42 @@ function filterNotifications() { }); } +function injectStyles() { + const style = document.createElement("style"); + + 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; + + } + `; + + document.head.appendChild(style); +} + function startFiltering() { filterNotifications(); diff --git a/keywords.txt b/keywords.txt index 4ed6e55..e23c59e 100644 --- a/keywords.txt +++ b/keywords.txt @@ -8,4 +8,6 @@ i am looking for accomodation i'm looking for accomodation fully furnished house ensuite room available -room available cv13gx queens park house unite student \ No newline at end of file +room available cv13gx queens park house unite student +en-suite room available +double studio room is available \ No newline at end of file diff --git a/manifest.json b/manifest.json index a74f717..c46367a 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 3, - "name": "Aula Ad Filter", - "version": "1.1", - "description": "Removes all the notifications about rooms for rent on Aula", + "name": "Aula Fixer", + "version": "1.0", + "description": "Based on my Aula ad remover project, Removes all the notifications about rooms for rent on Aula and changes the styling so that it doesn't waste so much screen space.", "content_scripts": [ { @@ -20,7 +20,7 @@ "browser_specific_settings": { "gecko": { - "id": "aulaadremoverpublic@tussockyjoker.com", + "id": "aulafixer@tussockyjoker.com", "data_collection_permissions": { "required": ["none"], "optional": []