From eb9ba6522ec0dae8f1ff0b117abc6c9ac433187e Mon Sep 17 00:00:00 2001 From: varjolintu Date: Fri, 5 Jul 2024 16:31:41 +0300 Subject: [PATCH] Fix iframe TLD matching --- keepassxc-browser/background/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepassxc-browser/background/page.js b/keepassxc-browser/background/page.js index 8a4504d..dff53c5 100755 --- a/keepassxc-browser/background/page.js +++ b/keepassxc-browser/background/page.js @@ -423,7 +423,7 @@ page.getBaseDomainFromUrl = async function(hostname, url) { } // Remove the top level domain part from the hostname, e.g. https://another.example.co.uk -> https://another.example - const finalDomain = hostname.slice(0, hostname.indexOf(tld) - 1); + const finalDomain = hostname.slice(0, hostname.lastIndexOf(tld) - 1); // Split the URL and select the last part, e.g. https://another.example -> example let baseDomain = finalDomain.split('.')?.at(-1); // Append the top level domain back to the URL, e.g. example -> example.co.uk