Commands to start the app:
npm i
npm start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Modules to control application life and create native browser window | |
const { app, BrowserWindow } = require('electron') | |
function createWindow() { | |
// Create the browser window. | |
const mainWindow = new BrowserWindow({ | |
show: false, | |
// width: 800, | |
// height: 600, | |
// frame: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Charles Kerr, [23.10.20 12:59] | |
[37947:1023/125536.300700:FATAL:render_process_host_impl.cc(2818)] Check failed: GetID() == static_cast<int>(params->process_id) (6 vs. 4) | |
0 Electron Framework 0x000000011706dff9 base::debug::CollectStackTrace(void**, unsigned long) + 9 | |
1 Electron Framework 0x0000000116f46963 base::debug::StackTrace::StackTrace() + 19 | |
2 Electron Framework 0x0000000116f63765 logging::LogMessage::~LogMessage() + 261 | |
3 Electron Framework 0x0000000116f6445e logging::LogMessage::~LogMessage() + 14 | |
4 Electron Framework 0x0000000115eaca45 content::RenderProcessHostImpl::CreateURLLoaderFactory(mojo::PendingReceiver<network::mojom::URLLoaderFactory>, mojo::StructPtr<network::mojom::URLLoaderFactoryParams>) + 405 | |
5 Electron Framework 0x0000000115bd16ea content::RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryInternal(mojo::StructPtr<network::mojom::URLLoaderFactoryParams>, mojo::Pending |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<title>Hello World!</title> | |
<style> | |
body { color: red; } | |
</style> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {app, BrowserWindow, ipcMain} = require('electron'); | |
app.on('ready', () => { | |
const window = new BrowserWindow({ webPreferences: { webviewTag: true } }); | |
window.loadURL('file://' + app.getAppPath() + '/renderer.html'); | |
}); | |
ipcMain.on('visibilityState', (event, evType, visibilityState) => { | |
console.log('visibilityState', evType, visibilityState); | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
(() => { | |
const byId = id => document.getElementById(id) | |
const post = name => window.electron.ipcRenderer.send(name) | |
window.onload = () => { | |
const btnCreate = byId('create') | |
byId('heap-snapshot').onclick = () => { post('heap-snapshot') } |