SymphonyElectron/js/moreInfo/renderer.js
Vishwas Shashidhar afdaa39836 ELECTRON-907: add more info menu item
- add a new menu item that displays version information about the app
- bump up the version number
2018-11-28 16:42:46 -08:00

54 lines
1.9 KiB
JavaScript

'use strict';
const { ipcRenderer, crashReporter } = require('electron');
renderDom();
/**
* Method that renders application data
*/
function renderDom() {
document.addEventListener('DOMContentLoaded', function () {
const electronV = document.getElementById('electron');
const chromiumV = document.getElementById('chromium');
const v8V = document.getElementById('v8');
const nodeV = document.getElementById('node');
const opensslV = document.getElementById('openssl');
const zlibV = document.getElementById('zlib');
const uvV = document.getElementById('uv');
const aresV = document.getElementById('ares');
const httpparserV = document.getElementById('httpparser');
electronV.innerHTML = `<u>Electron</u> ${process.versions.electron}`;
chromiumV.innerHTML = `<u>Chromium</u> ${process.versions.chrome}`;
v8V.innerHTML = `<u>V8</u> ${process.versions.v8}`;
nodeV.innerHTML = `<u>Node</u> ${process.versions.node}`;
opensslV.innerHTML = `<u>OpenSSL</u> ${process.versions.openssl}`;
zlibV.innerHTML = `<u>ZLib</u> ${process.versions.zlib}`;
uvV.innerHTML = `<u>UV</u> ${process.versions.uv}`;
aresV.innerHTML = `<u>Ares</u> ${process.versions.ares}`;
httpparserV.innerHTML = `<u>HTTP Parser</u> ${process.versions.http_parser}`;
});
}
ipcRenderer.on('register-crash-reporter', (event, arg) => {
if (arg && typeof arg === 'object') {
crashReporter.start(arg);
}
});
// note: this is a workaround until
// https://github.com/electron/electron/issues/8841
// is fixed on the electron. where 'will-navigate'
// is never fired in sandbox mode
//
// This is required in order to prevent from loading
// dropped content
window.addEventListener('drop', function(e) {
e.preventDefault();
e.stopPropagation();
});
window.addEventListener('dragover', function(e) {
e.preventDefault();
e.stopPropagation();
});