Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: show `Open in browser` menu item when a link is selected

Abdullah Atta6fa82bbe2e0d
diff --git a/apps/web/desktop/menu.js b/apps/web/desktop/menu.js
index 6165f1853..c67694c15 100644
--- a/apps/web/desktop/menu.js
+++ b/apps/web/desktop/menu.js
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import { Menu, MenuItem, clipboard } from "electron";
+import { Menu, MenuItem, clipboard, shell } from "electron";
function setupMenu() {
globalThis.window.webContents.on("context-menu", (_event, params) => {
@@ -54,6 +54,15 @@ function setupMenu() {
})
);
+ if (params.linkURL.length) {
+ menu.append(
+ new MenuItem({
+ label: "Open in browser",
+ click: () => shell.openExternal(params.linkURL)
+ })
+ );
+ }
+
if (params.isEditable) {
menu.append(
new MenuItem({