HTML Page Viewer

approvedunreviewed

by Viggo Meesters

Open .html and .htm files in Obsidian as a sandboxed rendered preview or syntax-highlighted source.

★ 1 stars↓ 4,076 downloadsUpdated 7d agoMIT

HTML Page Viewer for Obsidian

Latest release MIT license Obsidian 1.5.0+ Read-only

HTML 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.

HTML Page Viewer preview

Features

  • Opens .html and .htm files 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-scripts to the iframe sandbox.
  • The iframe is never granted allow-same-origin, allow-forms, allow-popups, or allow-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

  1. Download main.js, manifest.json, and styles.css from the latest release.
  2. Create this folder in your vault: .obsidian/plugins/html-page-viewer/.
  3. Put the downloaded files in that folder.
  4. Reload Obsidian.
  5. 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:

  1. Update manifest.json, package.json, and versions.json.
  2. Run npm install, npm run build, npx tsc --noEmit, and npm test.
  3. Create a GitHub release whose tag exactly matches manifest.json.version.
  4. Attach main.js, manifest.json, and styles.css as 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

MIT

Obsidian 1.15.1 assessment: checked source, local results and remaining host validation.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.