Add Disable passkeys for Site Preferences features

This commit is contained in:
varjolintu 2025-09-20 11:40:59 +03:00
parent bbff228b40
commit b439017d0f
6 changed files with 14 additions and 6 deletions

View file

@ -120,6 +120,7 @@
"IGNORE_FULL": "readonly",
"IGNORE_NORMAL": "readonly",
"IGNORE_NOTHING": "readonly",
"IGNORE_PASSKEYS": "readonly",
"importScripts": "readonly",
"IMPROVED_DETECTION_PREDEFINED_SITELIST": "readonly",
"initColorTheme": "readonly",

View file

@ -1118,8 +1118,8 @@
"message": "Page URL",
"description": "Site Preferences list column title."
},
"optionsColumnIgnore": {
"message": "Ignore",
"optionsColumnFeatures": {
"message": "Features",
"description": "Site Preferences list column title."
},
"optionsColumnUsernameOnly": {
@ -1150,6 +1150,10 @@
"message": "Disable Auto-Submit",
"description": "Site Preferences option selection."
},
"optionsSelectionPasskeys": {
"message": "Disable passkeys",
"description": "Site Preferences option selection."
},
"optionsSelectionFull": {
"message": "Disable all features",
"description": "Site Preferences option selection."

View file

@ -335,14 +335,15 @@ page.fillHttpAuth = async function(tab, credentials) {
}
};
page.isSiteIgnored = async function(tab, currentLocation) {
page.isSiteIgnored = async function(tab, args = []) {
const [ currentLocation, checkPasskeys ] = args;
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) {
if (site.ignore === IGNORE_FULL || (checkPasskeys && site.ignore === IGNORE_PASSKEYS)) {
return true;
}
}

View file

@ -6,6 +6,7 @@ const EXTENSION_NAME = 'KeePassXC-Browser';
const IGNORE_NOTHING = 'ignoreNothing';
const IGNORE_NORMAL = 'ignoreNormal';
const IGNORE_AUTOSUBMIT = 'ignoreAutoSubmit';
const IGNORE_PASSKEYS = 'ignorePasskeys';
const IGNORE_FULL = 'ignoreFull';
// Credential sorting options

View file

@ -99,7 +99,7 @@ const initContent = async () => {
return;
}
if (await chrome.runtime.sendMessage({ action: 'is_site_ignored', args: window.self.location.href })) {
if (await chrome.runtime.sendMessage({ action: 'is_site_ignored', args: [ window.self.location.href, true ] })) {
console.log('This site is ignored in Site Preferences.');
return;
}

View file

@ -762,7 +762,7 @@
<tr>
<th scope="col"><span data-i18n="optionsColumnPageURL"></span></th>
<th scope="col"></th>
<th scope="col"><span data-i18n="optionsColumnIgnore"></span></th>
<th scope="col"><span data-i18n="optionsColumnFeatures"></span></th>
<th scope="col"></th>
</tr>
</thead>
@ -798,6 +798,7 @@
<option value="ignoreNothing" data-i18n="optionsSelectionNothing"></option>
<option value="ignoreNormal" data-i18n="optionsSelectionNormal"></option>
<option value="ignoreAutoSubmit" data-i18n="optionsSelectionAutoSubmit"></option>
<option value="ignorePasskeys" data-i18n="optionsSelectionPasskeys"></option>
<option value="ignoreFull" data-i18n="optionsSelectionFull"></option>
</select>
</td>