From b98237fa44cdf708f596d117ef0e992fceddef25 Mon Sep 17 00:00:00 2001 From: Alex Yakhnin Date: Sat, 30 Jul 2016 09:42:31 -0400 Subject: [PATCH] Added dev parameter --- CHANGELOG.md | 1 + README.md | 2 ++ js/electron.js | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 575fc93a..f2b7fe31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Brazilian Portuguese Translation. - Option to enable Kios mode. +- Added ability to start the app with Dev Tools. ### Fixed - Prevent `getModules()` selectors from returning duplicate entries. diff --git a/README.md b/README.md index 75bd50d6..5d5f7176 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,8 @@ curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/master/installer **Important:** `npm start` does **not** work via SSH, use `DISPLAY=:0 nohup npm start &` instead. This starts the mirror on the remote display. +**Note:** if you want to debug on Raspberry Pi you can use `npm start dev` which will start the MagicMirror app with Dev Tools enabled. + #### Server Only In some cases, you want to start the application without an actual app window. In this case, execute the following command from the MagicMirror folder: `node serveronly`. This will start the server, after which you can open the application in your browser of choice. diff --git a/js/electron.js b/js/electron.js index 1631deae..e9055c41 100644 --- a/js/electron.js +++ b/js/electron.js @@ -27,8 +27,10 @@ function createWindow() { //mainWindow.loadURL('file://' + __dirname + '../../index.html'); mainWindow.loadURL("http://localhost:" + config.port); - // Open the DevTools. - //mainWindow.webContents.openDevTools(); + // Open the DevTools if run with "npm start dev" + if(process.argv[2] == "dev"){ + mainWindow.webContents.openDevTools(); + } // Emitted when the window is closed. mainWindow.on("closed", function() {