From 97b60dcc70877e917db6f540abf97687b03336b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20V=C3=A4nttinen?= Date: Fri, 26 Jul 2024 07:53:53 +0300 Subject: [PATCH] Fix XML formatting (#2287) Fix XML formatting --- dist/manifest_chromium.json | 4 ++++ dist/manifest_firefox.json | 4 ++++ keepassxc-browser/content/keepassxc-browser.js | 6 +++++- keepassxc-browser/manifest.json | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dist/manifest_chromium.json b/dist/manifest_chromium.json index b9bd63f..1984026 100755 --- a/dist/manifest_chromium.json +++ b/dist/manifest_chromium.json @@ -38,6 +38,10 @@ "matches": [ "" ], + "exclude_matches": [ + "*://*/*.xml*", + "file:///*.xml*" + ], "js": [ "common/browser-polyfill.min.js", "common/global.js", diff --git a/dist/manifest_firefox.json b/dist/manifest_firefox.json index 7d13538..02b2937 100644 --- a/dist/manifest_firefox.json +++ b/dist/manifest_firefox.json @@ -51,6 +51,10 @@ "matches": [ "" ], + "exclude_matches": [ + "*://*/*.xml*", + "file:///*.xml*" + ], "js": [ "common/browser-polyfill.min.js", "common/global.js", diff --git a/keepassxc-browser/content/keepassxc-browser.js b/keepassxc-browser/content/keepassxc-browser.js index 3105481..39ecdb6 100755 --- a/keepassxc-browser/content/keepassxc-browser.js +++ b/keepassxc-browser/content/keepassxc-browser.js @@ -845,7 +845,7 @@ kpxc.updateTOTPList = async function() { // Apply a script to the page for intercepting Passkeys (WebAuthn) requests kpxc.enablePasskeys = function() { - if (document?.documentElement?.ownerDocument?.contentType === 'text/xml') { + if (document?.documentElement?.ownerDocument?.contentType !== 'text/html') { return; } @@ -925,6 +925,10 @@ kpxc.enablePasskeys = function() { */ const initContentScript = async function() { try { + if (document?.documentElement?.ownerDocument?.contentType !== 'text/html') { + return; + } + const settings = await sendMessage('load_settings'); if (!settings) { logError('Error: Cannot load extension settings'); diff --git a/keepassxc-browser/manifest.json b/keepassxc-browser/manifest.json index 1fdbd2d..4d66f57 100755 --- a/keepassxc-browser/manifest.json +++ b/keepassxc-browser/manifest.json @@ -52,6 +52,10 @@ "matches": [ "" ], + "exclude_matches": [ + "*://*/*.xml*", + "file:///*.xml*" + ], "js": [ "common/browser-polyfill.min.js", "common/global.js",