Obsidian HTML reader Plugin
This is a plugin for Obsidian (https://obsidian.md). Can open document with .html
and .htm
file extensions.
How to use
- Put .html or .htm files to any obsidian-html-plugin installed vault folder
- Click any HTML or HTM item to open it
- Reading
Install this plugin from Obsidian
- Head to ⚙"Settings" ⇨ "Community plugins" options page, make sure "Restricted mode" is turned off.
- Click
Browse
button to open Community plugins browsing dialog.
- Search for this plugin "HTML Reader" and click the corresponding result item.
- Click
Install
button to install this plugin.
- Once installed, click
Enable
button to enable this plugin.
- Or, enable this plugin "HTML Reader" from the "Installed plugins" list of "Community plugins" options page.
Manually installing the plugin
- Copy the
main.js
and manifest.json
files from Releases list to your vault <path>/<to>/<vaultFolder>/.obsidian/plugins/obsidian-html-plugin/
.
- Relaunch Obsidian.
- Head to ⚙"Settings" ⇨ "Community plugins" options page, make sure "Restricted mode" is turned off and enable this plugin "HTML Reader" from the "Installed plugins" list of "Community plugins" options page.
HTML Reader Settings
- Head to ⚙"Settings" ⇨ "Community plugins" options page, find the settings icon ⚙ of "HTML Reader" item, then click it.
- Or, Head to ⚙"Settings" ⇨ click "HTML Reader" item on the bottom of left panel under the "Community plugins" group after enabled it.
General Settings
Operating Mode
Set Operating Mode for this plugin to protect user and app.
Comparsion
|
Images |
Styles |
Scripting |
DSD* |
CSP# |
HTML Sanitization |
Isolated |
Text Mode |
No |
No |
No |
Yes |
Yes |
Yes |
Yes |
High Restricted Mode |
Yes[1] |
Partial |
No |
Yes |
Yes |
Yes |
Yes |
Balance Mode |
Yes |
Yes |
No |
Yes |
Yes |
Yes |
Yes |
Low Restricted Mode |
Yes |
Yes |
Partial[2] |
Yes |
No |
No |
Yes |
Unrestricted Mode |
Yes |
Yes |
Yes[3] |
Yes |
No |
No |
Yes |
*: Declarative Shadow DOM
[1]: The external image sources would be blocked by CSP.
[2]: The script codes inside <script>
and external script files are still not executable.
[3]: The external script files may not executable due to Obsidian's limitation.
Detail Explanation
1. **Text Mode** - Highly recommended for the files came from untrusted source! This mode almost sanitized all visual effects, script codes, and styles out. eanwhile, it keeps text parts for reading the content of HTML files with HTML layout elements.
2. **High Restricted Mode** - This mode recommended for the user who wants more security. It would keep custom elements but sanitize unsafe HTML elements out, as well as unsafe attributes and their contents. The external image sources would be blocked by CSP, and the images are only available from the HTML files themselves.
3. **Balance Mode** - This mode is the default mode for this plugin. It would keep all custom elements and HTML elements, but sanitize unsafe attributes and their contents out.
4. **Low Restricted Mode** - This mode would not sanitize anything, all elements and their content would be keeped. The script codes inside ` Githubissues.
Githubissues is a development platform for aggregating issues.