diff --git a/.vscode/cSpell.json b/.vscode/cSpell.json index 2b459e7c..f76c2cc9 100644 --- a/.vscode/cSpell.json +++ b/.vscode/cSpell.json @@ -17,6 +17,7 @@ "DKIM", "DMARC", "dnssec", + "endregion", "esversion", "favicons", "googlecode", diff --git a/_locales/de/messages.json b/_locales/de/messages.json index 910d0ff0..6d2de0ad 100644 --- a/_locales/de/messages.json +++ b/_locales/de/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "Erlaube auch Subdomains der SDIDs" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "Behandel falsche SDID als Warnung anstatt als Fehler" }, "options_viewSigners": { diff --git a/_locales/en_US/messages.json b/_locales/en_US/messages.json index 8173149f..073d1d62 100644 --- a/_locales/en_US/messages.json +++ b/_locales/en_US/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "Allow also subdomains of the SDIDs" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "Treat wrong SDID as a warning instead of an error" }, "options_viewSigners": { diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 631ae112..258ed307 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "Autoriser également les sous domaines du SDID" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "Traiter un mauvais SDID comme un avertissement au lieu d'une erreur" }, "options_viewSigners": { diff --git a/_locales/hu/messages.json b/_locales/hu/messages.json index b92a0f1f..9430f164 100644 --- a/_locales/hu/messages.json +++ b/_locales/hu/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "SDID-altartományok engedélyezése" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "A helytelen SDID-t figyelmeztetésként kezelje, nem hibaként" }, "options_viewSigners": { diff --git a/_locales/it/messages.json b/_locales/it/messages.json index 4da2be0a..ab646cf8 100644 --- a/_locales/it/messages.json +++ b/_locales/it/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "Permetti anche i sotto-domini dei SDID" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "Considera SDID errato come un avviso invece che come un errore" }, "options_viewSigners": { diff --git a/_locales/ja_JP/messages.json b/_locales/ja_JP/messages.json index 93e4f950..b58671e2 100644 --- a/_locales/ja_JP/messages.json +++ b/_locales/ja_JP/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "SDID のサブドメインも許容" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "正しくない SDID をエラーではなく警告として扱う" }, "options_viewSigners": { diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 03a32179..2ef1e8d1 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -381,7 +381,7 @@ "options_policy.signRules.sdid.allowSubDomains": { "message": "也允许 SDID 项的子域" }, - "options_error.policy.wrong_sdid.asWarning": { + "options_policy.signRules.error.wrong_sdid.asWarning": { "message": "将错误的 SDID 视作一个警告而不是错误" }, "options_viewSigners": { diff --git a/content/background.mjs.js b/content/background.mjs.js index 1cdbbe15..e228fead 100644 --- a/content/background.mjs.js +++ b/content/background.mjs.js @@ -14,10 +14,22 @@ import { DKIM_InternalError, DKIM_SigError } from "../modules/error.mjs.js"; import AuthVerifier from "../modules/AuthVerifier.mjs.js"; import Logging from "../modules/logging.mjs.js"; +import prefs from "../modules/preferences.mjs.js"; import { setKeyFetchFunction } from "../modules/dkim/verifier.mjs.js"; -Logging.setLogLevel(Logging.Level.Debug); const log = Logging.getLogger("background"); +(async () => { + await prefs.init(); + if (prefs.debug) { + /** @type {number|undefined} */ + // @ts-ignore + let logLevel = Logging.Level[prefs["logging.console"]]; + if (!logLevel) { + logLevel = Logging.Level.Debug; + } + Logging.setLogLevel(logLevel); + } +})().catch(error => log.fatal("Setting debug log level failed with:", error)); // eslint-disable-next-line valid-jsdoc /** @type {import("../modules/dkim/verifier.mjs.js").KeyFetchFunction} */ @@ -33,7 +45,6 @@ async function getKey(sdid, selector) { const dnsRes = await browser.jsdns.txt(`${selector}._domainkey.${sdid}`); - if (dnsRes.bogus) { throw new DKIM_InternalError(null, "DKIM_DNSERROR_DNSSEC_BOGUS"); } @@ -45,8 +56,6 @@ async function getKey(sdid, selector) { if (dnsRes.data === null || dnsRes.data[0] === "") { throw new DKIM_SigError("DKIM_SIGERROR_NOKEY"); } - console.log("dd"); - if (!dnsRes.data) { throw new DKIM_SigError("DKIM_SIGERROR_NOKEY"); diff --git a/content/options.html b/content/options.html index 33a0efa7..962fe15c 100644 --- a/content/options.html +++ b/content/options.html @@ -82,7 +82,7 @@
- @@ -91,7 +91,7 @@ - +
@@ -103,7 +103,7 @@ @@ -135,8 +135,8 @@ -