conquert62 downloadsBypass cross-origin limits to render in-vault .html in Obsidian by inlining CSS/images/scripts. In-vault .html/.md link interception with back/forward, in-page search, zoom, outline, fullscreen, scroll restore. Desktop & mobile.
English
HTML Direct Reader renders in-vault .html files directly inside Obsidian. Because Obsidian's app://local origin differs from the preview page, browsers normally refuse to load the relative CSS, images and fonts an HTML file references. This plugin reads those assets on the Node side and inlines them as data URIs, so documents display exactly as authored — no local server, no cross-origin errors.
Features
.html/.md link interception with back/forward navigation一句话(中文):让 Obsidian 里点开
.html就像在浏览器里打开一样——库内的图片 / CSS / 字体 / 脚本全部正常显示,不用切出去,也不用看代码视图。
上传须知:本文件上传到仓库根目录时,请改名为
README.md。英文段会被显示在商店 listing 顶部,方便英文审核者与世界各地的用户理解。
English: Install from the Obsidian community store: Settings → Community plugins → turn off Safe mode → Browse → search HTML Direct Reader → Install → Enable. For manual install, download main.js, manifest.json and styles.css from the latest GitHub release, put them into your vault's .obsidian/plugins/html-direct-reader/ folder, restart Obsidian and enable the plugin.
html-direct-reader)→ 安装 → 启用。上架后粉丝只需这一条路,无需翻墙、无需 GitHub。
main.js / manifest.json / styles.css 三个文件。.obsidian/plugins/,新建文件夹 html-direct-reader/。English: Double-click an .html / .htm file in the file explorer (or open it via a link) — it renders with this plugin by default. The toolbar, from left to right, provides: search, zoom (− / +), fullscreen, source/render toggle, open externally, outline, back and forward. To see interactive content (Canvas, forms, scripted animation), toggle the script switch on and reopen the document.
.html / .htm 文件(或点链接打开它)——默认会用本插件渲染。.html 在当前视图打开并记入历史、.md 开新标签页,工具栏可后退 / 前进,把一批库内 HTML 串成"可浏览的小站"。| 设置 | 作用 |
|---|---|
| Anti-reload float layer | 桌面端开启后,切换标签 / 点链接不再重新加载页面(滚动位置、表单状态都留住) |
| Allow scripts | 默认关闭;打开后允许文档内 JavaScript 运行 |
| Inline in-vault resources | 把库内 CSS/图片/字体内联以绕过跨域;排查问题或超大页面时可关 |
| Inline size limit per resource | 超过此体积的资源不再内联,避免拖慢渲染 |
| Auto-reload on file change | 外部改动 HTML 后自动刷新;有表单或动画时关闭,改用工具栏重载 |
| Default zoom | 预览整体缩放;也可用工具栏按钮或 Ctrl/⌘ + 滚轮 |
srcdoc 渲染,绕开安卓 webview 对 blob: 的静默拦截。Q:为什么我的 HTML 里有些图片不显示?
A:外链图片(以 http 开头)和跨 vault 的资源不内联,需要本身体可访问;库内相对路径的图片会自动内联。内联失败的资源会出现在"内联失败清单"里。
Q:会改动我的原文件吗? A:不会。插件只读渲染,所有内联都在内存里完成。
Q:支持 file:// 本地绝对路径吗?
A:不支持。只处理库内相对路径资源。
如果你觉得这个插件有用,欢迎在 B 站 / 论坛分享。问题反馈请在 GitHub 提 Issue。