@@ -18,6 +18,7 @@ import Positoner from 'electron-positioner';
1818import { ElectronBlocker } from '@cliqz/adblocker-electron' ;
1919import fetch from 'cross-fetch' ;
2020
21+ let positioner ;
2122
2223export default class AppUpdater {
2324 constructor ( ) {
@@ -87,7 +88,7 @@ const createWindow = async () => {
8788 icon : getAssetPath ( 'icon.png' ) ,
8889 webPreferences : {
8990 webviewTag :true ,
90-
91+ nodeIntegration : false ,
9192 preload : app . isPackaged
9293 ? path . join ( __dirname , 'preload.js' )
9394 : path . join ( __dirname , '../../.erb/dll/preload.js' ) ,
@@ -99,8 +100,8 @@ const createWindow = async () => {
99100 blocker . enableBlockingInSession ( mainWindow ?. webContents . session ) ;
100101 } )
101102
102- var positioner = new Positoner ( mainWindow ) ;
103- positioner . move ( 'topRight' )
103+ positioner = new Positoner ( mainWindow ) ;
104+ positioner . move ( 'topRight' ) ;
104105 mainWindow . loadURL ( resolveHtmlPath ( 'index.html' ) ) ;
105106
106107 mainWindow . on ( 'ready-to-show' , ( ) => {
@@ -128,7 +129,6 @@ const createWindow = async () => {
128129 } ) ;
129130
130131 // Remove this if your app does not use auto updates
131- // eslint-disable-next-line
132132 new AppUpdater ( ) ;
133133} ;
134134
155155 } ) ;
156156 } )
157157 . catch ( console . log ) ;
158+
159+ ipcMain . on ( 'window-move' , ( args ) => {
160+ positioner . move ( args ) ;
161+ } )
0 commit comments