Files: b02130afe26d1db8fb81cc8a4bf983e79fc85d54 / assets / base.html
846 bytesRaw
1 | |
2 | <html> |
3 | <head></head> |
4 | <body> |
5 | <script> |
6 | // redirect console to main process |
7 | var electron = require('electron') |
8 | var localLog = console.log |
9 | var localError = console.error |
10 | var remoteLog = electron.remote.getGlobal('console').log |
11 | var remoteError = electron.remote.getGlobal('console').error |
12 | |
13 | console.log = function (...args) { |
14 | localLog.apply(console, args) |
15 | remoteLog(...args) |
16 | } |
17 | |
18 | console.error = function (...args) { |
19 | localError.apply(console, args) |
20 | remoteError(...args) |
21 | } |
22 | |
23 | process.exit = electron.remote.app.quit |
24 | // redirect errors to stderr |
25 | window.addEventListener('error', function (e) { |
26 | e.preventDefault() |
27 | console.error(e.error.stack || 'Uncaught ' + e.error) |
28 | }) |
29 | </script> |
30 | </body> |
31 | </html> |
32 |
Built with git-ssb-web