@@ -46,47 +46,6 @@ const INITIAL_UPDATE_DELAY_MS = 30 * 1000;
4646let mainWindow = null ;
4747let appQuitting = false ;
4848
49- function safeOpenURL ( target ) {
50- // openExternal passes the target to open/start/xdg-open,
51- // so put fairly stringent limits on what can be opened
52- // (for instance, open /bin/sh does indeed open a terminal
53- // with a shell, albeit with no arguments)
54- const parsedUrl = url . parse ( target ) ;
55- if ( PERMITTED_URL_SCHEMES . indexOf ( parsedUrl . protocol ) > - 1 ) {
56- // explicitly use the URL re-assembled by the url library,
57- // so we know the url parser has understood all the parts
58- // of the input string
59- const newTarget = url . format ( parsedUrl ) ;
60- electron . shell . openExternal ( newTarget ) ;
61- }
62- }
63-
64- function onWindowOrNavigate ( ev , target ) {
65- // always prevent the default: if something goes wrong,
66- // we don't want to end up opening it in the electron
67- // app, as we could end up opening any sort of random
68- // url in a window that has node scripting access.
69- ev . preventDefault ( ) ;
70- safeOpenURL ( target ) ;
71- }
72-
73- function onLinkContextMenu ( ev , params ) {
74- const popupMenu = new electron . Menu ( ) ;
75-
76- popupMenu . append ( new electron . MenuItem ( {
77- label : params . linkURL ,
78- click ( ) { safeOpenURL ( params . linkURL ) ; } ,
79- } ) ) ;
80-
81- popupMenu . append ( new electron . MenuItem ( {
82- label : 'Copy Link Address' ,
83- click ( ) { electron . clipboard . writeText ( params . linkURL ) ; } ,
84- } ) ) ;
85-
86- popupMenu . popup ( ) ;
87- ev . preventDefault ( ) ;
88- }
89-
9049function installUpdate ( ) {
9150 // for some reason, quitAndInstall does not fire the
9251 // before-quit event, so we need to set the flag here.
0 commit comments