Skip to content

About

A fully local Markdown reader for Chrome and Edge (MV3). Renders file:// and online .md with outline, folder tree, in-page search, auto-refresh, GBK fallback and Mermaid. No backend, no account, no telemetry.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

MDV — Local Markdown Reader

English · 简体中文

Latest release License: MIT Manifest V3 No network

A fully local Markdown reader for Chrome and Edge. It turns file:// Markdown files and any online .md URL into a clean, GitHub-flavoured reading view — outline, folder tree, in-page search, auto-refresh, syntax highlighting and Mermaid — with no build step, no backend, no account and no telemetry.

Everything is vendored and runs offline. The extension never uploads a single byte of your documents.


Highlights

Reads what you already have .md .markdown .mdx .mkd .mdown .mdc (case-insensitive, query strings included) plus local .txt, both from file:// and http(s)://
Never hijacks real pages A page is only rendered when it actually is plain text (a single <pre> body) — Web apps that merely end in .md are left untouched
Outline that follows you Auto-generated table of contents, scroll-spy highlighting, click to jump, configurable depth
Folder browsing Sibling files of the current document, plus a full folder tree in the side panel via the File System Access API
In-page search Case-insensitive matching, hit count, previous/next, highlight-all
Live reload Watches the file you are editing; re-renders within ~1 s while keeping your scroll position
Encoding safe UTF-8 by default, automatic GBK fallback for legacy Chinese files (no more mojibake)
Big-file guard Files above a configurable threshold are shown as plain text first, with an opt-in "render anyway"
16 real plugin switches GFM, emoji, sup/sub, insert, mark, footnote, abbreviation, definition list, alerts, heading anchors, copy button, highlight.js, Mermaid, TOC, safe external links, task checkboxes
Make it yours Light/dark/auto, 5 accent palettes, content width, font, size, code wrap, wide tables, custom CSS
Import / export Settings as JSON; reset to defaults in one click
Bilingual UI English and 简体中文, switchable at runtime

Screenshots

Reading view Dark theme
Reading view Dark theme
Quick panel Settings
Quick panel Settings

Install

Option 1 — download the release (recommended)

  1. Grab markdown-reader-1.0.0.zip from the latest release and unzip it. You should end up with a folder that contains manifest.json directly inside.
  2. Open chrome://extensions (or edge://extensions) and enable Developer mode.
  3. Click Load unpacked and select the unzipped folder.
  4. Open the extension's Details and turn on Allow access to file URLs — without it, local .md files still render, but the sibling-file list cannot be listed.
  5. Optional: remap the shortcuts at chrome://extensions/shortcuts.

Option 2 — clone and load the source

git clone https://github.com/swfk2154/Markdown-reader.git

Load the cloned folder the same way. There is no build step: files are plain scripts, so after an edit you only need to hit Reload on the extensions page.

Chrome 114+ is required (Manifest V3 + Side Panel API). Firefox is not supported — it has no side_panel equivalent.

If another Markdown extension is installed, disable it first: two extensions matching file://*.md will fight over the same page.


Usage

Action How
Open a document Just open a .md file in the browser, or an online Markdown URL
Toggle centred layout Alt+Shift+C
Toggle theme Alt+Shift+T
Toggle auto-refresh Alt+Shift+R
Toggle in-page side bar Alt+Shift+B
Open the folder/outline/search side panel Toolbar icon → Open file side panel (MV3 caps commands at 4, so the panel is not bound to a shortcut)
Quick settings Toolbar icon → panel with Appearance / Reading / Plugins / Info
Full settings Panel → Full settings page

The side panel has three views: Files (folder tree + saved folders), Outline, Search. Folders are remembered across restarts; after a restart Chrome asks you to re-authorise the folder once — that is a browser security rule, not a permission the extension can keep on its own.


Privacy

Permission Why it is needed
storage Save your settings and UI preferences locally
sidePanel Render the folder / outline / search side panel
webNavigation Detect when a .md URL finishes loading so a broken file path can be repaired
host_permissions: file:///* Read local Markdown files and list sibling files
  • No analytics, no crash reporting, no remote config, no update pings.
  • No account, no login, no subscription, no paywall.
  • The only network requests are to the document's own URL (refresh + encoding detection).
  • All parsing happens in the page; nothing is uploaded, ever.
  • Settings live in chrome.storage.local; folder handles live in IndexedDB. Uninstall and both are gone.

How it is built

Zero-build by design: the shipped code is the source code.

manifest.json                 # MV3 manifest
icons/                        # 16 / 48 / 128 PNG
lib/                          # vendored, offline dependencies (no CDN, no network)
  marked.min.js               # Markdown parser
  purify.min.js               # DOMPurify sanitiser
  highlight.min.js            # syntax highlighting
  mermaid.min.js              # diagrams
  github-markdown.css         # GitHub typography
  hljs-themes.css
src/
  content/                    # content script, IIFEs loaded in numeric order
    00-core.js                # namespace, defaults, storage, i18n, plugin registry
    10-render.js              # render kernel, plugin pipeline, sanitiser, delegation
    20-toc.js                 # outline + scroll-spy
    30-search.js              # in-page search
    40-tree.js                # sibling discovery, directory-page beautifier
    50-appearance.js          # theme, typography, custom CSS
    60-refresh.js             # encoding detection, auto-refresh
    70-main.js                # orchestration entry
  background/service-worker.js
  shared/idb.js               # folder handle persistence
  options/                    # full settings page
  popup/                      # toolbar quick panel
  sidepanel/                  # native side panel
  viewer/                     # reader page for files opened from the folder tree
tools/
  verify.mjs                  # static self-check (manifest refs, JS syntax, icons, MV3 rules)
  pack.py                     # validate + build a clean distributable
  make_icons.py               # regenerate the icons
docs/screenshots/

Design notes:

  • Content scripts are classic IIFEs, because MV3 content scripts cannot use ES modules. An order is fixed in manifest.json and a single window.MDV namespace is shared.
  • Settings propagate through chrome.storage.onChanged, not through the service worker — one less hop, one less failure mode.
  • Folder handles are persisted in IndexedDB from the service worker, because FileSystemHandle cannot be JSON-serialised into chrome.storage.
  • The reader page reuses 10-render.js so the two entry points can never drift apart.

Self-check

node tools/verify.mjs     # manifest / references / JS syntax / icons / MV3 rules
python tools/pack.py      # runs the same checks, then builds dist/MDV + a zip

verify.mjs currently validates 68 files and 17 scripts. pack.py refuses to produce a package if any check fails, so a broken zip cannot be published by accident.


Known limits

  • Read-only. This is a viewer, not an editor. Task checkboxes change visually only and are never written back to disk.
  • No maths rendering. KaTeX is not bundled; formulas are shown as plain text.
  • Documents are read as plain text only. Nothing inside a Markdown file is executed, and no cookies or credentials are attached to the request beyond what the browser would send for that URL.
  • Folder tree has no absolute paths. The File System Access API does not expose them, so files opened from the tree are served through an extension page instead of a file:// URL.
  • mermaid.min.js is ~3.3 MB, the only heavy dependency. Remove that one line from manifest.json and turn the Mermaid plugin off if you never draw diagrams.
  • Chrome/Edge only. No Firefox build.

License

MIT © 2026 swfk2154

About

A fully local Markdown reader for Chrome and Edge (MV3). Renders file:// and online .md with outline, folder tree, in-page search, auto-refresh, GBK fallback and Mermaid. No backend, no account, no telemetry.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages