mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Disable passkeys script injection if site is ignored
This commit is contained in:
parent
44e8b45cc6
commit
e11d63df5f
4 changed files with 24 additions and 0 deletions
|
|
@ -264,6 +264,7 @@ kpxcEvent.messageHandlers = {
|
|||
'init_http_auth': kpxcEvent.initHttpAuth,
|
||||
'is_connected': kpxcEvent.getIsKeePassXCAvailable,
|
||||
'is_iframe_allowed': page.isIframeAllowed,
|
||||
'is_site_ignored': page.isSiteIgnored,
|
||||
'load_keyring': kpxcEvent.onLoadKeyRing,
|
||||
'load_settings': kpxcEvent.onLoadSettings,
|
||||
'lock_database': kpxcEvent.lockDatabase,
|
||||
|
|
|
|||
|
|
@ -320,6 +320,22 @@ page.fillHttpAuth = async function(tab, credentials) {
|
|||
}
|
||||
};
|
||||
|
||||
page.isSiteIgnored = async function(tab, currentLocation) {
|
||||
if (!page?.settings?.sitePreferences || !currentLocation) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const site of page.settings.sitePreferences) {
|
||||
if (siteMatch(site.url, currentLocation) || site.url === currentLocation) {
|
||||
if (site.ignore === IGNORE_FULL) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
// Update context menu for attribute filling
|
||||
page.updateContextMenu = async function(tab, credentials) {
|
||||
// Remove any old attribute items
|
||||
|
|
|
|||
|
|
@ -981,6 +981,8 @@ browser.runtime.onMessage.addListener(async function(req, sender) {
|
|||
}
|
||||
} else if (req.action === 'ignore_site') {
|
||||
kpxc.ignoreSite(req.args);
|
||||
} else if (req.action === 'is_site_ignored') {
|
||||
return await kpxc.siteIgnored();
|
||||
} else if (req.action === 'redetect_fields') {
|
||||
const response = await sendMessage('load_settings');
|
||||
kpxc.settings = response;
|
||||
|
|
|
|||
|
|
@ -99,6 +99,11 @@ const initContent = async () => {
|
|||
return;
|
||||
}
|
||||
|
||||
if (await chrome.runtime.sendMessage({ action: 'is_site_ignored', args: window.self.location.href })) {
|
||||
console.log('This site is ignored in Site Preferences.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings.passkeys) {
|
||||
kpxcPasskeysUtils.debugLogging = settings?.debugLogging;
|
||||
kpxcPasskeysUtils.passkeysFallback = settings?.passkeysFallback;
|
||||
|
|
|
|||
Loading…
Reference in a new issue