10 Commits

Author SHA1 Message Date
semantic-release-bot
4349863a6b chore(release): 1.13.0
# [1.13.0](https://github.com/obsqrbtz/goose-highlighter/compare/v1.12.1...v1.13.0) (2026-02-11)

### Bug Fixes

* exceptions page ui fixes ([226f2ef](226f2efe4f))
* incorrect behaviour of filter chips after pressing select all ([b4e1425](b4e1425c79))
* only show filter buttons for list with 1+ matches ([7195a3b](7195a3b41b))

### Features

* group and filter items by list in "on page" section ([0680134](068013486a))
2026-02-11 14:07:36 +03:00
b4e1425c79 fix: incorrect behaviour of filter chips after pressing select all 2026-02-11 14:06:04 +03:00
81acf7b0ab ci: exclude sample config from release 2026-02-11 13:44:23 +03:00
7195a3b41b fix: only show filter buttons for list with 1+ matches 2026-02-11 13:39:40 +03:00
289fdd9257 use exceptionList for blacklist for clean migration 2026-02-11 13:34:23 +03:00
226f2efe4f fix: exceptions page ui fixes 2026-02-11 12:01:12 +03:00
4932b20991 fixed layout in "on page" section 2026-02-11 11:38:35 +03:00
26e3bac589 add example config 2026-02-11 11:25:25 +03:00
068013486a feat: group and filter items by list in "on page" section 2026-02-11 11:15:29 +03:00
05209cd049 added export/import settubgs 2026-02-11 09:19:19 +03:00
28 changed files with 1750 additions and 264 deletions

View File

@@ -38,7 +38,7 @@ jobs:
- name: Create zip package
run: |
zip -r goose-highlighter.zip . -x '*.git*' 'node_modules/*' 'src/*' 'scripts/*' 'versioning.md' '.releaserc.json' 'package.json' 'package-lock.json' 'README.md' 'tsconfig.json' 'eslint.config.mjs'
zip -r goose-highlighter.zip . -x '*.git*' 'node_modules/*' 'src/*' 'scripts/*' 'versioning.md' '.releaserc.json' 'package.json' 'package-lock.json' 'README.md' 'tsconfig.json' 'eslint.config.mjs' 'sample-import-config.json'
- name: Install webstore upload CLI
run: npm install -g chrome-webstore-upload-cli

View File

@@ -41,7 +41,7 @@ jobs:
zip -r goose-highlighter-${{ steps.version.outputs.VERSION }}.zip . \
-x '*.git*' 'node_modules/*' 'src/*' 'scripts/*' 'versioning.md' '.releaserc.json' \
'package.json' 'package-lock.json' 'README.md' 'tsconfig.json' \
'eslint.config.mjs' '.github/*' 'CHANGELOG.md' 'PRIVACY.MD'
'eslint.config.mjs' '.github/*' 'CHANGELOG.md' 'PRIVACY.MD' 'sample-import-config.json'
- name: Install Chrome extension packaging tool
run: npm install -g crx3

View File

@@ -1,3 +1,17 @@
# [1.13.0](https://github.com/obsqrbtz/goose-highlighter/compare/v1.12.1...v1.13.0) (2026-02-11)
### Bug Fixes
* exceptions page ui fixes ([226f2ef](https://github.com/obsqrbtz/goose-highlighter/commit/226f2efe4f20a041bc6323694d985c5dfe6857aa))
* incorrect behaviour of filter chips after pressing select all ([b4e1425](https://github.com/obsqrbtz/goose-highlighter/commit/b4e1425c790fdbb9fc8f1558a759dd9bba5617ed))
* only show filter buttons for list with 1+ matches ([7195a3b](https://github.com/obsqrbtz/goose-highlighter/commit/7195a3b41bb9dd804c0b7f716c20eb9bdc5ac3f9))
### Features
* group and filter items by list in "on page" section ([0680134](https://github.com/obsqrbtz/goose-highlighter/commit/068013486a43ed2329602e88ae6d365eebac0bf9))
## [1.12.1](https://github.com/obsqrbtz/goose-highlighter/compare/v1.12.0...v1.12.1) (2026-02-09)

View File

@@ -36,7 +36,7 @@
"message": "Wörter hinzufügen"
},
"select_all": {
"message": "Auswählen"
"message": "Alle auswählen"
},
"delete_selected": {
"message": "Ausgewählte löschen"
@@ -78,7 +78,7 @@
"message": "Möchten Sie die ausgewählten Wörter wirklich löschen?"
},
"deselect_all": {
"message": "Abwählen"
"message": "Alle abwählen"
},
"highlight_lists": {
"message": "Hervorhebungslisten"
@@ -116,9 +116,19 @@
"manage_exceptions": {
"message": "Verwalten"
},
"exceptions_mode": { "message": "Modus:" },
"exceptions_mode_blacklist": { "message": "Blacklist — auf diesen Sites nicht hervorheben" },
"exceptions_mode_whitelist": { "message": "Whitelist — nur auf diesen Sites hervorheben" },
"exceptions_mode_option_blacklist": { "message": "Blacklist" },
"exceptions_mode_option_whitelist": { "message": "Whitelist" },
"exceptions_mode_hint_blacklist": { "message": "Auf diesen Sites nicht hervorheben." },
"exceptions_mode_hint_whitelist": { "message": "Nur auf diesen Sites hervorheben." },
"exceptions_list": {
"message": "Ausnahme-Websites:"
},
"exceptions_list_blacklist": { "message": "Sites ausschließen (Blacklist):" },
"exceptions_list_whitelist": { "message": "Sites einschließen (Whitelist):" },
"add_current_site": { "message": "Aktuelle Website hinzufügen" },
"clear_all": {
"message": "Alle löschen"
},
@@ -167,6 +177,15 @@
"total_highlights": {
"message": "Gesamt"
},
"total_matches": {
"message": "Treffer gesamt"
},
"group_by_list": {
"message": "Nach Liste gruppieren"
},
"other": {
"message": "Sonstige"
},
"refresh": {
"message": "Aktualisieren"
},
@@ -322,5 +341,17 @@
},
"rename_list": {
"message": "Liste umbenennen"
},
"export_settings": {
"message": "Exportieren"
},
"import_settings": {
"message": "Importieren"
},
"export_import_settings_label": {
"message": "Export / Import"
},
"export_import_settings_hint": {
"message": "Listen und Website-Ausnahmen sichern oder wiederherstellen."
}
}

View File

@@ -36,7 +36,7 @@
"message": "Add Words"
},
"select_all": {
"message": "Select"
"message": "Select all"
},
"delete_selected": {
"message": "Delete selected"
@@ -78,7 +78,7 @@
"message": "Are you sure you want to delete the selected words?"
},
"deselect_all": {
"message": "Deselect"
"message": "Deselect all"
},
"highlight_lists": {
"message": "Highlight Lists"
@@ -122,11 +122,41 @@
"manage_exceptions": {
"message": "Manage"
},
"exceptions_mode": {
"message": "Mode:"
},
"exceptions_mode_blacklist": {
"message": "Blacklist — don't highlight on these sites"
},
"exceptions_mode_whitelist": {
"message": "Whitelist — only highlight on these sites"
},
"exceptions_mode_option_blacklist": {
"message": "Blacklist"
},
"exceptions_mode_option_whitelist": {
"message": "Whitelist"
},
"exceptions_mode_hint_blacklist": {
"message": "Don't highlight on these sites."
},
"exceptions_mode_hint_whitelist": {
"message": "Only highlight on these sites."
},
"exceptions_list": {
"message": "Exception Sites:"
},
"exceptions_list_blacklist": {
"message": "Sites to exclude (blacklist):"
},
"exceptions_list_whitelist": {
"message": "Sites to include (whitelist):"
},
"add_current_site": {
"message": "Add current site"
},
"clear_all": {
"message": "Clear All"
"message": "Clear all"
},
"confirm_clear_exceptions": {
"message": "Are you sure you want to clear all exceptions?"
@@ -173,6 +203,18 @@
"total_highlights": {
"message": "Total"
},
"total_matches": {
"message": "Total matches"
},
"group_by_list": {
"message": "Group by list"
},
"other": {
"message": "Other"
},
"exception_domain_placeholder": {
"message": "example.com"
},
"refresh": {
"message": "Refresh"
},
@@ -358,5 +400,17 @@
},
"close": {
"message": "Close"
},
"export_settings": {
"message": "Export"
},
"import_settings": {
"message": "Import"
},
"export_import_settings_label": {
"message": "Export / Import"
},
"export_import_settings_hint": {
"message": "Back up or restore lists and site exceptions."
}
}

View File

@@ -35,8 +35,8 @@
"apply_paste": {
"message": "Agregar palabras"
},
"select_all": {
"message": "Seleccionar"
"select_all": {
"message": "Seleccionar todo"
},
"delete_selected": {
"message": "Eliminar seleccionados"
@@ -77,8 +77,8 @@
"confirm_delete_words": {
"message": "¿Estás seguro de que deseas eliminar las palabras seleccionadas?"
},
"deselect_all": {
"message": "Deseleccionar"
"deselect_all": {
"message": "Deseleccionar todo"
},
"highlight_lists": {
"message": "Listas de resaltado"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Gestionar"
},
"exceptions_mode": { "message": "Modo:" },
"exceptions_mode_blacklist": { "message": "Lista negra — no resaltar en estos sitios" },
"exceptions_mode_whitelist": { "message": "Lista blanca — solo resaltar en estos sitios" },
"exceptions_mode_option_blacklist": { "message": "Lista negra" },
"exceptions_mode_option_whitelist": { "message": "Lista blanca" },
"exceptions_mode_hint_blacklist": { "message": "No resaltar en estos sitios." },
"exceptions_mode_hint_whitelist": { "message": "Solo resaltar en estos sitios." },
"exceptions_list": {
"message": "Sitios de excepción:"
},
"exceptions_list_blacklist": { "message": "Sitios a excluir (lista negra):" },
"exceptions_list_whitelist": { "message": "Sitios a incluir (lista blanca):" },
"add_current_site": { "message": "Añadir sitio actual" },
"clear_all": {
"message": "Limpiar todo"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Total"
},
"total_matches": {
"message": "Coincidencias totales"
},
"group_by_list": {
"message": "Agrupar por lista"
},
"other": {
"message": "Otros"
},
"refresh": {
"message": "Actualizar"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Renombrar lista"
},
"export_settings": {
"message": "Exportar"
},
"import_settings": {
"message": "Importar"
},
"export_import_settings_label": {
"message": "Exportar / Importar"
},
"export_import_settings_hint": {
"message": "Hacer copia de seguridad o restaurar listas y excepciones de sitios."
}
}

View File

@@ -36,7 +36,7 @@
"message": "Ajouter des mots"
},
"select_all": {
"message": "Sélectionner"
"message": "Tout sélectionner"
},
"delete_selected": {
"message": "Supprimer la sélection"
@@ -78,7 +78,7 @@
"message": "Êtes-vous sûr de vouloir supprimer les mots sélectionnés ?"
},
"deselect_all": {
"message": "Désélectionner"
"message": "Tout désélectionner"
},
"highlight_lists": {
"message": "Listes de surbrillance"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Gérer"
},
"exceptions_mode": { "message": "Mode :" },
"exceptions_mode_blacklist": { "message": "Liste noire — ne pas surligner sur ces sites" },
"exceptions_mode_whitelist": { "message": "Liste blanche — surligner uniquement sur ces sites" },
"exceptions_mode_option_blacklist": { "message": "Liste noire" },
"exceptions_mode_option_whitelist": { "message": "Liste blanche" },
"exceptions_mode_hint_blacklist": { "message": "Ne pas surligner sur ces sites." },
"exceptions_mode_hint_whitelist": { "message": "Surligner uniquement sur ces sites." },
"exceptions_list": {
"message": "Sites d'exception :"
},
"exceptions_list_blacklist": { "message": "Sites à exclure (liste noire) :" },
"exceptions_list_whitelist": { "message": "Sites à inclure (liste blanche) :" },
"add_current_site": { "message": "Ajouter le site actuel" },
"clear_all": {
"message": "Tout effacer"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Total"
},
"total_matches": {
"message": "Correspondances totales"
},
"group_by_list": {
"message": "Grouper par liste"
},
"other": {
"message": "Autres"
},
"refresh": {
"message": "Actualiser"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Renommer la liste"
},
"export_settings": {
"message": "Exporter"
},
"import_settings": {
"message": "Importer"
},
"export_import_settings_label": {
"message": "Exporter / Importer"
},
"export_import_settings_hint": {
"message": "Sauvegarder ou restaurer les listes et les exceptions de sites."
}
}

View File

@@ -78,7 +78,7 @@
"message": "क्या आप वाकई चयनित शब्दों को हटाना चाहते हैं?"
},
"deselect_all": {
"message": "चयन हटाएँ"
"message": "सभी का चयन हटाएँ"
},
"highlight_lists": {
"message": "हाइलाइट सूचियाँ"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "प्रबंधित करें"
},
"exceptions_mode": { "message": "मोड:" },
"exceptions_mode_blacklist": { "message": "ब्लैकलिस्ट — इन साइटों पर हाइलाइट न करें" },
"exceptions_mode_whitelist": { "message": "व्हाइटलिस्ट — केवल इन साइटों पर हाइलाइट करें" },
"exceptions_mode_option_blacklist": { "message": "ब्लैकलिस्ट" },
"exceptions_mode_option_whitelist": { "message": "व्हाइटलिस्ट" },
"exceptions_mode_hint_blacklist": { "message": "इन साइटों पर हाइलाइट न करें।" },
"exceptions_mode_hint_whitelist": { "message": "केवल इन साइटों पर हाइलाइट करें।" },
"exceptions_list": {
"message": "अपवाद साइटें:"
},
"exceptions_list_blacklist": { "message": "बहिष्कृत साइटें (ब्लैकलिस्ट):" },
"exceptions_list_whitelist": { "message": "शामिल साइटें (व्हाइटलिस्ट):" },
"add_current_site": { "message": "वर्तमान साइट जोड़ें" },
"clear_all": {
"message": "सभी साफ करें"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "कुल"
},
"total_matches": {
"message": "कुल मिलान"
},
"group_by_list": {
"message": "सूची के अनुसार समूहित करें"
},
"other": {
"message": "अन्य"
},
"refresh": {
"message": "रीफ्रेश करें"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "सूची का नाम बदलें"
},
"export_settings": {
"message": "निर्यात"
},
"import_settings": {
"message": "आयात"
},
"export_import_settings_label": {
"message": "निर्यात / आयात"
},
"export_import_settings_hint": {
"message": "सूचियों और साइट अपवादों का बैकअप लें या पुनर्स्थापित करें।"
}
}

View File

@@ -36,7 +36,7 @@
"message": "Aggiungi parole"
},
"select_all": {
"message": "Seleziona"
"message": "Seleziona tutto"
},
"delete_selected": {
"message": "Elimina selezionati"
@@ -78,7 +78,7 @@
"message": "Sei sicuro di voler eliminare le parole selezionate?"
},
"deselect_all": {
"message": "Deseleziona"
"message": "Deseleziona tutto"
},
"highlight_lists": {
"message": "Elenchi di evidenziazione"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Gestisci"
},
"exceptions_mode": { "message": "Modalità:" },
"exceptions_mode_blacklist": { "message": "Lista nera — non evidenziare su questi siti" },
"exceptions_mode_whitelist": { "message": "Lista bianca — evidenziare solo su questi siti" },
"exceptions_mode_option_blacklist": { "message": "Lista nera" },
"exceptions_mode_option_whitelist": { "message": "Lista bianca" },
"exceptions_mode_hint_blacklist": { "message": "Non evidenziare su questi siti." },
"exceptions_mode_hint_whitelist": { "message": "Evidenziare solo su questi siti." },
"exceptions_list": {
"message": "Siti di eccezione:"
},
"exceptions_list_blacklist": { "message": "Siti da escludere (lista nera):" },
"exceptions_list_whitelist": { "message": "Siti da includere (lista bianca):" },
"add_current_site": { "message": "Aggiungi sito attuale" },
"clear_all": {
"message": "Cancella tutto"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Totale"
},
"total_matches": {
"message": "Corrispondenze totali"
},
"group_by_list": {
"message": "Raggruppa per lista"
},
"other": {
"message": "Altri"
},
"refresh": {
"message": "Aggiorna"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Rinomina elenco"
},
"export_settings": {
"message": "Esporta"
},
"import_settings": {
"message": "Importa"
},
"export_import_settings_label": {
"message": "Esporta / Importa"
},
"export_import_settings_hint": {
"message": "Backup o ripristino di elenchi e eccezioni di siti."
}
}

View File

@@ -78,7 +78,7 @@
"message": "選択した単語を削除してもよろしいですか?"
},
"deselect_all": {
"message": "すべて解除"
"message": "すべての選択を解除"
},
"highlight_lists": {
"message": "ハイライトリスト"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "管理"
},
"exceptions_mode": { "message": "モード:" },
"exceptions_mode_blacklist": { "message": "ブラックリスト — これらのサイトではハイライトしない" },
"exceptions_mode_whitelist": { "message": "ホワイトリスト — これらのサイトでのみハイライト" },
"exceptions_mode_option_blacklist": { "message": "ブラックリスト" },
"exceptions_mode_option_whitelist": { "message": "ホワイトリスト" },
"exceptions_mode_hint_blacklist": { "message": "これらのサイトではハイライトしません。" },
"exceptions_mode_hint_whitelist": { "message": "これらのサイトでのみハイライトします。" },
"exceptions_list": {
"message": "例外サイト:"
},
"exceptions_list_blacklist": { "message": "除外するサイト(ブラックリスト):" },
"exceptions_list_whitelist": { "message": "含めるサイト(ホワイトリスト):" },
"add_current_site": { "message": "現在のサイトを追加" },
"clear_all": {
"message": "すべてクリア"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "合計"
},
"total_matches": {
"message": "一致数の合計"
},
"group_by_list": {
"message": "リストでグループ化"
},
"other": {
"message": "その他"
},
"refresh": {
"message": "更新"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "リスト名を変更"
},
"export_settings": {
"message": "エクスポート"
},
"import_settings": {
"message": "インポート"
},
"export_import_settings_label": {
"message": "エクスポート / インポート"
},
"export_import_settings_hint": {
"message": "リストとサイトの例外をバックアップまたは復元します。"
}
}

View File

@@ -36,7 +36,7 @@
"message": "단어 추가"
},
"select_all": {
"message": "선택"
"message": "모두 선택"
},
"delete_selected": {
"message": "선택 항목 삭제"
@@ -78,7 +78,7 @@
"message": "선택한 단어를 삭제하시겠습니까?"
},
"deselect_all": {
"message": "선택 해제"
"message": "모두 선택 해제"
},
"highlight_lists": {
"message": "하이라이트 리스트"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "관리"
},
"exceptions_mode": { "message": "모드:" },
"exceptions_mode_blacklist": { "message": "차단 목록 — 이 사이트에서 강조 안 함" },
"exceptions_mode_whitelist": { "message": "허용 목록 — 이 사이트에서만 강조" },
"exceptions_mode_option_blacklist": { "message": "차단 목록" },
"exceptions_mode_option_whitelist": { "message": "허용 목록" },
"exceptions_mode_hint_blacklist": { "message": "이 사이트에서 강조하지 않습니다." },
"exceptions_mode_hint_whitelist": { "message": "이 사이트에서만 강조합니다." },
"exceptions_list": {
"message": "예외 사이트:"
},
"exceptions_list_blacklist": { "message": "제외할 사이트 (차단 목록):" },
"exceptions_list_whitelist": { "message": "포함할 사이트 (허용 목록):" },
"add_current_site": { "message": "현재 사이트 추가" },
"clear_all": {
"message": "모두 지우기"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "전체"
},
"total_matches": {
"message": "총 일치 수"
},
"group_by_list": {
"message": "목록별로 그룹화"
},
"other": {
"message": "기타"
},
"refresh": {
"message": "새로고침"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "리스트 이름 변경"
},
"export_settings": {
"message": "내보내기"
},
"import_settings": {
"message": "가져오기"
},
"export_import_settings_label": {
"message": "내보내기 / 가져오기"
},
"export_import_settings_hint": {
"message": "목록 및 사이트 예외를 백업하거나 복원합니다."
}
}

View File

@@ -36,7 +36,7 @@
"message": "Woorden toevoegen"
},
"select_all": {
"message": "Selecteren"
"message": "Alles selecteren"
},
"delete_selected": {
"message": "Geselecteerde verwijderen"
@@ -78,7 +78,7 @@
"message": "Weet je zeker dat je de geselecteerde woorden wilt verwijderen?"
},
"deselect_all": {
"message": "Deselecteren"
"message": "Alles deselecteren"
},
"highlight_lists": {
"message": "Markeer lijsten"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Beheren"
},
"exceptions_mode": { "message": "Modus:" },
"exceptions_mode_blacklist": { "message": "Zwarte lijst — niet markeren op deze sites" },
"exceptions_mode_whitelist": { "message": "Witte lijst — alleen markeren op deze sites" },
"exceptions_mode_option_blacklist": { "message": "Zwarte lijst" },
"exceptions_mode_option_whitelist": { "message": "Witte lijst" },
"exceptions_mode_hint_blacklist": { "message": "Niet markeren op deze sites." },
"exceptions_mode_hint_whitelist": { "message": "Alleen markeren op deze sites." },
"exceptions_list": {
"message": "Uitzondering sites:"
},
"exceptions_list_blacklist": { "message": "Uit te sluiten sites (zwarte lijst):" },
"exceptions_list_whitelist": { "message": "Toe te voegen sites (witte lijst):" },
"add_current_site": { "message": "Huidige site toevoegen" },
"clear_all": {
"message": "Alles wissen"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Totaal"
},
"total_matches": {
"message": "Totaal aantal matches"
},
"group_by_list": {
"message": "Groeperen op lijst"
},
"other": {
"message": "Overige"
},
"refresh": {
"message": "Vernieuwen"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Lijst hernoemen"
},
"export_settings": {
"message": "Exporteren"
},
"import_settings": {
"message": "Importeren"
},
"export_import_settings_label": {
"message": "Exporteren / Importeren"
},
"export_import_settings_hint": {
"message": "Back-up maken of lijsten en site-uitzonderingen herstellen."
}
}

View File

@@ -36,7 +36,7 @@
"message": "Dodaj słowa"
},
"select_all": {
"message": "Zaznacz"
"message": "Zaznacz wszystko"
},
"delete_selected": {
"message": "Usuń zaznaczone"
@@ -78,7 +78,7 @@
"message": "Czy na pewno chcesz usunąć wybrane słowa?"
},
"deselect_all": {
"message": "Odznacz"
"message": "Odznacz wszystko"
},
"highlight_lists": {
"message": "Listy podświetleń"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Zarządzaj"
},
"exceptions_mode": { "message": "Tryb:" },
"exceptions_mode_blacklist": { "message": "Czarna lista — nie podświetlaj na tych stronach" },
"exceptions_mode_whitelist": { "message": "Biała lista — podświetlaj tylko na tych stronach" },
"exceptions_mode_option_blacklist": { "message": "Czarna lista" },
"exceptions_mode_option_whitelist": { "message": "Biała lista" },
"exceptions_mode_hint_blacklist": { "message": "Nie podświetlaj na tych stronach." },
"exceptions_mode_hint_whitelist": { "message": "Podświetlaj tylko na tych stronach." },
"exceptions_list": {
"message": "Strony wyjątków:"
},
"exceptions_list_blacklist": { "message": "Strony do wykluczenia (czarna lista):" },
"exceptions_list_whitelist": { "message": "Strony do uwzględnienia (biała lista):" },
"add_current_site": { "message": "Dodaj bieżącą witrynę" },
"clear_all": {
"message": "Wyczyść wszystko"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Łącznie"
},
"total_matches": {
"message": "Łączna liczba dopasowań"
},
"group_by_list": {
"message": "Grupuj według listy"
},
"other": {
"message": "Inne"
},
"refresh": {
"message": "Odśwież"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Zmień nazwę listy"
},
"export_settings": {
"message": "Eksportuj"
},
"import_settings": {
"message": "Importuj"
},
"export_import_settings_label": {
"message": "Eksport / Import"
},
"export_import_settings_hint": {
"message": "Utwórz kopię zapasową lub przywróć listy i wyjątki witryn."
}
}

