Skip to content

v1.4.2 - 主页加载性能优化

Latest

Choose a tag to compare

@ciskonc ciskonc released this 19 Jul 16:32

v1.4.2 — 主页加载性能优化

主页加载时间从 4-5 秒优化到 2-3 秒,通过异步化 Native Host 调用让 Clash 状态点和系统代理栏同时显示。

性能优化方案

方案 改动 收益
A getStatus 内部分组并行(Clash API 与 Native Host 串行组并行) 100-300ms
B queryConnections 重试策略优化(1500ms×1 → 800ms×2) 命中率提升
C DOMContentLoaded 初始化并行化(initTheme 先 + 其余并行) 50-200ms
D loadSettingsForm 改非阻塞,initPopup 不再 await statusPromise 100-300ms
I1 getSystemProxyStatus 异步加载(独立 action + popup 加载中橙色状态) 500-1000ms
J1 detectClashClient 异步加载(独立 action + UI 降级异步应用) 500-1000ms

视觉修复

  • 加载中状态点从红色改为橙色(过渡状态而非错误状态)
  • _lastSysProxy / _lastClientType 全局变量避免 5 秒轮询闪烁
  • HTML 初始 clash-status-dot class 改为 warn 避免红色闪烁

撤销方案 G

曾尝试用 chrome.proxy.settings.get() 读浏览器代理替代 Native Host 读注册表,但破坏"系统代理"栏显示 Windows 系统状态的 UI 语义(ClashOmega 用 chrome.proxy 设浏览器代理但从不动 Windows 系统代理),已撤销,改用方案 I1 异步加载保留原语义。

安装

首次安装

  1. 下载 ClashOmega-v1.4.2.zip 并解压
  2. 进入 native-host/ 目录,右键 install.ps1 → 用 PowerShell 运行(注册 Native Messaging Host)
  3. Chrome 打开 chrome://extensions/,开启开发者模式
  4. 点击"加载已解压的扩展程序",选择解压目录下的 extension/ 文件夹
  5. 固定扩展到工具栏,开始使用

升级

  • 已安装 Native Host 的用户:只需重新加载 extension/ 即可
  • 新版本 Native Host 有更新时:重新运行 native-host/install.ps1

文件清单

  • extension/ — Chrome 扩展(加载到浏览器)
  • native-host/ — PowerShell Native Host(注册后提供规则管理 / 系统代理读取 / 客户端类型检测)
  • README.md / README_EN.md — 中英文说明
  • CHANGELOG.md — 完整更新日志