diff --git a/Dockerfile b/Dockerfile index b256cff..0e89294 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,13 @@ RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debia sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list # 安装系统依赖 (手动列出 Chromium 所需依赖,适配 Debian) +# 新增: fonts-noto-cjk fonts-wqy-zenhei 用于支持中文显示 RUN apt-get update && apt-get install -y \ wget \ gnupg \ fonts-liberation \ + fonts-noto-cjk \ + fonts-wqy-zenhei \ libasound2 \ libatk-bridge2.0-0 \ libatk1.0-0 \ diff --git a/static/remote.html b/static/remote.html index 4749971..85c4d9c 100644 --- a/static/remote.html +++ b/static/remote.html @@ -450,7 +450,21 @@ function handleKeyDown(e) { if (e.repeat) return; - // 阻止一些常见快捷键,避免影响浏览器 + + // 检查事件目标是否是输入框 + const target = e.target; + const isInput = target.tagName === 'INPUT' || target.tagName === 'TEXTAREA'; + + // 如果在输入框中,不阻止默认行为(除非是回车键用于发送) + if (isInput) { + // 如果需要,可以在这里处理输入框的快捷键,比如回车提交 + if (e.key === 'Enter' && target.id === 'urlInput') { + navigate(); + } + return; + } + + // 阻止一些常见快捷键,避免影响浏览器,但仅当不在输入框中时 if (['Tab', 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' ', 'Enter'].includes(e.key)) { e.preventDefault(); }