Skip to content

Commit 44f6bb2

Browse files
authored
fix search bug (#67)
1 parent 4832470 commit 44f6bb2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/LandingPage.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,17 @@ export default {
8383
webviewElements.forEach(i => {
8484
require('electron-context-menu')({
8585
window: i,
86-
prepend: params => [
86+
prepend: (defaultActions, params) => [
8787
{
8888
label: 'Google Search',
89+
visible: params.selectionText.trim().length > 0,
8990
click: () => {
90-
console.log(params)
91+
console.log(`params`, params)
9192
shell.openExternal(
9293
`https://www.google.com/search?q=${params.selectionText}&&client=electron-devdocs-by-daniel-geng`
9394
)
9495
},
95-
},
96+
}
9697
],
9798
})
9899
})

0 commit comments

Comments
 (0)