diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-03-18 18:00:57 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-03-18 18:00:57 +0100 |
commit | f7c25799b13d59b970651bdeb42736bab5b86d15 (patch) | |
tree | 5b9bba1f9d2aaf6967ae774c7cc5df8f61a0ece2 /src/index.html | |
parent | Replace console logs with debugger (diff) | |
download | ferdium-app-f7c25799b13d59b970651bdeb42736bab5b86d15.tar.gz ferdium-app-f7c25799b13d59b970651bdeb42736bab5b86d15.tar.zst ferdium-app-f7c25799b13d59b970651bdeb42736bab5b86d15.zip |
Add debug flags to render process
Diffstat (limited to 'src/index.html')
-rw-r--r-- | src/index.html | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/index.html b/src/index.html index 6c259e5be..5ce7f6a96 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -15,6 +15,11 @@ | |||
15 | 15 | ||
16 | const { isDevMode } = require('./environment'); | 16 | const { isDevMode } = require('./environment'); |
17 | if (isDevMode) { | 17 | if (isDevMode) { |
18 | const debugging = require('debug'); | ||
19 | debugging.enable(process.env.DEBUG); | ||
20 | |||
21 | const debug = debugging('Index'); | ||
22 | |||
18 | document.querySelector('body').classList.add('isDevMode'); | 23 | document.querySelector('body').classList.add('isDevMode'); |
19 | 24 | ||
20 | (function() { | 25 | (function() { |
@@ -25,7 +30,7 @@ | |||
25 | document.body.appendChild(s); | 30 | document.body.appendChild(s); |
26 | 31 | ||
27 | s.onload = () => { | 32 | s.onload = () => { |
28 | console.log('livereload loaded'); | 33 | debug('livereload loaded'); |
29 | const originalReloadBehaviour = window._onLiveReloadFileChanged; | 34 | const originalReloadBehaviour = window._onLiveReloadFileChanged; |
30 | 35 | ||
31 | window._onLiveReloadFileChanged = (file) => { | 36 | window._onLiveReloadFileChanged = (file) => { |
@@ -33,10 +38,10 @@ | |||
33 | originalReloadBehaviour(file); | 38 | originalReloadBehaviour(file); |
34 | } else { | 39 | } else { |
35 | if (file.path.includes('/build/webview/')) { | 40 | if (file.path.includes('/build/webview/')) { |
36 | console.log('Livereload: Reloading all webvies'); | 41 | debug('Livereload: Reloading all webvies'); |
37 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); | 42 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); |
38 | } else { | 43 | } else { |
39 | console.log('Livereload: skip reload as only main process files have changed'); | 44 | debug('Livereload: skip reload as only main process files have changed'); |
40 | } | 45 | } |
41 | } | 46 | } |
42 | } | 47 | } |