From bc3e2a877e186a8762da7c69002b1d8d8457aa3d Mon Sep 17 00:00:00 2001 From: "planetrenox@protonmail.com" Date: Wed, 28 Oct 2026 14:29:35 +0000 Subject: [PATCH] Let revealed API keys be copied on Android Chrome keeps treating an input that was ever type=password as a password field, so after tapping the eye the selection menu still hid Copy. Key fields are now plain text inputs masked with -webkit-text-security, and the eye toggles the mask instead of the type. Also fixes the eye icon never switching: lucide swaps for , so querySelector('i') was null and the handler threw. Co-Authored-By: Claude Opus 5.5 --- src/main.js | 2 +- src/parts/modals.html | 2 +- src/style.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 063c265..ee31c8b 100644 --- a/src/main.js +++ b/src/main.js @@ -375,7 +375,7 @@ $(el.accountSettingsModal).on('click',e=>{if(e.target===el.accountSettingsModal| $(el.setUserAvatarBtn).on('click',()=>el.userAvatarInput.click()); $(el.userAvatarInput).on('change',async()=>{const f=el.userAvatarInput.files?.[0];if(!f)return;try{const v=await imgToWebp(f);USER.avatar=v;el.userAvatarPreview.src=v;el.userAvatarPreview.classList.remove('bg-gray-200');renderUserUI()}catch{}}); $(el.accountSettingsForm).on('submit',e=>{e.preventDefault();USER.provider=el.set_provider.value||'openrouter';USER.apiKeyOpenRouter=String(el.set_api_key_or.value||'').trim();USER.apiKeyOpenAI=String(el.set_api_key_oai.value||'').trim();USER.apiKeyGoogle=String(el.set_api_key_g.value||'').trim();USER.apiKeyAnthropic=String(el.set_api_key_ant.value||'').trim();USER.apiKeyCloudflare=String(el.set_api_key_cf.value||'').trim();USER.customKey1=String(el.set_api_key_custom1.value||'').trim();USER.masterPrompt=String(el.set_master_prompt.value||'').trim();USER.titleModel=String(el.set_title_model.value||'').trim();USER.githubToken=String(el.set_gh_token.value||'').trim();USER.name=String(el.set_user_name.value||'').trim();renderUserUI();closeAccountSettings()}) -$(el.accountPanelAPI).on('click',e=>{const b=e.target.closest('[data-reveal-for]');if(!b)return;const i=document.getElementById(b.dataset.revealFor);if(!i)return;const p=i.type==='password';i.type=p?'text':'password';b.querySelector('i').setAttribute('data-lucide',p?'eye-off':'eye');lucide.createIcons()}); +$(el.accountPanelAPI).on('click',e=>{const b=e.target.closest('[data-reveal-for]');if(!b)return;const i=document.getElementById(b.dataset.revealFor);if(!i)return;const m=i.classList.toggle('key-mask');b.innerHTML=``;icons()}); el.accountTabGeneral.onclick=()=>showAccountTab('General');el.accountTabAPI.onclick=()=>showAccountTab('API');el.accountTabUser.onclick=()=>showAccountTab('User') el.exportAccountSettings.onclick=()=>dl(`sune-account-${ts()}.json`,{v:1,provider:USER.provider,apiKeyOpenRouter:USER.apiKeyOpenRouter,apiKeyOpenAI:USER.apiKeyOpenAI,apiKeyGoogle:USER.apiKeyGoogle,apiKeyAnthropic:USER.apiKeyAnthropic,apiKeyCloudflare:USER.apiKeyCloudflare,customKey1:USER.customKey1,masterPrompt:USER.masterPrompt,titleModel:USER.titleModel,githubToken:USER.githubToken,userName:USER.name,userAvatar:USER.avatar}); el.importAccountSettings.onclick=()=>{el.importAccountSettingsInput.value='';el.importAccountSettingsInput.click()}; diff --git a/src/parts/modals.html b/src/parts/modals.html index 62948d9..299c1c2 100644 --- a/src/parts/modals.html +++ b/src/parts/modals.html @@ -122,7 +122,7 @@

Stored locally.

Used for auto-generating thread titles.

- +