README file from
GithubHTML Page Viewer
HTML Page Viewer is a read-only Obsidian plugin for opening .html and .htm files as rendered pages inside Obsidian. It is built for local reports, exported dashboards, documentation pages, prototypes, and generated visual artifacts that you want to inspect without leaving the vault.
Features
- Opens
.htmland.htmfiles in a dedicated Obsidian view. - Shows a rendered preview by default.
- Provides a source view with lightweight HTML syntax highlighting and line numbers.
- Includes a toolbar for Rendered/Source, Refresh, and Scripts OFF/ON.
- Keeps scripts disabled by default.
- Remembers explicit script permission separately for each HTML file.
- Renders through a sandboxed iframe.
- Blocks forms, popups, top-level navigation, and same-origin access.
- Stays read-only by design: it never writes back to HTML files.
Security model
HTML files can execute powerful browser behavior if a viewer permits it. HTML Page Viewer uses a conservative default:
- Scripts are OFF by default.
- Scripts ON adds only
allow-scriptsto the iframe sandbox. - The iframe is never granted
allow-same-origin,allow-forms,allow-popups, orallow-top-navigation. - The plugin code does not make network requests.
- The plugin code does not read or write the system clipboard.
- The plugin saves script permissions in its own settings.
Rendered HTML may still request external resources, such as images, stylesheets, fonts, or scripts, when the HTML document itself references them. This is normal browser behavior for rendered HTML pages and is separate from plugin code making network requests.
Why read-only?
HTML reports and exported pages are often generated artifacts. HTML Page Viewer leaves your HTML files untouched.
Installation
Community plugin directory
Install from the Obsidian Community directory or search for HTML Page Viewer in Settings → Community plugins → Browse.
Manual installation
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Create this folder in your vault:
.obsidian/plugins/html-page-viewer/. - Put the downloaded files in that folder.
- Reload Obsidian.
- Enable HTML Page Viewer in Settings -> Community plugins.
BRAT installation
For beta testing, install the plugin with BRAT using this repository URL:
https://github.com/viggomeesters/obsidian-html-page-viewer
Usage
Open any .html or .htm file in your vault. Obsidian will open it with HTML Page Viewer.
Use the toolbar to:
- switch between the rendered preview and source view
- refresh the rendered preview after file changes
- turn scripts on or off for the current HTML file
The Scripts toggle remembers your choice when you switch files or restart Obsidian. Enable it only for files you trust, including future edits at the same path. Turning scripts off removes the saved permission. Renaming, moving, or deleting a file in Obsidian clears permission for its old path.
Development
npm install
npm run build
npx tsc --noEmit
npm test
For local development, copy or symlink this repository into .obsidian/plugins/html-page-viewer/ inside an Obsidian vault.
Release process
Obsidian installs community plugin files from GitHub releases. For each release:
- Update
manifest.json,package.json, andversions.json. - Run
npm install,npm run build,npx tsc --noEmit, andnpm test. - Create a GitHub release whose tag exactly matches
manifest.json.version. - Attach
main.js,manifest.json, andstyles.cssas release assets.
The repository includes a GitHub Actions release workflow with artifact attestation support. If GitHub Actions is disabled for the owner account, manual releases are still usable for Obsidian, but the Community automated review may show a recommendation about missing artifact attestations.
Community directory
HTML Page Viewer is listed in the Obsidian Community directory.
Acknowledgements
HTML Page Viewer was built independently, but it was informed by the existing Obsidian HTML viewer ecosystem, including the MIT-licensed JiaLinZhang24/obsidian-html-viewer. No source code from that project is included in this repository.
License
Obsidian 1.15.1 assessment: checked source, local results and remaining host validation.