'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 = `Electron ${process.versions.electron}`;
chromiumV.innerHTML = `Chromium ${process.versions.chrome}`;
v8V.innerHTML = `V8 ${process.versions.v8}`;
nodeV.innerHTML = `Node ${process.versions.node}`;
opensslV.innerHTML = `OpenSSL ${process.versions.openssl}`;
zlibV.innerHTML = `ZLib ${process.versions.zlib}`;
uvV.innerHTML = `UV ${process.versions.uv}`;
aresV.innerHTML = `Ares ${process.versions.ares}`;
httpparserV.innerHTML = `HTTP Parser ${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();
});