fix: restore the page content call and stop writing the registry

- render_active_document passed the tab id as the first __setContent argument,
  but the page signature starts with previewHtml, so #preview rendered the tab
  id ("1", "2", "3" as tabs were opened) and the window looked blank. The call
  now goes through set_content_script(), and a test pins the exact script plus
  the page signature so the two cannot drift silently.
- remove register_as_default() and the winreg dependency: the app no longer
  writes HKCU on launch. publish.ps1 still refreshes the .md association.
This commit is contained in:
2026-11-04 15:25:13 +08:00
parent 0b97bcb6dc
commit 590a9a016c
6 changed files with 74 additions and 161 deletions

View File

@@ -28,7 +28,7 @@
1. 在 [Releases](https://git.wucl12.cn/wucl12/md-preview/releases) 页下载 `MD-Preview-windows-x64.exe`(当前发布版本 `v1.4.2-local.5`,2026-10-30);
2. 放到一个固定目录(例如 `C:\Tools\md-preview\`),不要随意改名/移动;
3. 双击运行,或在任意 `.md` 上右键 → 打开方式 → 选择该 exe 并设为默认;
3. 双击运行,或在任意 `.md` 上右键 → 打开方式 → 选择该 exe 并设为默认(程序本身不再写注册表;首次需要在“打开方式 → 选择其他应用”里选一次);
4. Windows 10/11 一般自带 WebView2 Runtime;若提示缺失,安装微软的 Evergreen Runtime 即可。
> exe 未做代码签名,SmartScreen 可能提示“未知发布者”,选择“更多信息 → 仍要运行”即可。