mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
desktop: show Open in browser menu item when a link is selected
This commit is contained in:
committed by
Abdullah Atta
parent
6b3c628e6b
commit
6fa82bbe2e
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user