diff --git a/src/public/app/services/open.js b/src/public/app/services/open.js index 05ac9b63b..8a89cc615 100644 --- a/src/public/app/services/open.js +++ b/src/public/app/services/open.js @@ -166,6 +166,23 @@ function getHost() { return `${url.protocol}//${url.hostname}:${url.port}`; } +async function openDirectory(directory) { + try { + if (utils.isElectron()) { + const electron = utils.dynamicRequire('electron'); + const res = await electron.shell.openPath(directory); + if (res) { + console.error('Failed to open directory:', res); + } + } else { + console.error('Not running in an Electron environment.'); + } + } catch (err) { + // Handle file system errors (e.g. path does not exist or is inaccessible) + console.error('Error:', err.message); + } +} + export default { download, downloadFileNote, @@ -176,4 +193,5 @@ export default { openAttachmentExternally, openNoteCustom, openAttachmentCustom, + openDirectory } diff --git a/src/public/app/widgets/dialogs/about.js b/src/public/app/widgets/dialogs/about.js index c381bacd3..e568e92bd 100644 --- a/src/public/app/widgets/dialogs/about.js +++ b/src/public/app/widgets/dialogs/about.js @@ -2,6 +2,8 @@ import server from "../../services/server.js"; import utils from "../../services/utils.js"; import { t } from "../../services/i18n.js"; import BasicWidget from "../basic_widget.js"; +import openService from "../../services/open.js"; + const TPL = `