@@ -12,14 +12,24 @@ app.on('window-all-closed', function () {
1212 if ( process . platform !== 'darwin' ) app . quit ( )
1313} )
1414
15+ var robot = require ( 'robotjs' )
16+
17+ var clipboard = require ( 'clipboard' )
18+
1519var Tray = require ( 'tray' )
1620var appIcon = null
1721
1822app . on ( 'ready' , function ( ) {
1923 appIcon = new Tray ( './icon.png' )
2024 appIcon . setToolTip ( 'This is my application.' )
2125
22- mainWindow = new BrowserWindow ( { width : 800 , height : 600 } )
26+ mainWindow = new BrowserWindow ( {
27+ width : 800 ,
28+ height : 600 ,
29+ 'web-preferences' : {
30+ 'overlay-scrollbars' : true
31+ }
32+ } )
2333
2434 mainWindow . loadUrl ( 'file://' + __dirname + '/electron_build/index.html' )
2535
@@ -36,7 +46,10 @@ app.on('ready', function () {
3646 width : 600 ,
3747 height : 400 ,
3848 show : false ,
39- frame : false
49+ frame : false ,
50+ 'web-preferences' : {
51+ 'overlay-scrollbars' : true
52+ }
4053 } )
4154
4255 popUpWindow . loadUrl ( 'file://' + __dirname + '/electron_build/electron/popup/index.html' )
@@ -74,6 +87,13 @@ app.on('ready', function () {
7487 ipc . on ( 'hidePopUp' , function ( ) {
7588 hidePopUp ( )
7689 } )
90+ ipc . on ( 'writeCode' , function ( e , code ) {
91+ clipboard . writeText ( code )
92+ // setTimeout(function () {
93+ // robot.typeString(code)
94+ // }, 200)
95+ hidePopUp ( )
96+ } )
7797
7898 var fromMain
7999 // Register a 'ctrl+x' shortcut listener.
0 commit comments