@@ -46,12 +46,10 @@ const url = require('url');
4646const fs = require ( 'fs' ) ;
4747const log = require ( 'electron-log' ) ;
4848
49- const reactDevToolsPath = path . join (
50- os . homedir ( ) ,
51- '/Downloads/ReactDevTools'
52- )
53-
54-
49+ // React dev tools current version 28 is not compatible with electron because it relys on
50+ // scripts, this may be fixed in the future but for now this gives us the 27 version of the
51+ // extension and loads in manually NOT as part of electron-devtools-installer
52+ const reactDevToolsPath = path . join ( __dirname , 'ReactDevToolsWebExtDep' ) ;
5553
5654// proto-parser func for parsing .proto files
5755const protoParserFunc = require ( './main_process/protoParser.js' ) ;
@@ -157,13 +155,15 @@ function createWindow() {
157155
158156 // dev mode title
159157 mainWindow . setTitle ( 'Swell (devMode)' ) ;
158+
159+ // if we are in developer mode Add React & Redux DevTools to Electron App
160160
161- // { allowFileAccess: true }
161+
162+ // this manually installs the depricated dev tools that are compatible with electron
162163 session . defaultSession . loadExtension ( reactDevToolsPath )
163164 . then ( ( name ) => console . log ( `Added Extension: ${ name } ` ) )
164165 . catch ( ( err ) => console . log ( 'An error occurred: ' , err ) ) ;
165-
166- // if we are in developer mode Add React & Redux DevTools to Electron App
166+ // ****** if current react dev tools version did work with electron we would use the below commented code ****
167167 // installExtension(REACT_DEVELOPER_TOOLS)
168168 // .then((name) => console.log(`Added Extension: ${name}`))
169169 // .catch((err) => console.log('An error occurred: ', err));
0 commit comments