From b003d3a7ff9231abcc8266ea20397feaa578b345 Mon Sep 17 00:00:00 2001 From: Klemen Date: Wed, 8 Apr 2026 06:05:15 +0200 Subject: [PATCH] Add copy link action to context menus - Show a Copy Link item for safe external URLs - Copy the clicked link URL to the clipboard --- apps/desktop/src/main.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 3d61571df9..4261b0d106 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -7,6 +7,7 @@ import * as Path from "node:path"; import { app, BrowserWindow, + clipboard, dialog, ipcMain, Menu, @@ -1375,6 +1376,14 @@ function createWindow(): BrowserWindow { menuTemplate.push({ type: "separator" }); } + const externalUrl = getSafeExternalUrl(params.linkURL); + if (externalUrl) { + menuTemplate.push( + { label: "Copy Link", click: () => clipboard.writeText(params.linkURL) }, + { type: "separator" }, + ); + } + menuTemplate.push( { role: "cut", enabled: params.editFlags.canCut }, { role: "copy", enabled: params.editFlags.canCopy },