An advanced option for "Allow `javascript:` for URLs"

Use case or problem

Obsidian is currently filtering out links with javascript: as the scheme. I would like to have a link in my note to open the system explorer for an arbitrary folder/file.

Proposed solution

  1. Add an option under Settings → Editor → Advanced: “Allow javascript: URL scheme in hyperlinks” (with appropriate warnings)
  2. When option is enabled, the following line should emit HTML with the href attribute in tact:
[Open in Explorer](javascript:app.showInFolder("path/to/"))

Current workaround (optional)

This can be done using DataView plugin’s dv.el() to bypass content filtering:

`$=dv.el("a", "Open in Explorer", { href: "javascript:app.showInFolder('path/to/')" })`

It would be great to be able to do this without the use of a third-party plugin.

1 Like