ducktapekiller52 downloadsApplies Dark Reader to pages opened in Obsidian's native Web viewer.
Read the web in your Obsidian theme.
Dark Reader for Obsidian's built-in Web viewer.
Web pages take your theme's background, text color and font, in dark mode and in light.
--background-primary and --text-normal. Links, buttons and accents keep their colors, so pages stay readable.| Without the plugin | With the plugin |
|---|---|
![]() |
![]() |
When Obsidian is light, pages take your theme's light colors instead.
Each page below uses the theme's own background, text color and text font, with Match Obsidian font on.
| Halftone, light | Brutalist, dark |
|---|---|
![]() |
![]() |
| Nunito Sans, embedded in the theme | Lora |
| Blade Runner, dark | Aubade, light |
![]() |
![]() |
| Tomorrow | iA Writer Quattro |
[!IMPORTANT] This plugin needs Obsidian 1.8.3 or newer on desktop, with the Web viewer core plugin turned on: Settings → Core plugins → Web viewer. It does not run on mobile, because it relies on the desktop app's
<webview>.
main.js and manifest.json from this repository, or from a release when one is available..obsidian/plugins/dark-reader-web-viewer/.Open any page in a Web viewer tab, and it follows your theme.
git clone https://github.com/DuckTapeKiller/dark-reader-web-viewer.git
cd dark-reader-web-viewer
npm install
npm run build
Then copy main.js and manifest.json into your vault as above.
| Setting | Default | What it does |
|---|---|---|
| Enable Dark Reader | On | Turns page theming on or off. |
| Follow Obsidian theme | Off | Leaves pages unchanged while Obsidian is light. Only applies when Match Obsidian base colors is off. |
| Match Obsidian base colors | On | Gives pages your theme's background and text colors, light or dark to match Obsidian. |
| Match Obsidian font | Off | Shows page text in your theme's text font. Code and icon fonts are left alone. |
| Brightness | 100% | Dark Reader's brightness. |
| Contrast | 90% | Dark Reader's contrast. |
| Sepia | 0% | Dark Reader's sepia tint. |
| Obsidian is… | Match Obsidian base colors | Follow Obsidian theme | Pages are… |
|---|---|---|---|
| Dark | On | any | Dark, in your theme's colors |
| Light | On | any | Light, in your theme's colors |
| Dark | Off | any | Dark, in Dark Reader's own colors |
| Light | Off | Off | Dark, in Dark Reader's own colors |
| Light | Off | On | Unchanged |
| Command | What it does |
|---|---|
| Toggle web viewer dark mode | Turns page theming on or off. |
| Reapply web viewer dark mode | Reinstalls Dark Reader in every open page, in case a site misbehaves. |
The plugin bundles Dark Reader's public API and installs it into each page opened in Obsidian's Web viewer. It does not need the browser extension.
webview.executeJavaScript() to install Dark Reader in each page. Before every update it asks the page whether it already runs this build's copy. Navigation, reloads, in-page links and plugin updates are therefore all handled the same way. Updates to a page run one at a time, and the latest settings always win.executeJavaScript() until a page has finished loading, images included. webview.insertCSS() is not held back, so the plugin paints each new page in the target colors as soon as it starts loading. It removes that style once Dark Reader is running.FontFace API. Such fonts are sent once per page, and they load even on sites whose content security policy blocks web fonts.darkreader package. No third-party script is fetched at run time.npm install
npm run dev # rebuild on every change
npm run build # lint, type-check and bundle into main.js
Every build runs the official Obsidian ESLint plugin first, over the TypeScript sources, the build scripts and package.json. Any warning fails the build. npm run update:lint moves the lint toolchain to its latest versions.
src/generated-injector.ts is written by esbuild.config.mjs during the build. Don't edit it by hand.
MIT. Dark Reader is included under its own MIT license; see THIRD-PARTY-NOTICES.md. This plugin is not affiliated with Dark Reader Ltd.