View File

@@ -36,7 +36,7 @@
"message": "Adicionar palavras"
},
"select_all": {
"message": "Selecionar"
"message": "Selecionar tudo"
},
"delete_selected": {
"message": "Excluir selecionados"
@@ -78,7 +78,7 @@
"message": "Tem certeza de que deseja excluir as palavras selecionadas?"
},
"deselect_all": {
"message": "Desmarcar"
"message": "Desmarcar tudo"
},
"highlight_lists": {
"message": "Listas de destaque"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Gerenciar"
},
"exceptions_mode": { "message": "Modo:" },
"exceptions_mode_blacklist": { "message": "Lista negra — não destacar nestes sites" },
"exceptions_mode_whitelist": { "message": "Lista branca — destacar apenas nestes sites" },
"exceptions_mode_option_blacklist": { "message": "Lista negra" },
"exceptions_mode_option_whitelist": { "message": "Lista branca" },
"exceptions_mode_hint_blacklist": { "message": "Não destacar nestes sites." },
"exceptions_mode_hint_whitelist": { "message": "Destacar apenas nestes sites." },
"exceptions_list": {
"message": "Sites de exceção:"
},
"exceptions_list_blacklist": { "message": "Sites a excluir (lista negra):" },
"exceptions_list_whitelist": { "message": "Sites a incluir (lista branca):" },
"add_current_site": { "message": "Adicionar site atual" },
"clear_all": {
"message": "Limpar tudo"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Total"
},
"total_matches": {
"message": "Total de correspondências"
},
"group_by_list": {
"message": "Agrupar por lista"
},
"other": {
"message": "Outros"
},
"refresh": {
"message": "Atualizar"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Renomear lista"
},
"export_settings": {
"message": "Exportar"
},
"import_settings": {
"message": "Importar"
},
"export_import_settings_label": {
"message": "Exportar / Importar"
},
"export_import_settings_hint": {
"message": "Fazer backup ou restaurar listas e exceções de sites."
}
}

View File

@@ -78,7 +78,7 @@
"message": "Вы уверены, что хотите удалить выбранные слова?"
},
"deselect_all": {
"message": "Отменить выбор"
"message": "Снять выделение со всех"
},
"highlight_lists": {
"message": "Списки"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Управление"
},
"exceptions_mode": { "message": "Режим:" },
"exceptions_mode_blacklist": { "message": "Чёрный список — не подсвечивать на этих сайтах" },
"exceptions_mode_whitelist": { "message": "Белый список — подсвечивать только на этих сайтах" },
"exceptions_mode_option_blacklist": { "message": "Чёрный список" },
"exceptions_mode_option_whitelist": { "message": "Белый список" },
"exceptions_mode_hint_blacklist": { "message": "Не подсвечивать на этих сайтах." },
"exceptions_mode_hint_whitelist": { "message": "Подсвечивать только на этих сайтах." },
"exceptions_list": {
"message": "Сайты-исключения:"
},
"exceptions_list_blacklist": { "message": "Исключить сайты (чёрный список):" },
"exceptions_list_whitelist": { "message": "Включить сайты (белый список):" },
"add_current_site": { "message": "Добавить текущий сайт" },
"clear_all": {
"message": "Очистить все"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Всего"
},
"total_matches": {
"message": "Всего совпадений"
},
"group_by_list": {
"message": "Группировать по списку"
},
"other": {
"message": "Прочее"
},
"refresh": {
"message": "Обновить"
},
@@ -329,5 +348,17 @@
},
"rename_list": {
"message": "Переименовать список"
},
"export_settings": {
"message": "Экспорт"
},
"import_settings": {
"message": "Импорт"
},
"export_import_settings_label": {
"message": "Экспорт / Импорт"
},
"export_import_settings_hint": {
"message": "Резервное копирование или восстановление списков и исключений сайтов."
}
}

View File

@@ -36,7 +36,7 @@
"message": "Kelimeleri Ekle"
},
"select_all": {
"message": "Seç"
"message": "Tümünü seç"
},
"delete_selected": {
"message": "Seçilenleri sil"
@@ -78,7 +78,7 @@
"message": "Seçili kelimeleri silmek istediğinizden emin misiniz?"
},
"deselect_all": {
"message": "Seçimi Kaldır"
"message": "Tümünün seçimini kaldır"
},
"highlight_lists": {
"message": "Vurgulama Listeleri"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "Yönet"
},
"exceptions_mode": { "message": "Mod:" },
"exceptions_mode_blacklist": { "message": "Kara liste — bu sitelerde vurgulama" },
"exceptions_mode_whitelist": { "message": "Beyaz liste — yalnızca bu sitelerde vurgula" },
"exceptions_mode_option_blacklist": { "message": "Kara liste" },
"exceptions_mode_option_whitelist": { "message": "Beyaz liste" },
"exceptions_mode_hint_blacklist": { "message": "Bu sitelerde vurgulama." },
"exceptions_mode_hint_whitelist": { "message": "Yalnızca bu sitelerde vurgula." },
"exceptions_list": {
"message": "İstisna Siteleri:"
},
"exceptions_list_blacklist": { "message": "Hariç tutulacak siteler (kara liste):" },
"exceptions_list_whitelist": { "message": "Dahil edilecek siteler (beyaz liste):" },
"add_current_site": { "message": "Mevcut siteyi ekle" },
"clear_all": {
"message": "Hepsini Temizle"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "Toplam"
},
"total_matches": {
"message": "Toplam eşleşme"
},
"group_by_list": {
"message": "Listeye göre grupla"
},
"other": {
"message": "Diğer"
},
"refresh": {
"message": "Yenile"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "Listeyi Yeniden Adlandır"
},
"export_settings": {
"message": "Dışa Aktar"
},
"import_settings": {
"message": "İçe Aktar"
},
"export_import_settings_label": {
"message": "Dışa Aktar / İçe Aktar"
},
"export_import_settings_hint": {
"message": "Listeleri ve site istisnalarını yedekleyin veya geri yükleyin."
}
}

View File

@@ -36,7 +36,7 @@
"message": "添加单词"
},
"select_all": {
"message": "选"
"message": "选"
},
"delete_selected": {
"message": "删除所选"
@@ -78,7 +78,7 @@
"message": "您确定要删除选中的单词吗?"
},
"deselect_all": {
"message": "取消选"
"message": "取消选"
},
"highlight_lists": {
"message": "高亮列表"
@@ -122,9 +122,19 @@
"manage_exceptions": {
"message": "管理"
},
"exceptions_mode": { "message": "模式:" },
"exceptions_mode_blacklist": { "message": "黑名单 — 不在这些网站上高亮" },
"exceptions_mode_whitelist": { "message": "白名单 — 仅在这些网站上高亮" },
"exceptions_mode_option_blacklist": { "message": "黑名单" },
"exceptions_mode_option_whitelist": { "message": "白名单" },
"exceptions_mode_hint_blacklist": { "message": "不在这些网站上高亮。" },
"exceptions_mode_hint_whitelist": { "message": "仅在这些网站上高亮。" },
"exceptions_list": {
"message": "例外网站:"
},
"exceptions_list_blacklist": { "message": "要排除的网站(黑名单):" },
"exceptions_list_whitelist": { "message": "要包含的网站(白名单):" },
"add_current_site": { "message": "添加当前网站" },
"clear_all": {
"message": "清除全部"
},
@@ -173,6 +183,15 @@
"total_highlights": {
"message": "总计"
},
"total_matches": {
"message": "总匹配数"
},
"group_by_list": {
"message": "按列表分组"
},
"other": {
"message": "其他"
},
"refresh": {
"message": "刷新"
},
@@ -328,5 +347,17 @@
},
"rename_list": {
"message": "重命名列表"
},
"export_settings": {
"message": "导出"
},
"import_settings": {
"message": "导入"
},
"export_import_settings_label": {
"message": "导出 / 导入"
},
"export_import_settings_hint": {
"message": "备份或恢复列表和站点例外。"
}
}

View File

@@ -2,8 +2,9 @@
"manifest_version": 3,
"name": "__MSG_extension_name__",
"description": "__MSG_extension_description__",
"version": "1.12.1",
"version": "1.13.0",
"default_locale": "en",
"id": "kdoehicejfnccbmecpkfjlbljpfogoep",
"permissions": [
"scripting",
"storage",

View File

@@ -799,52 +799,152 @@ body {
.page-highlights-section {
display: flex;
flex-direction: column;
gap: 6px;
gap: 10px;
flex: 1;
min-height: 0;
}
.page-highlights-info-card {
.page-highlights-header-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 10px;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 8px;
font-size: 14px;
color: var(--text-color);
}
.page-highlights-info-card strong {
font-weight: 600;
color: var(--accent);
}
.refresh-button {
width: 100%;
min-height: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 8px;
cursor: pointer;
font-size: 14px;
color: var(--text-color);
transition: all 0.2s;
flex-shrink: 0;
}
.refresh-button:hover {
.page-highlights-total-label {
font-size: var(--text-xs);
font-weight: 600;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
color: var(--text-color);
opacity: 0.7;
flex-shrink: 0;
}
.page-highlights-total-count {
flex: 1;
font-size: var(--text-base);
font-weight: 600;
color: var(--accent);
text-align: right;
}
.page-highlights-controls {
display: flex;
flex-direction: column;
gap: 10px;
flex-shrink: 0;
}
.page-highlights-group-toggle {
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
padding: 8px 10px;
margin: 0 -2px;
border-radius: 6px;
font-size: var(--text-sm);
color: var(--text-color);
background: var(--input-bg);
border: 1px solid var(--input-border);
transition: background 0.2s, border-color 0.2s;
}
.page-highlights-group-toggle:hover {
background: var(--section-bg);
}
.refresh-button i {
font-size: 16px;
.page-highlights-group-toggle .switch-wrapper {
flex-shrink: 0;
}
.page-highlights-group-label {
flex: 1;
font-weight: 500;
user-select: none;
}
.page-highlights-filters-wrap {
display: flex;
flex-direction: column;
gap: 6px;
flex-shrink: 0;
}
.page-highlights-filters-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
flex-shrink: 0;
}
.page-highlights-filters-actions .page-highlights-filter-link {
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-color);
opacity: 0.7;
background: none;
border: none;
padding: 0;
cursor: pointer;
text-decoration: underline;
text-underline-offset: 2px;
transition: opacity 0.2s, color 0.2s;
}
.page-highlights-filters-actions .page-highlights-filter-link:hover {
opacity: 1;
color: var(--accent);
}
.page-highlights-filters-actions span[aria-hidden="true"] {
font-size: var(--text-xs);
color: var(--text-color);
opacity: 0.5;
user-select: none;
}
.page-highlights-filters {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
max-height: 62px;
overflow-y: auto;
overflow-x: hidden;
}
.page-highlights-filter-chip {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 10px;
font-size: var(--text-xs);
border-radius: 6px;
cursor: pointer;
background: var(--input-bg);
border: 1px solid var(--input-border);
color: var(--text-color);
transition: all 0.2s;
}
.page-highlights-filter-chip:hover {
background: var(--section-bg);
}
.page-highlights-filter-chip.active {
border-color: var(--list-color, var(--accent));
background: color-mix(in srgb, var(--list-color, var(--accent)) 14%, var(--input-bg));
color: var(--text-color);
}
.page-highlights-filter-chip .filter-dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex-shrink: 0;
}
.page-highlights-list {
@@ -852,7 +952,7 @@ body {
overflow-y: auto;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 8px;
border-radius: 6px;
min-height: 0;
}
@@ -864,25 +964,74 @@ body {
opacity: 0.6;
}
.page-highlights-group-section {
border-bottom: 1px solid var(--input-border);
}
.page-highlights-group-section:last-child {
border-bottom: none;
}
.page-highlights-group-header {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
cursor: pointer;
font-size: var(--text-xs);
font-weight: 600;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
color: var(--text-color);
opacity: 0.7;
background: var(--section-bg);
transition: background 0.2s;
}
.page-highlights-group-header:hover {
opacity: 0.9;
}
.page-highlights-group-header i {
font-size: 10px;
transition: transform 0.2s;
}
.page-highlights-group-section.collapsed .page-highlights-group-header i {
transform: rotate(-90deg);
}
.page-highlights-group-header .group-dot {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.page-highlight-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 12px;
padding: 6px 12px 6px 14px;
border-bottom: 1px solid var(--input-border);
cursor: pointer;
transition: all 0.2s;
border-left: 3px solid transparent;
background: var(--input-bg);
}
.page-highlight-item:last-child {
border-bottom: none;
}
.page-highlight-item:hover {
background: var(--section-bg);
border-left: 3px solid var(--accent);
padding-left: 9px;
}
.page-highlight-item[style*="--item-tint"] {
background: color-mix(in srgb, var(--item-tint) 4%, var(--input-bg));
}
.page-highlight-word {
@@ -891,14 +1040,31 @@ body {
align-items: center;
gap: 8px;
min-width: 0;
flex-wrap: wrap;
}
.page-highlight-preview {
display: inline-block;
padding: 3px 8px;
border-radius: 4px;
font-size: 13px;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 2px 0;
font-size: var(--text-base);
font-weight: 500;
color: var(--text-color);
}
.page-highlight-preview .preview-dot {
width: 6px;
height: 6px;
border-radius: 50%;
flex-shrink: 0;
}
.page-highlight-list-tag {
font-size: var(--text-xs);
color: var(--text-color);
opacity: 0.5;
font-weight: 400;
}
.page-highlight-position {
@@ -949,69 +1115,188 @@ body {
min-height: 0;
}
.exception-toggle-btn {
.exceptions-mode-card {
padding: 6px 10px;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 6px;
display: flex;
flex-direction: column;
gap: 4px;
flex-shrink: 0;
}
.exceptions-mode-label {
font-size: var(--text-xs);
font-weight: 500;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
color: var(--text-color);
opacity: 0.6;
}
.exceptions-mode-select {
width: 100%;
min-height: 32px;
padding: 0 28px 0 10px;
font-size: var(--text-base);
color: var(--text-color);
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 6px;
cursor: pointer;
}
.exceptions-mode-hint {
margin: 0;
font-size: var(--text-xs);
color: var(--text-color);
opacity: 0.6;
line-height: 1.3;
}
.exceptions-add-row {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
.exception-domain-input {
flex: 1;
min-width: 0;
height: 32px;
padding: 0 10px;
font-size: var(--text-base);
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 6px;
color: var(--text-color);
}
.exception-domain-input:focus {
outline: none;
border-color: var(--accent);
}
.exception-add-btn {
width: 32px;
height: 32px;
min-width: 32px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 8px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
color: var(--text-color);
transition: all 0.2s;
flex-shrink: 0;
}
.exception-toggle-btn:hover {
background: var(--section-bg);
.exception-add-btn i {
font-size: 14px;
}
.exception-toggle-btn.danger {
background: rgba(239, 68, 68, 0.1);
border-color: rgba(239, 68, 68, 0.3);
color: var(--danger);
.exceptions-add-current-link {
align-self: flex-start;
background: none;
border: none;
padding: 0;
font-size: var(--text-xs);
color: var(--accent);
cursor: pointer;
transition: opacity 0.2s, color 0.2s;
flex-shrink: 0;
text-align: left;
}
.exception-toggle-btn.danger:hover {
background: rgba(239, 68, 68, 0.2);
.exceptions-add-current-link:hover {
opacity: 0.9;
text-decoration: underline;
}
.exception-toggle-btn i {
font-size: 16px;
.exceptions-add-current-link:disabled {
opacity: 0.5;
cursor: not-allowed;
text-decoration: none;
}
.exceptions-list-wrapper {
display: flex;
flex-direction: column;
gap: 6px;
gap: 4px;
flex: 1;
min-height: 0;
}
.exceptions-list-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
flex-shrink: 0;
}
.clear-exceptions-link {
background: none;
border: none;
padding: 0;
font-size: var(--text-xs);
font-weight: 500;
color: var(--text-color);
opacity: 0.6;
cursor: pointer;
transition: opacity 0.2s, color 0.2s;
}
.clear-exceptions-link:hover {
opacity: 1;
color: var(--danger);
text-decoration: underline;
}
.exceptions-list {
flex: 1;
overflow-y: auto;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 8px;
border-radius: 6px;
min-height: 0;
}
.exception-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 12px;
gap: 10px;
padding: 8px 12px;
border-bottom: 1px solid var(--input-border);
transition: background 0.2s;
}
.exception-item .exception-domain-icon {
width: 22px;
height: 22px;
min-width: 22px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
font-size: 10px;
color: var(--text-color);
opacity: 0.5;
background: var(--section-bg);
border-radius: 50%;
}
.exception-item .exception-domain-icon i {
font-size: 10px;
}
.exception-item.exception-empty {
justify-content: center;
color: var(--text-color);
opacity: 0.6;
}
.exception-item:last-child {
border-bottom: none;
}
@@ -1022,24 +1307,25 @@ body {
.exception-domain {
flex: 1;
font-size: 14px;
font-size: var(--text-base);
color: var(--text-color);
word-break: break-word;
line-height: 1.4;
min-width: 0;
}
.exception-remove {
background: none;
border: none;
padding: 4px;
padding: 2px;
cursor: pointer;
flex-shrink: 0;
transition: color 0.2s;
display: flex;
align-items: center;
justify-content: center;
color: #9ca3af;
opacity: 0;
color: var(--text-color);
opacity: 0.5;
}
.exception-item:hover .exception-remove {
@@ -1048,35 +1334,13 @@ body {
.exception-remove:hover {
color: var(--danger);
background: none;
}
.exception-remove i {
font-size: 12px;
font-size: 10px;
}
.clear-exceptions-btn {
width: 100%;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
background: rgba(239, 68, 68, 0.1);
border: 1px solid rgba(239, 68, 68, 0.3);
color: var(--danger);
border-radius: 8px;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
}
.clear-exceptions-btn:hover {
background: rgba(239, 68, 68, 0.2);
}
.clear-exceptions-btn i {
font-size: 16px;
}
/* Settings Overlay */
.settings-overlay {
@@ -1214,6 +1478,30 @@ body {
opacity: 0.6;
}
.settings-export-import-section {
padding: 8px 10px;
background: var(--input-bg);
border: 1px solid var(--input-border);
border-radius: 6px;
display: flex;
flex-direction: column;
gap: 8px;
}
.settings-export-import-label {
font-size: var(--text-md);
font-weight: 500;
color: var(--text-color);
margin: 0;
}
.settings-export-import-hint {
font-size: var(--text-sm);
color: var(--text-color);
opacity: 0.6;
margin: 0;
}
.options-buttons {
display: flex;
gap: 8px;

View File

@@ -198,16 +198,23 @@
<div class="tab-content" data-tab-content="page-highlights">
<div class="tab-inner">
<div class="page-highlights-section">
<div class="page-highlights-info-card">
<span data-i18n="total_highlights">Total:</span>
<strong id="totalHighlightsCount">0</strong>
<div class="page-highlights-header-row">
<span class="page-highlights-total-label" data-i18n="total_matches">Total matches</span>
<span class="page-highlights-total-count" id="totalHighlightsCount">0</span>
</div>
<div class="page-highlights-controls">
<label class="page-highlights-group-toggle">
<span class="switch-wrapper">
<input type="checkbox" id="pageHighlightsGroupByList" class="switch-input" />
<span class="switch-slider"></span>
</span>
<span class="page-highlights-group-label" data-i18n="group_by_list">Group by list</span>
</label>
<div class="page-highlights-filters-wrap">
<div id="pageHighlightsFiltersActions" class="page-highlights-filters-actions" hidden></div>
<div id="pageHighlightsListFilters" class="page-highlights-filters"></div>
</div>
</div>
<button class="refresh-button" id="refreshHighlightsBtn">
<i class="fa-solid fa-rotate"></i>
<span data-i18n="refresh">Refresh</span>
</button>
<div id="pageHighlightsList" class="page-highlights-list"></div>
</div>
</div>
@@ -217,27 +224,28 @@
<div class="tab-content" data-tab-content="exceptions">
<div class="tab-inner">
<div class="exceptions-section">
<label class="section-label">
<i class="fa-solid fa-ban"></i>
<span data-i18n="site_exceptions">Site Exceptions</span>
</label>
<button class="exception-toggle-btn" id="toggleExceptionBtn">
<i class="fa-solid fa-plus"></i>
<span id="exceptionBtnText" data-i18n="add_exception">Add to Exceptions</span>
</button>
<div class="exceptions-mode-card">
<span class="exceptions-mode-label" data-i18n="exceptions_mode">Mode</span>
<select id="exceptionsModeSelect" class="exceptions-mode-select" aria-label="Exceptions mode">
<option value="blacklist" data-i18n="exceptions_mode_option_blacklist">Blacklist</option>
<option value="whitelist" data-i18n="exceptions_mode_option_whitelist">Whitelist</option>
</select>
<p class="exceptions-mode-hint" id="exceptionsModeHint" aria-live="polite"></p>
</div>
<div class="exceptions-add-row">
<input type="text" id="exceptionDomainInput" class="exception-domain-input" data-i18n="exception_domain_placeholder" placeholder="example.com" />
<button type="button" class="exception-add-btn btn-primary-subdued" id="addExceptionBtn" aria-label="Add">
<i class="fa-solid fa-plus"></i>
</button>
</div>
<button type="button" class="exceptions-add-current-link" id="addCurrentSiteBtn" data-i18n="add_current_site">Add current site</button>
<div class="exceptions-list-wrapper">
<label class="section-label">
<span data-i18n="exceptions_list">Exception Sites:</span>
</label>
<div class="exceptions-list-header">
<span class="exceptions-mode-label" id="exceptionsListLabel" data-i18n="exceptions_list">Exception Sites</span>
<button type="button" class="clear-exceptions-link" id="clearExceptionsBtn" data-i18n="clear_all">Clear all</button>
</div>
<div id="exceptionsList" class="exceptions-list"></div>
</div>
<button class="clear-exceptions-btn" id="clearExceptionsBtn">
<i class="fa-solid fa-trash"></i>
<span data-i18n="clear_all">Clear All</span>
</button>
</div>
</div>
</div>
@@ -276,6 +284,22 @@
</div>
</div>
<div class="settings-export-import-section">
<p class="settings-export-import-label" data-i18n="export_import_settings_label">Export / Import</p>
<p class="settings-export-import-hint" data-i18n="export_import_settings_hint">Back up or restore lists and site exceptions.</p>
<div class="list-export-import-row">
<button type="button" class="list-export-import-btn" id="exportSettingsBtn">
<i class="fa-solid fa-download"></i>
<span data-i18n="export_settings">Export</span>
</button>
<button type="button" class="list-export-import-btn" id="importSettingsBtn">
<i class="fa-solid fa-upload"></i>
<span data-i18n="import_settings">Import</span>
</button>
<input type="file" id="importSettingsInput" accept="application/json" hidden />
</div>
</div>
</div>
</div>
</div>

214
sample-import-config.json Normal file
View File

@@ -0,0 +1,214 @@
{
"lists": [
{
"active": true,
"background": "#fef08a",
"foreground": "#000000",
"id": 1,
"name": "Common 1",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "the" },
{ "active": true, "background": "", "foreground": "", "wordStr": "and" },
{ "active": true, "background": "", "foreground": "", "wordStr": "to" },
{ "active": true, "background": "", "foreground": "", "wordStr": "of" },
{ "active": true, "background": "", "foreground": "", "wordStr": "a" },
{ "active": true, "background": "", "foreground": "", "wordStr": "in" },
{ "active": true, "background": "", "foreground": "", "wordStr": "is" },
{ "active": true, "background": "", "foreground": "", "wordStr": "it" }
]
},
{
"active": true,
"background": "#86efac",
"foreground": "#000000",
"id": 2,
"name": "Common 2",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "you" },
{ "active": true, "background": "", "foreground": "", "wordStr": "that" },
{ "active": true, "background": "", "foreground": "", "wordStr": "he" },
{ "active": true, "background": "", "foreground": "", "wordStr": "was" },
{ "active": true, "background": "", "foreground": "", "wordStr": "for" },
{ "active": true, "background": "", "foreground": "", "wordStr": "on" },
{ "active": true, "background": "", "foreground": "", "wordStr": "are" },
{ "active": true, "background": "", "foreground": "", "wordStr": "with" }
]
},
{
"active": true,
"background": "#93c5fd",
"foreground": "#000000",
"id": 3,
"name": "Common 3",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "as" },
{ "active": true, "background": "", "foreground": "", "wordStr": "I" },
{ "active": true, "background": "", "foreground": "", "wordStr": "his" },
{ "active": true, "background": "", "foreground": "", "wordStr": "they" },
{ "active": true, "background": "", "foreground": "", "wordStr": "be" },
{ "active": true, "background": "", "foreground": "", "wordStr": "at" },
{ "active": true, "background": "", "foreground": "", "wordStr": "one" },
{ "active": true, "background": "", "foreground": "", "wordStr": "have" }
]
},
{
"active": true,
"background": "#f9a8d4",
"foreground": "#000000",
"id": 4,
"name": "Common 4",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "this" },
{ "active": true, "background": "", "foreground": "", "wordStr": "from" },
{ "active": true, "background": "", "foreground": "", "wordStr": "or" },
{ "active": true, "background": "", "foreground": "", "wordStr": "had" },
{ "active": true, "background": "", "foreground": "", "wordStr": "by" },
{ "active": true, "background": "", "foreground": "", "wordStr": "but" },
{ "active": true, "background": "", "foreground": "", "wordStr": "what" },
{ "active": true, "background": "", "foreground": "", "wordStr": "some" }
]
},
{
"active": true,
"background": "#c4b5fd",
"foreground": "#000000",
"id": 5,
"name": "Common 5",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "we" },
{ "active": true, "background": "", "foreground": "", "wordStr": "can" },
{ "active": true, "background": "", "foreground": "", "wordStr": "out" },
{ "active": true, "background": "", "foreground": "", "wordStr": "other" },
{ "active": true, "background": "", "foreground": "", "wordStr": "were" },
{ "active": true, "background": "", "foreground": "", "wordStr": "all" },
{ "active": true, "background": "", "foreground": "", "wordStr": "there" },
{ "active": true, "background": "", "foreground": "", "wordStr": "when" }
]
},
{
"active": true,
"background": "#fdba74",
"foreground": "#000000",
"id": 6,
"name": "Common 6",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "up" },
{ "active": true, "background": "", "foreground": "", "wordStr": "use" },
{ "active": true, "background": "", "foreground": "", "wordStr": "your" },
{ "active": true, "background": "", "foreground": "", "wordStr": "how" },
{ "active": true, "background": "", "foreground": "", "wordStr": "said" },
{ "active": true, "background": "", "foreground": "", "wordStr": "each" },
{ "active": true, "background": "", "foreground": "", "wordStr": "she" },
{ "active": true, "background": "", "foreground": "", "wordStr": "which" }
]
},
{
"active": true,
"background": "#67e8f9",
"foreground": "#000000",
"id": 7,
"name": "Common 7",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "their" },
{ "active": true, "background": "", "foreground": "", "wordStr": "time" },
{ "active": true, "background": "", "foreground": "", "wordStr": "if" },
{ "active": true, "background": "", "foreground": "", "wordStr": "will" },
{ "active": true, "background": "", "foreground": "", "wordStr": "way" },
{ "active": true, "background": "", "foreground": "", "wordStr": "about" },
{ "active": true, "background": "", "foreground": "", "wordStr": "many" },
{ "active": true, "background": "", "foreground": "", "wordStr": "then" }
]
},
{
"active": true,
"background": "#fda4af",
"foreground": "#000000",
"id": 8,
"name": "Common 8",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "them" },
{ "active": true, "background": "", "foreground": "", "wordStr": "would" },
{ "active": true, "background": "", "foreground": "", "wordStr": "write" },
{ "active": true, "background": "", "foreground": "", "wordStr": "like" },
{ "active": true, "background": "", "foreground": "", "wordStr": "so" },
{ "active": true, "background": "", "foreground": "", "wordStr": "these" },
{ "active": true, "background": "", "foreground": "", "wordStr": "her" },
{ "active": true, "background": "", "foreground": "", "wordStr": "long" }
]
},
{
"active": true,
"background": "#a7f3d0",
"foreground": "#000000",
"id": 9,
"name": "Common 9",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "make" },
{ "active": true, "background": "", "foreground": "", "wordStr": "thing" },
{ "active": true, "background": "", "foreground": "", "wordStr": "see" },
{ "active": true, "background": "", "foreground": "", "wordStr": "him" },
{ "active": true, "background": "", "foreground": "", "wordStr": "two" },
{ "active": true, "background": "", "foreground": "", "wordStr": "has" },
{ "active": true, "background": "", "foreground": "", "wordStr": "look" },
{ "active": true, "background": "", "foreground": "", "wordStr": "more" }
]
},
{
"active": true,
"background": "#e0e7ff",
"foreground": "#000000",
"id": 10,
"name": "Common 10",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "day" },
{ "active": true, "background": "", "foreground": "", "wordStr": "could" },
{ "active": true, "background": "", "foreground": "", "wordStr": "go" },
{ "active": true, "background": "", "foreground": "", "wordStr": "come" },
{ "active": true, "background": "", "foreground": "", "wordStr": "did" },
{ "active": true, "background": "", "foreground": "", "wordStr": "number" },
{ "active": true, "background": "", "foreground": "", "wordStr": "sound" },
{ "active": true, "background": "", "foreground": "", "wordStr": "no" }
]
},
{
"active": true,
"background": "#fde68a",
"foreground": "#000000",
"id": 11,
"name": "Common 11",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "most" },
{ "active": true, "background": "", "foreground": "", "wordStr": "people" },
{ "active": true, "background": "", "foreground": "", "wordStr": "my" },
{ "active": true, "background": "", "foreground": "", "wordStr": "over" },
{ "active": true, "background": "", "foreground": "", "wordStr": "know" },
{ "active": true, "background": "", "foreground": "", "wordStr": "water" },
{ "active": true, "background": "", "foreground": "", "wordStr": "than" },
{ "active": true, "background": "", "foreground": "", "wordStr": "call" }
]
},
{
"active": true,
"background": "#d1fae5",
"foreground": "#000000",
"id": 12,
"name": "Common 12",
"words": [
{ "active": true, "background": "", "foreground": "", "wordStr": "first" },
{ "active": true, "background": "", "foreground": "", "wordStr": "who" },
{ "active": true, "background": "", "foreground": "", "wordStr": "may" },
{ "active": true, "background": "", "foreground": "", "wordStr": "down" },
{ "active": true, "background": "", "foreground": "", "wordStr": "side" },
{ "active": true, "background": "", "foreground": "", "wordStr": "been" },
{ "active": true, "background": "", "foreground": "", "wordStr": "now" },
{ "active": true, "background": "", "foreground": "", "wordStr": "find" }
]
}
],
"exceptionsList": [
"github.com",
"www.wikipedia.org"
],
"exceptionsWhiteList": [],
"exceptionsMode": "blacklist"
}

