HTML Viewer Plus

approved

by lzq

Enhanced HTML Viewer: Embedded preview, full-screen, zoom, dark mode sync, search, MHTML support, hot refresh. - This plugin has not been manually reviewed by Obsidian staff.

4 stars398 downloadsUpdated 1mo agoGPL-3.0

HTML Viewer Plus

An Obsidian plugin for previewing and embedding HTML/MHTML files directly in your vault.

中文文档

Features

  • Embed preview — Render HTML inline with ![[file.html]]
  • Element targeting![[file.html#elementId]] shows only the specified element
  • Custom sizing![[file.html|400]] for width, ![[file.html|400x300]] for width × height
  • Fullscreen / Open externally — Fullscreen or open in system browser
  • Zoom — Ctrl + scroll to zoom, adjustable step
  • In-page search — Ctrl+F to search text within HTML, auto-switches tabs
  • Dark theme sync — Follows Obsidian dark mode with custom CSS support
  • Hot refresh — Auto-reload when HTML file changes
  • MHTML support — Open .mht/.mhtml web archives directly
  • Right-click menu — Right-click HTML to copy embed/link syntax
  • Scroll guard — Click to activate scrolling, prevents accidental scroll

Installation

Manual

  1. Download main.js, manifest.json, styles.css
  2. Create .obsidian/plugins/html-viewer-plus/ in your vault
  3. Copy the three files into that directory
  4. Restart Obsidian, go to Settings → Community plugins, enable HTML Viewer Plus

BRAT

Not yet on the community marketplace. Install via BRAT:

  1. Install the BRAT plugin
  2. BRAT Settings → Add Beta Plugin → enter kuaile1407/html-viewer-plus
  3. Enable the plugin

Usage

Embed in notes

![[demo.html]]              default width and aspect ratio
![[demo.html|600]]          width 600px
![[demo.html|600x400]]      600px × 400px
![[demo.html#chart]]         show only id="chart" element

Direct open

Click an HTML file in the file explorer to open it in a dedicated view with zoom, search, refresh, and open-externally controls.

Toolbar

ButtonEmbed modeDirect open
Fullscreen
+ / -Zoom in/out
Reset zoom
🔍Search
Refresh
Open externallyOpen externally
Locate in file

Right-click menu

Right-click on HTML content to see ancestor elements with IDs. Click to copy embed syntax to clipboard.

Settings

OptionDefaultDescription
Default width100%Embed area default width
Aspect ratio4/3Supports 4/3, 16:9, 1.33
Show toolbarOnAction buttons on embed view
Enable zoomOnZoom in direct open mode
Zoom step0.1Zoom increment per scroll
Enable searchOnSearch in direct open mode
Sync dark themeOnAuto-inject dark CSS
Custom dark CSSAppended after default dark styles
Custom backgroundOffForce HTML body background color
Hot refreshOffAuto-reload on file change
MHTML supportOnSupport .mht/.mhtml files

Supported formats

  • HTML: .html .htm .shtml .xht .xhtml
  • MHTML: .mht .mhtml

Support the author

If this plugin helps you, consider buying me a coffee ☕

License

GPL-3.0

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.