mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-19 08:52:05 -03:00
fix(settings): prevent Firefox save-password prompt from API key input
- Remove server-side value='...' from password field in settings modal template so the API key is never baked into the DOM at page load time - Populate the input dynamically via loadSettingsToUI() when modal opens - Clear both API key and proxy password fields on modal close to prevent Firefox from detecting pre-filled password fields on page navigation
This commit is contained in:
@@ -344,9 +344,14 @@ export class SettingsManager {
|
||||
if (mutation.type === 'attributes' && mutation.attributeName === 'style') {
|
||||
this.isOpen = settingsModal.style.display === 'block';
|
||||
|
||||
// When modal is opened, update checkbox state from current settings
|
||||
if (this.isOpen) {
|
||||
this.loadSettingsToUI();
|
||||
} else {
|
||||
// Clear sensitive fields on close to prevent browser save-password prompts
|
||||
const apiKeyInput = document.getElementById('civitaiApiKey');
|
||||
if (apiKeyInput) apiKeyInput.value = '';
|
||||
const proxyPasswordInput = document.getElementById('proxyPassword');
|
||||
if (proxyPasswordInput) proxyPasswordInput.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -820,6 +825,11 @@ export class SettingsManager {
|
||||
usePortableCheckbox.checked = !!state.global.settings.use_portable_settings;
|
||||
}
|
||||
|
||||
const civitaiApiKeyInput = document.getElementById('civitaiApiKey');
|
||||
if (civitaiApiKeyInput) {
|
||||
civitaiApiKeyInput.value = state.global.settings.civitai_api_key || '';
|
||||
}
|
||||
|
||||
const civitaiHostSelect = document.getElementById('civitaiHost');
|
||||
if (civitaiHostSelect) {
|
||||
civitaiHostSelect.value = state.global.settings.civitai_host || 'civitai.com';
|
||||
|
||||
Reference in New Issue
Block a user