View File

@@ -34,6 +34,8 @@
--section-bg: #ffffff;
--panel-bg: #ffffff;
--switch-bg: #e0e0e0;
--switch-thumb: #ffffff;
--switch-track-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
--checkbox-accent: #ff8c00;
--checkbox-border: #d0d0d0;
--focus-ring: 0 0 0 3px rgba(255, 140, 0, 0.25);
@@ -64,6 +66,8 @@ body.dark {
--section-bg: #121212;
--panel-bg: #121212;
--switch-bg: #2a2a2a;
--switch-thumb: #e5e5e5;
--switch-track-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
--checkbox-accent: #ff8c00;
--checkbox-border: #333333;
--focus-ring: 0 0 0 3px rgba(255, 140, 0, 0.3);

View File

@@ -93,8 +93,8 @@ button:disabled {
.switch-wrapper {
position: relative;
display: inline-block;
width: 40px;
height: 22px;
width: 42px;
height: 24px;
cursor: pointer;
flex-shrink: 0;
}
@@ -114,30 +114,46 @@ button:disabled {
right: 0;
bottom: 0;
background-color: var(--input-border);
transition: 0.3s;
border-radius: 11px;
border-radius: 9999px;
box-shadow: var(--switch-track-shadow);
transition: background-color 0.25s ease, box-shadow 0.2s ease;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
.switch-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 2px;
bottom: 2px;
background-color: white;
transition: 0.3s;
width: 18px;
height: 18px;
left: 3px;
top: 3px;
background-color: var(--switch-thumb);
border-radius: 50%;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}
.switch-input:checked + .switch-slider {
background-color: var(--accent);
box-shadow: var(--switch-track-shadow);
}
.switch-input:checked + .switch-slider:before {
transform: translateX(18px);
}
.switch-wrapper:hover .switch-slider:before {
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.switch-input:focus-visible + .switch-slider {
outline: 2px solid var(--accent);
outline-offset: 2px;
}
/* Switch Toggle (Checkbox Style) */
input[type="checkbox"].switch {

View File

@@ -38,9 +38,16 @@ class BackgroundService {
private setupInstallListener(): void {
chrome.runtime.onInstalled.addListener(async (): Promise<void> => {
const data = await StorageService.get(['exceptionsList']);
if (!data.exceptionsList) {
await StorageService.update('exceptionsList', []);
const data = await StorageService.get(['exceptionsList', 'exceptionsWhiteList', 'exceptionsMode']);
const updates: Record<string, unknown> = {};
if (data.exceptionsWhiteList === undefined) {
updates.exceptionsWhiteList = [];
}
if (data.exceptionsMode !== 'blacklist' && data.exceptionsMode !== 'whitelist') {
updates.exceptionsMode = 'blacklist';
}
if (Object.keys(updates).length > 0) {
await chrome.storage.local.set(updates);
}
});
}

View File

@@ -1,4 +1,4 @@
import { HighlightList, MessageData } from '../types.js';
import { HighlightList, MessageData, ExceptionsMode } from '../types.js';
import { StorageService } from '../services/StorageService.js';
import { MessageService } from '../services/MessageService.js';
import { HighlightEngine } from './HighlightEngine.js';
@@ -7,7 +7,9 @@ export class ContentScript {
private lists: HighlightList[] = [];
private isGlobalHighlightEnabled = true;
private exceptionsList: string[] = [];
private isCurrentSiteException = false;
private exceptionsWhiteList: string[] = [];
private exceptionsMode: ExceptionsMode = 'blacklist';
private shouldSkipDueToExceptions = false;
private matchCase = false;
private matchWhole = false;
private highlightEngine: HighlightEngine;
@@ -30,7 +32,9 @@ export class ContentScript {
'globalHighlightEnabled',
'matchCaseEnabled',
'matchWholeEnabled',
'exceptionsList'
'exceptionsList',
'exceptionsWhiteList',
'exceptionsMode'
]);
this.lists = data.lists || [];
@@ -38,12 +42,23 @@ export class ContentScript {
this.matchCase = data.matchCaseEnabled ?? false;
this.matchWhole = data.matchWholeEnabled ?? false;
this.exceptionsList = data.exceptionsList || [];
this.isCurrentSiteException = this.checkCurrentSiteException();
this.exceptionsWhiteList = data.exceptionsWhiteList || [];
this.exceptionsMode = data.exceptionsMode === 'whitelist' ? 'whitelist' : 'blacklist';
this.shouldSkipDueToExceptions = this.computeShouldSkipDueToExceptions();
}
private checkCurrentSiteException(): boolean {
private getCurrentExceptionsList(): string[] {
return this.exceptionsMode === 'whitelist' ? this.exceptionsWhiteList : this.exceptionsList;
}
private computeShouldSkipDueToExceptions(): boolean {
const currentHostname = window.location.hostname;
return this.exceptionsList.includes(currentHostname);
const list = this.getCurrentExceptionsList();
const isInList = list.includes(currentHostname);
if (this.exceptionsMode === 'blacklist') {
return isInList;
}
return !isInList;
}
private setupMessageListener(): void {
@@ -91,9 +106,11 @@ export class ContentScript {
}
private async handleExceptionsUpdate(): Promise<void> {
const data = await StorageService.get(['exceptionsList']);
const data = await StorageService.get(['exceptionsList', 'exceptionsWhiteList', 'exceptionsMode']);
this.exceptionsList = data.exceptionsList || [];
this.isCurrentSiteException = this.checkCurrentSiteException();
this.exceptionsWhiteList = data.exceptionsWhiteList || [];
this.exceptionsMode = data.exceptionsMode === 'whitelist' ? 'whitelist' : 'blacklist';
this.shouldSkipDueToExceptions = this.computeShouldSkipDueToExceptions();
this.processHighlights();
}
@@ -102,7 +119,7 @@ export class ContentScript {
this.isProcessing = true;
try {
if (!this.isGlobalHighlightEnabled || this.isCurrentSiteException) {
if (!this.isGlobalHighlightEnabled || this.shouldSkipDueToExceptions) {
this.highlightEngine.clearHighlights();
this.highlightEngine.stopObserving();
return;
@@ -124,13 +141,15 @@ export class ContentScript {
activeWords.push({
text: word.wordStr,
background: word.background || list.background,
foreground: word.foreground || list.foreground
foreground: word.foreground || list.foreground,
listId: list.id,
listName: list.name || 'Default'
});
}
}
const highlights = this.highlightEngine.getPageHighlights(activeWords);
sendResponse({ highlights });
sendResponse({ highlights, lists: this.lists.filter(l => l.active) });
}
private handleScrollToHighlight(word: string, index: number): void {

View File

@@ -419,8 +419,8 @@ export class HighlightEngine {
}
}
getPageHighlights(activeWords: ActiveWord[]): Array<{ word: string; count: number; background: string; foreground: string }> {
const seen = new Map<string, { word: string; count: number; background: string; foreground: string }>();
getPageHighlights(activeWords: ActiveWord[]): Array<{ word: string; count: number; background: string; foreground: string; listId?: number; listName?: string; listNames: string[] }> {
const seen = new Map<string, { word: string; count: number; background: string; foreground: string; listId?: number; listName?: string; listNames: string[] }>();
for (const activeWord of activeWords) {
const lookup = this.currentMatchCase ? activeWord.text : activeWord.text.toLowerCase();
@@ -429,13 +429,26 @@ export class HighlightEngine {
const totalCount = (ranges?.length || 0) + (textareaMatches?.length || 0);
if (totalCount > 0 && !seen.has(lookup)) {
seen.set(lookup, {
word: activeWord.text,
count: totalCount,
background: activeWord.background,
foreground: activeWord.foreground
});
if (totalCount > 0) {
const listName = activeWord.listName || 'Default';
const listId = activeWord.listId;
if (seen.has(lookup)) {
const existing = seen.get(lookup)!;
if (listName && !existing.listNames.includes(listName)) {
existing.listNames.push(listName);
}
} else {
seen.set(lookup, {
word: activeWord.text,
count: totalCount,
background: activeWord.background,
foreground: activeWord.foreground,
listId,
listName,
listNames: [listName]
});
}
}
}

View File

@@ -1,4 +1,4 @@
import { HighlightList, HighlightWord, HighlightInfo } from '../types.js';
import { HighlightList, HighlightWord, HighlightInfo, ExportData, ExceptionsMode } from '../types.js';
import { StorageService } from '../services/StorageService.js';
import { MessageService } from '../services/MessageService.js';
import { DOMUtils } from '../utils/DOMUtils.js';
@@ -15,9 +15,20 @@ export class PopupController {
private matchCaseEnabled = false;
private matchWholeEnabled = false;
private exceptionsList: string[] = [];
private exceptionsWhiteList: string[] = [];
private exceptionsMode: ExceptionsMode = 'blacklist';
private getCurrentExceptionsList(): string[] {
return this.exceptionsMode === 'whitelist' ? this.exceptionsWhiteList : this.exceptionsList;
}
private currentTabHost = '';
private activeTab = 'lists';
private pageHighlights: Array<{ word: string; count: number; background: string; foreground: string }> = [];
private pageHighlights: Array<{ word: string; count: number; background: string; foreground: string; listId?: number; listName?: string; listNames: string[] }> = [];
private pageHighlightsActiveLists: Array<{ id: number; name: string; background: string }> = [];
private pageHighlightsGroupByList = false;
private pageHighlightsListFilter = new Set<number>();
private pageHighlightsCollapsedGroups = new Set<string>();
private highlightIndices = new Map<string, number>();
private wordMenuOpenForIndex: number | null = null;
private wordMenuCopyOnly = false;
@@ -54,6 +65,8 @@ export class PopupController {
this.matchCaseEnabled = data.matchCaseEnabled ?? false;
this.matchWholeEnabled = data.matchWholeEnabled ?? false;
this.exceptionsList = data.exceptionsList || [];
this.exceptionsWhiteList = data.exceptionsWhiteList || [];
this.exceptionsMode = data.exceptionsMode === 'whitelist' ? 'whitelist' : 'blacklist';
if (this.lists.length === 0) {
this.lists.push({
@@ -93,6 +106,8 @@ export class PopupController {
wordSearchQuery?: string;
currentPage?: number;
scrollPositions?: Record<string, number>;
pageHighlightsGroupByList?: boolean;
pageHighlightsListFilter?: number[];
};
if (typeof state.activeTab === 'string' && state.activeTab !== 'options') {
this.activeTab = state.activeTab;
@@ -109,18 +124,26 @@ export class PopupController {
if (state.scrollPositions && typeof state.scrollPositions === 'object') {
this.scrollPositions = { ...state.scrollPositions };
}
if (typeof state.pageHighlightsGroupByList === 'boolean') {
this.pageHighlightsGroupByList = state.pageHighlightsGroupByList;
}
if (Array.isArray(state.pageHighlightsListFilter)) {
this.pageHighlightsListFilter = new Set(state.pageHighlightsListFilter);
}
} catch {
// keep defaults
}
}
private getPopupStatePayload(): { activeTab: string; currentListIndex: number; wordSearchQuery: string; currentPage: number; scrollPositions: Record<string, number> } {
private getPopupStatePayload(): { activeTab: string; currentListIndex: number; wordSearchQuery: string; currentPage: number; scrollPositions: Record<string, number>; pageHighlightsGroupByList: boolean; pageHighlightsListFilter: number[] } {
return {
activeTab: this.activeTab,
currentListIndex: this.currentListIndex,
wordSearchQuery: this.wordSearchQuery,
currentPage: this.currentPage,
scrollPositions: this.scrollPositions
scrollPositions: this.scrollPositions,
pageHighlightsGroupByList: this.pageHighlightsGroupByList,
pageHighlightsListFilter: Array.from(this.pageHighlightsListFilter)
};
}
@@ -231,6 +254,7 @@ export class PopupController {
this.setupTabs();
this.setupScrollListeners();
this.setupSettingsOverlay();
this.setupSettingsExportImport();
this.setupListManagement();
this.setupWordManagement();
this.setupSettings();
@@ -261,6 +285,105 @@ export class PopupController {
});
}
private setupSettingsExportImport(): void {
const importSettingsInput = document.getElementById('importSettingsInput') as HTMLInputElement;
document.getElementById('exportSettingsBtn')?.addEventListener('click', () => {
const data: ExportData = {
lists: this.lists,
exceptionsList: [...this.exceptionsList],
exceptionsWhiteList: [...this.exceptionsWhiteList],
exceptionsMode: this.exceptionsMode
};
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'goose-highlighter-settings.json';
a.click();
URL.revokeObjectURL(url);
});
document.getElementById('importSettingsBtn')?.addEventListener('click', () => {
importSettingsInput?.click();
});
importSettingsInput?.addEventListener('change', (e) => {
const file = (e.target as HTMLInputElement).files?.[0];
if (!file) return;
const reader = new FileReader();
reader.onload = async (event) => {
try {
const raw = event.target?.result as string;
const data = JSON.parse(raw) as unknown;
if (!data || typeof data !== 'object') {
alert(chrome.i18n.getMessage('invalid_import_format') || 'Invalid file format. Please select a valid export file.');
importSettingsInput.value = '';
return;
}
const obj = data as Record<string, unknown>;
let listsApplied = false;
let exceptionsApplied = false;
if (Array.isArray(obj.lists) && obj.lists.length > 0) {
const baseId = Date.now();
const validLists = obj.lists
.filter((item: unknown) => this.isValidList(item))
.map((item: HighlightList, i: number) => ({ ...item, id: baseId + i }));
if (validLists.length > 0) {
this.lists = validLists;
this.currentListIndex = Math.min(this.currentListIndex, this.lists.length - 1);
listsApplied = true;
}
}
if (Array.isArray(obj.exceptionsList)) {
this.exceptionsList = obj.exceptionsList.filter((d): d is string => typeof d === 'string');
exceptionsApplied = true;
}
if (Array.isArray(obj.exceptionsWhiteList)) {
this.exceptionsWhiteList = obj.exceptionsWhiteList.filter((d): d is string => typeof d === 'string');
exceptionsApplied = true;
}
if (obj.exceptionsMode === 'whitelist' || obj.exceptionsMode === 'blacklist') {
this.exceptionsMode = obj.exceptionsMode;
exceptionsApplied = true;
}
if (!listsApplied && !exceptionsApplied) {
alert(chrome.i18n.getMessage('invalid_import_format') || 'Invalid file format. Please select a valid export file.');
importSettingsInput.value = '';
return;
}
if (listsApplied && this.lists.length === 0) {
this.lists.push({
id: Date.now(),
name: chrome.i18n.getMessage('default_list_name') || 'Default List',
background: '#ffff00',
foreground: '#000000',
active: true,
words: []
});
}
await this.save();
MessageService.sendToAllTabs({ type: 'WORD_LIST_UPDATED' });
MessageService.sendToAllTabs({ type: 'EXCEPTIONS_LIST_UPDATED' });
this.render();
importSettingsInput.value = '';
} catch (err) {
alert((chrome.i18n.getMessage('invalid_json_error') || 'Invalid JSON file') + ': ' + (err as Error).message);
importSettingsInput.value = '';
}
};
reader.readAsText(file);
});
}
private setupTabs(): void {
document.querySelectorAll('.tab-button').forEach(button => {
button.addEventListener('click', () => {
@@ -818,14 +941,24 @@ export class PopupController {
}
private setupPageHighlights(): void {
document.getElementById('refreshHighlightsBtn')?.addEventListener('click', async () => {
await this.loadPageHighlights();
});
document.getElementById('pageHighlightsList')?.addEventListener('click', async (e) => {
const target = e.target as HTMLElement;
const item = target.closest('.page-highlight-item') as HTMLElement;
const groupHeader = target.closest('.page-highlights-group-header');
if (groupHeader) {
const section = groupHeader.closest('.page-highlights-group-section');
const groupKey = section?.getAttribute('data-group');
if (groupKey) {
if (this.pageHighlightsCollapsedGroups.has(groupKey)) {
this.pageHighlightsCollapsedGroups.delete(groupKey);
} else {
this.pageHighlightsCollapsedGroups.add(groupKey);
}
this.renderPageHighlights();
return;
}
}
const item = target.closest('.page-highlight-item') as HTMLElement;
if (!item) return;
const word = item.dataset.word;
@@ -844,6 +977,12 @@ export class PopupController {
await this.jumpToHighlight(word, currentIndex);
}
});
document.getElementById('pageHighlightsGroupByList')?.addEventListener('change', (e) => {
this.pageHighlightsGroupByList = (e.target as HTMLInputElement).checked;
this.savePopupState();
this.renderPageHighlights();
});
}
private async loadPageHighlights(): Promise<void> {
@@ -851,15 +990,26 @@ export class PopupController {
const response = await MessageService.sendToActiveTab({ type: 'GET_PAGE_HIGHLIGHTS' });
if (response && response.highlights) {
this.pageHighlights = response.highlights;
this.pageHighlights = response.highlights.map((h: { word: string; count: number; background: string; foreground: string; listId?: number; listName?: string; listNames?: string[] }) => ({
...h,
listNames: h.listNames || (h.listName ? [h.listName] : [])
}));
this.pageHighlightsActiveLists = response.lists || [];
const listIdsOnPage = this.getListIdsWithMatchesOnPage();
if (listIdsOnPage.size > 0) {
this.pageHighlightsListFilter = new Set(listIdsOnPage);
}
this.highlightIndices.clear();
this.pageHighlights.forEach(h => this.highlightIndices.set(h.word, 0));
this.renderPageHighlights();
this.renderPageHighlightsFilters();
}
} catch (e) {
console.error('Error loading page highlights:', e);
this.pageHighlights = [];
this.pageHighlightsActiveLists = [];
this.renderPageHighlights();
this.renderPageHighlightsFilters();
}
}
@@ -886,72 +1036,246 @@ export class PopupController {
await this.jumpToHighlight(word, newIndex);
}
private passesListFilter(h: { listId?: number; listNames: string[] }): boolean {
if (this.pageHighlightsListFilter.size === 0) return true;
if (this.pageHighlightsListFilter.has(-1)) return false;
const wordListIds = new Set<number>();
if (h.listId !== undefined) wordListIds.add(h.listId);
for (const name of h.listNames) {
const list = this.pageHighlightsActiveLists.find(l => l.name === name);
if (list) wordListIds.add(list.id);
}
return [...wordListIds].some(id => this.pageHighlightsListFilter.has(id));
}
private renderPageHighlightsItem(highlight: { word: string; count: number; background: string; foreground: string; listNames: string[] }): string {
const currentIndex = this.highlightIndices.get(highlight.word) || 0;
return `
<div class="page-highlight-item" data-word="${DOMUtils.escapeHtml(highlight.word)}" style="border-left-color: ${highlight.background}; --item-tint: ${highlight.background};">
<div class="page-highlight-word">
<span class="page-highlight-preview">
<span class="preview-dot" style="background-color: ${highlight.background};"></span>
${DOMUtils.escapeHtml(highlight.word)}
</span>
${highlight.count > 1 ? `<span class="page-highlight-position">${currentIndex + 1}/${highlight.count}</span>` : ''}
</div>
${highlight.count > 1 ? `
<div class="page-highlight-nav">
<button class="highlight-prev" title="${chrome.i18n.getMessage('previous') || 'Previous'}">
<i class="fa-solid fa-chevron-up"></i>
</button>
<button class="highlight-next" title="${chrome.i18n.getMessage('next') || 'Next'}">
<i class="fa-solid fa-chevron-down"></i>
</button>
</div>
` : ''}
</div>
`;
}
private renderPageHighlights(): void {
const container = document.getElementById('pageHighlightsList');
const countElement = document.getElementById('totalHighlightsCount');
if (!container || !countElement) return;
const totalCount = this.pageHighlights.reduce((sum, h) => sum + h.count, 0);
const filtered = this.pageHighlights.filter(h => this.passesListFilter(h));
const totalCount = filtered.reduce((sum, h) => sum + h.count, 0);
countElement.textContent = totalCount.toString();
if (this.pageHighlights.length === 0) {
if (filtered.length === 0) {
container.innerHTML = `<div class="page-highlights-empty">${chrome.i18n.getMessage('no_highlights_on_page') || 'No highlights on this page'}</div>`;
return;
}
container.innerHTML = this.pageHighlights.map(highlight => {
const currentIndex = this.highlightIndices.get(highlight.word) || 0;
return `
<div class="page-highlight-item" data-word="${DOMUtils.escapeHtml(highlight.word)}">
<div class="page-highlight-word">
<span class="page-highlight-preview" style="background-color: ${highlight.background}; color: ${highlight.foreground};">
${DOMUtils.escapeHtml(highlight.word)}
</span>
${highlight.count > 1 ? `<span class="page-highlight-position">${currentIndex + 1}/${highlight.count}</span>` : ''}
</div>
${highlight.count > 1 ? `
<div class="page-highlight-nav">
<button class="highlight-prev" title="${chrome.i18n.getMessage('previous') || 'Previous'}">
<i class="fa-solid fa-chevron-up"></i>
</button>
<button class="highlight-next" title="${chrome.i18n.getMessage('next') || 'Next'}">
<i class="fa-solid fa-chevron-down"></i>
</button>
if (this.pageHighlightsGroupByList && this.pageHighlightsActiveLists.length > 0) {
const listIds = new Set(this.pageHighlightsActiveLists.map(l => l.id).filter(id => this.pageHighlightsListFilter.has(id) || this.pageHighlightsListFilter.size === 0));
const groupOrder = this.pageHighlightsActiveLists.filter(l => listIds.has(l.id));
let html = '';
for (const list of groupOrder) {
const items = filtered.filter(h => h.listId === list.id || (h.listNames && h.listNames.includes(list.name)));
if (items.length === 0) continue;
const groupKey = `list-${list.id}`;
const collapsed = this.pageHighlightsCollapsedGroups.has(groupKey);
const chevron = collapsed ? 'fa-chevron-right' : 'fa-chevron-down';
html += `
<div class="page-highlights-group-section ${collapsed ? 'collapsed' : ''}" data-group="${groupKey}">
<div class="page-highlights-group-header">
<i class="fa-solid ${chevron}"></i>
<span class="group-dot" style="background-color: ${list.background};"></span>
<span>${DOMUtils.escapeHtml(list.name)}</span>
<span style="opacity: 0.6; margin-left: 4px;">(${items.reduce((s, i) => s + i.count, 0)})</span>
</div>
` : ''}
</div>
`;
}).join('');
${collapsed ? '' : items.map(h => this.renderPageHighlightsItem(h)).join('')}
</div>
`;
}
const ungrouped = filtered.filter(h => !groupOrder.some(l => h.listId === l.id || (h.listNames && h.listNames.includes(l.name))));
if (ungrouped.length > 0) {
const groupKey = 'list-other';
const collapsed = this.pageHighlightsCollapsedGroups.has(groupKey);
const chevron = collapsed ? 'fa-chevron-right' : 'fa-chevron-down';
html += `
<div class="page-highlights-group-section ${collapsed ? 'collapsed' : ''}" data-group="${groupKey}">
<div class="page-highlights-group-header">
<i class="fa-solid ${chevron}"></i>
<span style="opacity: 0.6;">${chrome.i18n.getMessage('other') || 'Other'}</span>
</div>
${collapsed ? '' : ungrouped.map(h => this.renderPageHighlightsItem(h)).join('')}
</div>
`;
}
container.innerHTML = html;
} else {
container.innerHTML = filtered.map(h => this.renderPageHighlightsItem(h)).join('');
}
if (this.activeTab === 'page-highlights') {
requestAnimationFrame(() => this.restoreScrollPositions());
}
}
private setupExceptions(): void {
document.getElementById('toggleExceptionBtn')?.addEventListener('click', async () => {
if (!this.currentTabHost) return;
private static readonly PAGE_HIGHLIGHTS_MANY_LISTS_THRESHOLD = 8;
const isException = this.exceptionsList.includes(this.currentTabHost);
if (isException) {
this.exceptionsList = this.exceptionsList.filter(domain => domain !== this.currentTabHost);
} else {
this.exceptionsList.push(this.currentTabHost);
/** List IDs that have at least one highlight on the current page (from pageHighlights). */
private getListIdsWithMatchesOnPage(): Set<number> {
const ids = new Set<number>();
for (const h of this.pageHighlights) {
if (h.listId !== undefined) ids.add(h.listId);
for (const name of h.listNames) {
const list = this.pageHighlightsActiveLists.find(l => l.name === name);
if (list) ids.add(list.id);
}
}
return ids;
}
this.updateExceptionButton();
this.renderExceptions();
await StorageService.update('exceptionsList', this.exceptionsList);
/** Lists that have at least one word found on the current page (for filter chips only). */
private getListsWithMatchesOnPage(): Array<{ id: number; name: string; background: string }> {
const ids = this.getListIdsWithMatchesOnPage();
return this.pageHighlightsActiveLists.filter(l => ids.has(l.id));
}
private renderPageHighlightsFilters(): void {
const container = document.getElementById('pageHighlightsListFilters');
const actionsEl = document.getElementById('pageHighlightsFiltersActions');
if (!container) return;
const listsOnPage = this.getListsWithMatchesOnPage();
if (listsOnPage.length <= 1) {
container.innerHTML = '';
if (actionsEl) {
actionsEl.innerHTML = '';
actionsEl.hidden = true;
}
return;
}
const isNone = this.pageHighlightsListFilter.size === 1 && this.pageHighlightsListFilter.has(-1);
const allSelected = !isNone && (this.pageHighlightsListFilter.size === 0 || this.pageHighlightsListFilter.size === listsOnPage.length);
const showQuickActions = listsOnPage.length > PopupController.PAGE_HIGHLIGHTS_MANY_LISTS_THRESHOLD;
if (actionsEl) {
if (showQuickActions) {
const allLabel = chrome.i18n.getMessage('select_all') || 'Select all';
const noneLabel = chrome.i18n.getMessage('deselect_all') || 'Deselect all';
actionsEl.innerHTML = `
<button type="button" class="page-highlights-filter-link" data-filter-action="all">${DOMUtils.escapeHtml(allLabel)}</button>
<span aria-hidden="true"> · </span>
<button type="button" class="page-highlights-filter-link" data-filter-action="none">${DOMUtils.escapeHtml(noneLabel)}</button>
`;
actionsEl.hidden = false;
actionsEl.querySelectorAll('.page-highlights-filter-link').forEach(btn => {
btn.addEventListener('click', () => {
const action = (btn as HTMLElement).dataset.filterAction;
if (action === 'all') {
this.pageHighlightsListFilter = new Set();
} else if (action === 'none') {
this.pageHighlightsListFilter = new Set([-1]);
}
this.savePopupState();
this.renderPageHighlights();
this.renderPageHighlightsFilters();
});
});
} else {
actionsEl.innerHTML = '';
actionsEl.hidden = true;
}
}
const active = (listId: number) =>
!isNone && (this.pageHighlightsListFilter.size === 0 || this.pageHighlightsListFilter.has(listId));
container.innerHTML = listsOnPage.map(list => {
const chipActive = active(list.id);
const bg = DOMUtils.escapeHtml(list.background);
return `
<button type="button" class="page-highlights-filter-chip ${chipActive ? 'active' : ''}" data-list-id="${list.id}" title="${DOMUtils.escapeHtml(list.name)}" style="--list-color: ${bg};">
<span class="filter-dot" style="background-color: ${bg};"></span>
<span>${DOMUtils.escapeHtml(list.name)}</span>
</button>
`;
}).join('');
container.querySelectorAll('.page-highlights-filter-chip').forEach(btn => {
btn.addEventListener('click', () => {
const id = Number((btn as HTMLElement).dataset.listId);
const listIdsOnPage = this.getListIdsWithMatchesOnPage();
const allSelected = this.pageHighlightsListFilter.size === 0;
if (this.pageHighlightsListFilter.has(id)) {
this.pageHighlightsListFilter.delete(id);
if (this.pageHighlightsListFilter.size === 0) {
this.pageHighlightsListFilter = new Set();
}
} else {
if (allSelected) {
this.pageHighlightsListFilter = new Set(listIdsOnPage);
this.pageHighlightsListFilter.delete(id);
} else {
this.pageHighlightsListFilter.add(id);
}
}
if (this.pageHighlightsListFilter.has(-1)) {
this.pageHighlightsListFilter.delete(-1);
}
this.savePopupState();
this.renderPageHighlights();
this.renderPageHighlightsFilters();
});
});
}
private setupExceptions(): void {
document.getElementById('exceptionsModeSelect')?.addEventListener('change', async (e) => {
const value = (e.target as HTMLSelectElement).value;
this.exceptionsMode = value === 'whitelist' ? 'whitelist' : 'blacklist';
await StorageService.update('exceptionsMode', this.exceptionsMode);
MessageService.sendToAllTabs({ type: 'EXCEPTIONS_LIST_UPDATED' });
this.updateExceptionsModeLabel();
this.updateExceptionsModeHint();
this.renderExceptions();
this.updateAddCurrentSiteButton();
});
document.getElementById('addExceptionBtn')?.addEventListener('click', () => this.addExceptionFromInput());
document.getElementById('addCurrentSiteBtn')?.addEventListener('click', () => this.addCurrentSiteToExceptions());
(document.getElementById('exceptionDomainInput') as HTMLInputElement)?.addEventListener('keydown', (e) => {
if (e.key === 'Enter') this.addExceptionFromInput();
});
document.getElementById('clearExceptionsBtn')?.addEventListener('click', async () => {
if (confirm(chrome.i18n.getMessage('confirm_clear_exceptions') || 'Clear all exceptions?')) {
this.exceptionsList = [];
this.updateExceptionButton();
if (this.exceptionsMode === 'whitelist') {
this.exceptionsWhiteList = [];
} else {
this.exceptionsList = [];
}
this.renderExceptions();
await StorageService.update('exceptionsList', this.exceptionsList);
this.updateAddCurrentSiteButton();
await StorageService.set({
exceptionsList: this.exceptionsList,
exceptionsWhiteList: this.exceptionsWhiteList
});
MessageService.sendToAllTabs({ type: 'EXCEPTIONS_LIST_UPDATED' });
}
});
@@ -960,10 +1284,17 @@ export class PopupController {
const button = (e.target as HTMLElement).closest('.exception-remove');
if (button) {
const domain = (button as HTMLElement).dataset.domain!;
this.exceptionsList = this.exceptionsList.filter(d => d !== domain);
this.updateExceptionButton();
if (this.exceptionsMode === 'whitelist') {
this.exceptionsWhiteList = this.exceptionsWhiteList.filter(d => d !== domain);
} else {
this.exceptionsList = this.exceptionsList.filter(d => d !== domain);
}
this.renderExceptions();
await StorageService.update('exceptionsList', this.exceptionsList);
this.updateAddCurrentSiteButton();
await StorageService.set({
exceptionsList: this.exceptionsList,
exceptionsWhiteList: this.exceptionsWhiteList
});
MessageService.sendToAllTabs({ type: 'EXCEPTIONS_LIST_UPDATED' });
}
});
@@ -1101,7 +1432,9 @@ export class PopupController {
globalHighlightEnabled: this.globalHighlightEnabled,
matchCaseEnabled: this.matchCaseEnabled,
matchWholeEnabled: this.matchWholeEnabled,
exceptionsList: this.exceptionsList
exceptionsList: this.exceptionsList,
exceptionsWhiteList: this.exceptionsWhiteList,
exceptionsMode: this.exceptionsMode
});
this.renderLists();
@@ -1111,7 +1444,7 @@ export class PopupController {
private setupStorageSync(): void {
chrome.storage.onChanged.addListener((changes, areaName) => {
if (areaName !== 'local') return;
if (changes.lists || changes.globalHighlightEnabled || changes.matchCaseEnabled || changes.matchWholeEnabled || changes.exceptionsList) {
if (changes.lists || changes.globalHighlightEnabled || changes.matchCaseEnabled || changes.matchWholeEnabled || changes.exceptionsList || changes.exceptionsWhiteList || changes.exceptionsMode) {
this.reloadFromStorage();
}
});
@@ -1124,6 +1457,8 @@ export class PopupController {
this.matchCaseEnabled = data.matchCaseEnabled ?? false;
this.matchWholeEnabled = data.matchWholeEnabled ?? false;
this.exceptionsList = data.exceptionsList || [];
this.exceptionsWhiteList = data.exceptionsWhiteList || [];
this.exceptionsMode = data.exceptionsMode === 'whitelist' ? 'whitelist' : 'blacklist';
if (this.lists.length === 0) {
this.lists.push({
@@ -1148,7 +1483,10 @@ export class PopupController {
this.renderLists();
this.renderWords();
this.renderExceptions();
this.updateExceptionButton();
this.updateExceptionsModeSelect();
this.updateExceptionsModeLabel();
this.updateExceptionsModeHint();
this.updateAddCurrentSiteButton();
this.updateFormValues();
}
@@ -1375,41 +1713,117 @@ export class PopupController {
`;
}
private updateExceptionButton(): void {
const toggleBtn = document.getElementById('toggleExceptionBtn');
const btnText = document.getElementById('exceptionBtnText');
if (!toggleBtn || !btnText || !this.currentTabHost) return;
const isException = this.exceptionsList.includes(this.currentTabHost);
if (isException) {
btnText.textContent = chrome.i18n.getMessage('remove_exception') || 'Remove from Exceptions';
toggleBtn.classList.add('danger');
const icon = toggleBtn.querySelector('i');
if (icon) icon.className = 'fa-solid fa-trash';
} else {
btnText.textContent = chrome.i18n.getMessage('add_exception') || 'Add to Exceptions';
toggleBtn.classList.remove('danger');
const icon = toggleBtn.querySelector('i');
if (icon) icon.className = 'fa-solid fa-plus';
private normalizeDomain(input: string): string | null {
const raw = input.trim().toLowerCase();
if (!raw) return null;
try {
if (raw.includes('.')) {
const url = raw.startsWith('http') ? new URL(raw) : new URL(`https://${raw}`);
return url.hostname;
}
return raw;
} catch {
return raw;
}
}
private addExceptionFromInput(): void {
const input = document.getElementById('exceptionDomainInput') as HTMLInputElement;
if (!input) return;
const domain = this.normalizeDomain(input.value);
if (!domain) return;
const list = this.getCurrentExceptionsList();
if (list.includes(domain)) {
input.value = '';
return;
}
if (this.exceptionsMode === 'whitelist') {
this.exceptionsWhiteList.push(domain);
} else {
this.exceptionsList.push(domain);
}
input.value = '';
this.renderExceptions();
StorageService.set({
exceptionsList: this.exceptionsList,
exceptionsWhiteList: this.exceptionsWhiteList
}).then(() => {
MessageService.sendToAllTabs({ type: 'EXCEPTIONS_LIST_UPDATED' });
});
}
private async addCurrentSiteToExceptions(): Promise<void> {
let host = this.currentTabHost;
if (!host) {
await this.getCurrentTab();
host = this.currentTabHost;
}
if (!host) return;
const domain = host.toLowerCase();
const list = this.getCurrentExceptionsList();
if (list.includes(domain)) return;
if (this.exceptionsMode === 'whitelist') {
this.exceptionsWhiteList.push(domain);
} else {
this.exceptionsList.push(domain);
}
this.renderExceptions();
await StorageService.set({
exceptionsList: this.exceptionsList,
exceptionsWhiteList: this.exceptionsWhiteList
});
MessageService.sendToAllTabs({ type: 'EXCEPTIONS_LIST_UPDATED' });
this.updateAddCurrentSiteButton();
}
private updateExceptionsModeSelect(): void {
const select = document.getElementById('exceptionsModeSelect') as HTMLSelectElement | null;
if (select) select.value = this.exceptionsMode;
}
private updateExceptionsModeLabel(): void {
const label = document.getElementById('exceptionsListLabel');
if (!label) return;
const key = this.exceptionsMode === 'whitelist' ? 'exceptions_list_whitelist' : 'exceptions_list_blacklist';
label.textContent = chrome.i18n.getMessage(key) || (this.exceptionsMode === 'whitelist' ? 'Sites to highlight (whitelist):' : 'Sites to exclude (blacklist):');
}
private updateExceptionsModeHint(): void {
const hint = document.getElementById('exceptionsModeHint');
if (!hint) return;
const key = this.exceptionsMode === 'whitelist' ? 'exceptions_mode_hint_whitelist' : 'exceptions_mode_hint_blacklist';
hint.textContent = chrome.i18n.getMessage(key) || (this.exceptionsMode === 'whitelist' ? 'Only highlight on these sites.' : 'Don\'t highlight on these sites.');
}
private updateAddCurrentSiteButton(): void {
const btn = document.getElementById('addCurrentSiteBtn') as HTMLButtonElement | null;
if (!btn) return;
const host = this.currentTabHost.toLowerCase();
const list = this.getCurrentExceptionsList();
const alreadyInList = host !== '' && list.includes(host);
btn.disabled = !host || alreadyInList;
}
private renderExceptions(): void {
const container = document.getElementById('exceptionsList');
if (!container) return;
if (this.exceptionsList.length === 0) {
container.innerHTML = `<div class="exception-item">${chrome.i18n.getMessage('no_exceptions') || 'No exceptions'}</div>`;
const list = this.getCurrentExceptionsList();
if (list.length === 0) {
container.innerHTML = `<div class="exception-item exception-empty">${chrome.i18n.getMessage('no_exceptions') || 'No exceptions'}</div>`;
return;
}
container.innerHTML = this.exceptionsList.map(domain =>
container.innerHTML = list.map(domain =>
`<div class="exception-item">
<span class="exception-domain-icon"><i class="fa-solid fa-at"></i></span>
<span class="exception-domain">${DOMUtils.escapeHtml(domain)}</span>
<button type="button" class="exception-remove" data-domain="${DOMUtils.escapeHtml(domain)}" title="${DOMUtils.escapeHtml(chrome.i18n.getMessage('remove') || 'Remove')}" aria-label="${DOMUtils.escapeHtml(chrome.i18n.getMessage('remove') || 'Remove')}">
<i class="fa-solid fa-trash"></i>
<i class="fa-solid fa-xmark"></i>
</button>
</div>`
).join('');
@@ -1419,5 +1833,7 @@ export class PopupController {
(document.getElementById('globalHighlightToggle') as HTMLInputElement).checked = this.globalHighlightEnabled;
(document.getElementById('matchCase') as HTMLInputElement).checked = this.matchCaseEnabled;
(document.getElementById('matchWhole') as HTMLInputElement).checked = this.matchWholeEnabled;
const groupCheckbox = document.getElementById('pageHighlightsGroupByList') as HTMLInputElement;
if (groupCheckbox) groupCheckbox.checked = this.pageHighlightsGroupByList;
}
}

View File

@@ -14,18 +14,24 @@ export interface HighlightList {
words: HighlightWord[];
}
export type ExceptionsMode = 'blacklist' | 'whitelist';
export interface StorageData {
lists: HighlightList[];
globalHighlightEnabled: boolean;
matchCaseEnabled: boolean;
matchWholeEnabled: boolean;
exceptionsList: string[];
exceptionsWhiteList: string[];
exceptionsMode: ExceptionsMode;
}
export interface ActiveWord {
text: string;
background: string;
foreground: string;
listId?: number;
listName?: string;
}
export interface HighlightInfo {
@@ -33,6 +39,9 @@ export interface HighlightInfo {
count: number;
background: string;
foreground: string;
listId?: number;
listName?: string;
listNames?: string[];
}
export interface MessageData {
@@ -48,6 +57,8 @@ export interface MessageData {
export interface ExportData {
lists: HighlightList[];
exceptionsList: string[];
exceptionsWhiteList?: string[];
exceptionsMode?: ExceptionsMode;
}
export const DEFAULT_STORAGE: StorageData = {
@@ -55,7 +66,9 @@ export const DEFAULT_STORAGE: StorageData = {
globalHighlightEnabled: true,
matchCaseEnabled: false,
matchWholeEnabled: false,
exceptionsList: []
exceptionsList: [],
exceptionsWhiteList: [],
exceptionsMode: 'blacklist'
};
export const CONSTANTS = {