File tree 3 files changed +14
-1
lines changed
3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 38
38
"Learn_More" : " Learn More" ,
39
39
"Minimize" : " Minimize" ,
40
40
"More_spelling_suggestions" : " More spelling suggestions" ,
41
+ "Open_Link" : " Open link" ,
41
42
"New_Version" : " New Version:" ,
42
43
"No" : " No" ,
43
44
"No_suggestions" : " No suggestions" ,
Original file line number Diff line number Diff line change 37
37
"Learn_More" : " Saiba Mais" ,
38
38
"Minimize" : " Minimizar" ,
39
39
"More_spelling_suggestions" : " Mais sugestões de grafia" ,
40
+ "Open_Link" : " Abrir link" ,
40
41
"New_Version" : " Nova Versão:" ,
41
42
"No" : " Não" ,
42
43
"No_suggestions" : " Sem sugestões" ,
Original file line number Diff line number Diff line change 1
1
const os = require ( 'os' ) ;
2
2
const checker = require ( 'spellchecker' ) ;
3
- const { remote, webFrame } = require ( 'electron' ) ;
3
+ const { remote, webFrame, shell } = require ( 'electron' ) ;
4
4
const i18n = require ( '../../i18n/index' ) ;
5
5
6
6
const webContents = remote . getCurrentWebContents ( ) ;
@@ -273,6 +273,17 @@ class SpellCheck {
273
273
}
274
274
275
275
setTimeout ( ( ) => {
276
+ if ( event . target . nodeName === 'A' ) {
277
+ const targetLink = event . target . href ;
278
+
279
+ template . unshift ( {
280
+ label : i18n . __ ( 'Open_Link' ) ,
281
+ click : ( ) => {
282
+ shell . openExternal ( targetLink ) ;
283
+ }
284
+ } ) ;
285
+ }
286
+
276
287
if ( [ 'TEXTAREA' , 'INPUT' ] . indexOf ( event . target . nodeName ) > - 1 ) {
277
288
const text = window . getSelection ( ) . toString ( ) . trim ( ) ;
278
289
if ( text !== '' && ! this . isCorrect ( text ) ) {
You can’t perform that action at this time.
0 commit comments