Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion sources/code/main/modules/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export function context(parent: Electron.BrowserWindow): void {
enabled: clipboard.availableFormats().length !== 0 && params.editFlags.canPaste,
role: "paste"
},
{
label: context.googleSearch,
enabled: params.editFlags.canCopy,
click: () => {
shell.openExternal(`https://www.google.com/search?q=${encodeURIComponent(params.selectionText)}`).catch(commonCatches.throw);
}
},
{ type: "separator" }
] satisfies Electron.MenuItemConstructorOptions[] : []),
// Copy link text / copy link url
Expand Down Expand Up @@ -286,4 +293,4 @@ export function bar(repoLink: string, parent: Electron.BrowserWindow): Electron.
]);
Menu.setApplicationMenu(menu);
return menu;
}
}
3 changes: 2 additions & 1 deletion sources/translations/en/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"copyURLText": "Copy link text",
"copyImage": "Copy image",
"copyImageURL": "Copy link to image",
"inspectElement": "Inspect"
"inspectElement": "Inspect",
"googleSearch": "Search in Google"
},
"menubar": {
"enabled": "Enabled",
Expand Down
3 changes: 2 additions & 1 deletion sources/translations/ja/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"paste": "ペースト",
"copyURL": "URLのコピー",
"copyImage": "画像のコピー",
"copyImageURL": "画像へのリンクをコピー"
"copyImageURL": "画像へのリンクをコピー",
"googleSearch": "Googleで検索"
},
"tray": {
"toggle": "トグル",
Expand Down
Loading